buildToolbar method Null safety

Widget buildToolbar(
  1. BuildContext context,
  2. Rect globalEditableRegion,
  3. double textLineHeight,
  4. Offset position,
  5. List<TextSelectionPoint> endpoints,
  6. TextSelectionDelegate delegate,
  7. ClipboardStatusNotifier? clipboardStatus,
  8. Offset? lastSecondaryTapDownPosition
)

Builds a toolbar near a text selection.

Typically displays buttons for copying and pasting text.

globalEditableRegion is the TextField size of the global coordinate system in logical pixels.

textLineHeight is the preferredLineHeight of the RenderEditable we are building a toolbar for.

The position is a general calculation midpoint parameter of the toolbar. If you want more detailed position information, can use endpoints to calculate it.

Implementation

Widget buildToolbar(
  BuildContext context,
  Rect globalEditableRegion,
  double textLineHeight,
  Offset position,
  List<TextSelectionPoint> endpoints,
  TextSelectionDelegate delegate,
  // TODO(chunhtai): Change to ValueListenable<ClipboardStatus>? once
  // mirgration is done. https://github.com/flutter/flutter/issues/99360
  ClipboardStatusNotifier? clipboardStatus,
  Offset? lastSecondaryTapDownPosition,
);