SelectionOverlay constructor
- required BuildContext context,
- Widget? debugRequiredFor,
- required TextSelectionHandleType startHandleType,
- required double lineHeightAtStart,
- ValueListenable<
bool> ? startHandlesVisible, - ValueChanged<
DragStartDetails> ? onStartHandleDragStart, - ValueChanged<
DragUpdateDetails> ? onStartHandleDragUpdate, - ValueChanged<
DragEndDetails> ? onStartHandleDragEnd, - required TextSelectionHandleType endHandleType,
- required double lineHeightAtEnd,
- ValueListenable<
bool> ? endHandlesVisible, - ValueChanged<
DragStartDetails> ? onEndHandleDragStart, - ValueChanged<
DragUpdateDetails> ? onEndHandleDragUpdate, - ValueChanged<
DragEndDetails> ? onEndHandleDragEnd, - ValueListenable<
bool> ? toolbarVisible, - required List<
TextSelectionPoint> selectionEndpoints, - required TextSelectionControls? selectionControls,
- @Deprecated('Use `contextMenuBuilder` in `showToolbar` instead. ' 'This feature was deprecated after v3.3.0-0.5.pre.') required TextSelectionDelegate? selectionDelegate,
- required ClipboardStatusNotifier? clipboardStatus,
- required LayerLink startHandleLayerLink,
- required LayerLink endHandleLayerLink,
- required LayerLink toolbarLayerLink,
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- VoidCallback? onSelectionHandleTapped,
- @Deprecated('Use `contextMenuBuilder` in `showToolbar` instead. ' 'This feature was deprecated after v3.3.0-0.5.pre.') Offset? toolbarLocation,
- TextMagnifierConfiguration magnifierConfiguration = TextMagnifierConfiguration.disabled,
Creates an object that manages overlay entries for selection handles.
Implementation
SelectionOverlay({
required this.context,
this.debugRequiredFor,
required TextSelectionHandleType startHandleType,
required double lineHeightAtStart,
this.startHandlesVisible,
this.onStartHandleDragStart,
this.onStartHandleDragUpdate,
this.onStartHandleDragEnd,
required TextSelectionHandleType endHandleType,
required double lineHeightAtEnd,
this.endHandlesVisible,
this.onEndHandleDragStart,
this.onEndHandleDragUpdate,
this.onEndHandleDragEnd,
this.toolbarVisible,
required List<TextSelectionPoint> selectionEndpoints,
required this.selectionControls,
@Deprecated(
'Use `contextMenuBuilder` in `showToolbar` instead. '
'This feature was deprecated after v3.3.0-0.5.pre.',
)
required this.selectionDelegate,
required this.clipboardStatus,
required this.startHandleLayerLink,
required this.endHandleLayerLink,
required this.toolbarLayerLink,
this.dragStartBehavior = DragStartBehavior.start,
this.onSelectionHandleTapped,
@Deprecated(
'Use `contextMenuBuilder` in `showToolbar` instead. '
'This feature was deprecated after v3.3.0-0.5.pre.',
)
Offset? toolbarLocation,
this.magnifierConfiguration = TextMagnifierConfiguration.disabled,
}) : _startHandleType = startHandleType,
_lineHeightAtStart = lineHeightAtStart,
_endHandleType = endHandleType,
_lineHeightAtEnd = lineHeightAtEnd,
_selectionEndpoints = selectionEndpoints,
_toolbarLocation = toolbarLocation,
assert(debugCheckHasOverlay(context)) {
// TODO(polina-c): stop duplicating code across disposables
// https://github.com/flutter/flutter/issues/137435
if (kFlutterMemoryAllocationsEnabled) {
FlutterMemoryAllocations.instance.dispatchObjectCreated(
library: 'package:flutter/widgets.dart',
className: '$SelectionOverlay',
object: this,
);
}
}