onCopy property Null safety

VoidCallback? onCopy

The handler for SemanticsAction.copy.

This is a request to copy the current selection to the clipboard.

TalkBack users on Android can trigger this action from the local context menu of a text field, for example.

Implementation

VoidCallback? get onCopy => _onCopy;
void onCopy=(VoidCallback? handler)

Implementation

set onCopy(VoidCallback? handler) {
  if (_onCopy == handler)
    return;
  final bool hadValue = _onCopy != null;
  _onCopy = handler;
  if ((handler != null) != hadValue)
    markNeedsSemanticsUpdate();
}