This example shows modifying the Copy button to show a dialog in addition to
doing its usual copy logic.

TextField

contextMenuBuilder:

BuildContext

context

EditableTextState

editableTextState

final

List

ContextMenuButtonItem

buttonItems

editableTextState

contextMenuButtonItems

final

int

copyButtonIndex

buttonItems

indexWhere

ContextMenuButtonItem

buttonItem

return

buttonItem

type

==

ContextMenuButtonType

copy

},

);

if

copyButtonIndex

final

ContextMenuButtonItem