onLongPress property Null safety

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? handler)


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