CustomSemanticsAction class Null safety

An identifier of a custom semantics action.

Custom semantics actions can be provided to make complex user interactions more accessible. For instance, if an application has a drag-and-drop list that requires the user to press and hold an item to move it, users interacting with the application using a hardware switch may have difficulty. This can be made accessible by creating custom actions and pairing them with handlers that move a list item up or down in the list.

In Android, these actions are presented in the local context menu. In iOS, these are presented in the radial context menu.

Localization and text direction do not automatically apply to the provided label or hint.

Instances of this class should either be instantiated with const or new instances cached in static fields.

See also:



CustomSemanticsAction({required String label})
Creates a new CustomSemanticsAction.
CustomSemanticsAction.overridingAction({required String hint, required SemanticsAction action})
Creates a new CustomSemanticsAction that overrides a standard semantics action.


action SemanticsAction?
The standard semantics action this action replaces.
hashCode int
The hash code for this object.
read-only, override
hint String?
The hint description of this custom semantics action.
label String?
The user readable name of this custom semantics action.
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited


noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
toString() String
A string representation of this object.


operator ==(Object other) bool
The equality operator.

Static Methods

getAction(int id) CustomSemanticsAction?
Get the action for a given identifier.
getIdentifier(CustomSemanticsAction action) int
Get the identifier for a given action.