Skip to content

Instantly share code, notes, and snippets.

@mono0926
Created November 27, 2024 06:21
Show Gist options
  • Save mono0926/2e985237fee1e7fd8cf1f2a4dbe23f16 to your computer and use it in GitHub Desktop.
Save mono0926/2e985237fee1e7fd8cf1f2a4dbe23f16 to your computer and use it in GitHub Desktop.
/// SystemContextMenu対応のcontextMenuBuilder
///
/// SystemContextMenuがサポートされている場合はそれを利用したネイティブUIで、
/// それ以外の時は無指定の時と同じ挙動
Widget contextMenuBuilder(
BuildContext context,
EditableTextState editableTextState,
) =>
SystemContextMenu.isSupported(context)
? SystemContextMenu.editableText(
editableTextState: editableTextState,
)
: AdaptiveTextSelectionToolbar.editableText(
editableTextState: editableTextState,
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment