onLongPress property

VoidCallback onLongPress

The handler for SemanticsAction.longPress.

This is the semantic equivalent of a user pressing and holding the screen with the finger for a few seconds without moving it.

VoiceOver users on iOS and TalkBack users on Android can trigger this action by double-tapping the screen without lifting the finger after the second tap.

Implementation

VoidCallback get onLongPress => _onLongPress;
void onLongPress= (VoidCallback handler)

Implementation

set onLongPress(VoidCallback handler) {
  if (_onLongPress == handler)
    return;
  final bool hadValue = _onLongPress != null;
  _onLongPress = handler;
  if ((handler != null) != hadValue)
    markNeedsSemanticsUpdate();
}