SelectionOverlay constructor

SelectionOverlay({
  1. required BuildContext context,
  2. Widget? debugRequiredFor,
  3. required TextSelectionHandleType startHandleType,
  4. required double lineHeightAtStart,
  5. ValueListenable<bool>? startHandlesVisible,
  6. ValueChanged<DragStartDetails>? onStartHandleDragStart,
  7. ValueChanged<DragUpdateDetails>? onStartHandleDragUpdate,
  8. ValueChanged<DragEndDetails>? onStartHandleDragEnd,
  9. required TextSelectionHandleType endHandleType,
  10. required double lineHeightAtEnd,
  11. ValueListenable<bool>? endHandlesVisible,
  12. ValueChanged<DragStartDetails>? onEndHandleDragStart,
  13. ValueChanged<DragUpdateDetails>? onEndHandleDragUpdate,
  14. ValueChanged<DragEndDetails>? onEndHandleDragEnd,
  15. ValueListenable<bool>? toolbarVisible,
  16. required List<TextSelectionPoint> selectionEndpoints,
  17. required TextSelectionControls? selectionControls,
  18. @Deprecated('Use `contextMenuBuilder` in `showToolbar` instead. ' 'This feature was deprecated after v3.3.0-0.5.pre.') required TextSelectionDelegate? selectionDelegate,
  19. required ClipboardStatusNotifier? clipboardStatus,
  20. required LayerLink startHandleLayerLink,
  21. required LayerLink endHandleLayerLink,
  22. required LayerLink toolbarLayerLink,
  23. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  24. VoidCallback? onSelectionHandleTapped,
  25. @Deprecated('Use `contextMenuBuilder` in `showToolbar` instead. ' 'This feature was deprecated after v3.3.0-0.5.pre.') Offset? toolbarLocation,
  26. TextMagnifierConfiguration magnifierConfiguration = TextMagnifierConfiguration.disabled,
})

Creates an object that manages overlay entries for selection handles.

The context 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,
  @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,
    );
  }
}