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.


VoidCallback? get onLongPress => _onLongPress;
void onLongPress=(VoidCallback? value)


set onLongPress(VoidCallback? value) {
  _addArgumentlessAction(SemanticsAction.longPress, value!);
  _onLongPress = value;