onTap property Null safety

VoidCallback? onTap

The handler for SemanticsAction.tap.

This is the semantic equivalent of a user briefly tapping the screen with the finger without moving it. For example, a button should implement this action.

VoiceOver users on iOS and TalkBack users on Android can trigger this action by double-tapping the screen while an element is focused.


VoidCallback? get onTap => _onTap;
void onTap=(VoidCallback? handler)


set onTap(VoidCallback? handler) {
  if (_onTap == handler)
  final bool hadValue = _onTap != null;
  _onTap = handler;
  if ((handler != null) != hadValue)