buildEditableTextContextMenu function

Widget buildEditableTextContextMenu(
  1. BuildContext innerContext,
  2. EditableTextState editableTextState, [
  3. UndoHistoryController? undoHistoryController
])

Implementation

Widget buildEditableTextContextMenu(
    BuildContext innerContext, EditableTextState editableTextState,
    [UndoHistoryController? undoHistoryController]) {
  TargetPlatform platform = Theme.of(innerContext).platform;

  switch (platform) {
    case TargetPlatform.android:
    case TargetPlatform.iOS:
      return MobileEditableTextContextMenu(
        anchorContext: innerContext,
        editableTextState: editableTextState,
        undoHistoryController: undoHistoryController,
      );
    case TargetPlatform.macOS:
    case TargetPlatform.windows:
    case TargetPlatform.linux:
    case TargetPlatform.fuchsia:
      return DesktopEditableTextContextMenu(
        anchorContext: innerContext,
        editableTextState: editableTextState,
        undoHistoryController: undoHistoryController,
      );
    default:
      // TODO: Other platforms. For TargetPlatform.ohos.pc2in1
      // TODO: ohos.mobile
      return DesktopEditableTextContextMenu(
        anchorContext: innerContext,
        editableTextState: editableTextState,
        undoHistoryController: undoHistoryController,
      );
  }
}