SelectionOverlay constructor Null safety
- {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,
- required TextSelectionDelegate selectionDelegate,
- required ClipboardStatusNotifier? clipboardStatus,
- required LayerLink startHandleLayerLink,
- required LayerLink endHandleLayerLink,
- required LayerLink toolbarLayerLink,
- DragStartBehavior dragStartBehavior = DragStartBehavior.start,
- VoidCallback? onSelectionHandleTapped,
- Offset? toolbarLocation}
Creates an object that manages overlay entries for selection handles.
The context must not be null and must have an Overlay as an ancestor.
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,
required this.selectionDelegate,
required this.clipboardStatus,
required this.startHandleLayerLink,
required this.endHandleLayerLink,
required this.toolbarLayerLink,
this.dragStartBehavior = DragStartBehavior.start,
this.onSelectionHandleTapped,
Offset? toolbarLocation,
}) : _startHandleType = startHandleType,
_lineHeightAtStart = lineHeightAtStart,
_endHandleType = endHandleType,
_lineHeightAtEnd = lineHeightAtEnd,
_selectionEndpoints = selectionEndpoints,
_toolbarLocation = toolbarLocation {
final OverlayState? overlay = Overlay.of(context, rootOverlay: true);
assert(
overlay != null,
'No Overlay widget exists above $context.\n'
'Usually the Navigator created by WidgetsApp provides the overlay. Perhaps your '
'app content was created above the Navigator with the WidgetsApp builder parameter.',
);
}