buildToolbarWithActions method

  1. @override
Widget buildToolbarWithActions(
  1. BuildContext context,
  2. Rect globalEditableRegion,
  3. double textLineHeight,
  4. Offset selectionMidpoint,
  5. List<TextSelectionPoint> endpoints,
  6. TextSelectionDelegate delegate,
  7. ClipboardStatusNotifier clipboardStatus,
  8. Offset? lastSecondaryTapDownPosition, {
  9. List<CreamyTextSelectionToolbarAction> actions = const [],
})
override

Builder for material-style copy/paste text selection toolbar.

Implementation

@override
Widget buildToolbarWithActions(
  BuildContext context,
  Rect globalEditableRegion,
  double textLineHeight,
  Offset selectionMidpoint,
  List<TextSelectionPoint> endpoints,
  TextSelectionDelegate delegate,
  ClipboardStatusNotifier clipboardStatus,
  Offset? lastSecondaryTapDownPosition, {
  List<CreamyTextSelectionToolbarAction> actions = const [],
}) {
  assert(debugCheckHasMediaQuery(context));
  assert(debugCheckHasMaterialLocalizations(context));

  return _TextSelectionControlsToolbar(
    globalEditableRegion: globalEditableRegion,
    textLineHeight: textLineHeight,
    selectionMidpoint: selectionMidpoint,
    endpoints: endpoints,
    delegate: delegate,
    clipboardStatus: clipboardStatus,
    handleCut: canCut(delegate) ? () => handleCut(delegate) : null,
    handleCopy: canCopy(delegate)
        ? () => handleCopy(delegate, clipboardStatus)
        : null,
    handlePaste: canPaste(delegate) ? () => handlePaste(delegate) : null,
    handleSelectAll:
        canSelectAll(delegate) ? () => handleSelectAll(delegate) : null,
    actions: actions,
  );
}