validActions property Null safety

Set<SemanticsAction>? validActions

If non-null, the set of actions to allow. Other actions will be omitted, even if their callback is provided.

For example, if onTap is non-null but validActions does not contain SemanticsAction.tap, then the semantic description of this node will not claim to support taps.

This is normally used to filter the actions made available by onHorizontalDragUpdate and onVerticalDragUpdate. Normally, these make both the right and left, or up and down, actions available. For example, if onHorizontalDragUpdate is set but validActions only contains SemanticsAction.scrollLeft, then the SemanticsAction.scrollRight action will be omitted.

Implementation

Set<SemanticsAction>? get validActions => _validActions;
void validActions=(Set<SemanticsAction>? value)

Implementation

set validActions(Set<SemanticsAction>? value) {
  if (setEquals<SemanticsAction>(value, _validActions)) {
    return;
  }
  _validActions = value;
  markNeedsSemanticsUpdate();
}