CustomSemanticsAction class

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:

Annotations

Constructors

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

Properties

action SemanticsAction?
The standard semantics action this action replaces.
final
hashCode int
The hash code for this object.
no setteroverride
hint String?
The hint description of this custom semantics action.
final
label String?
The user readable name of this custom semantics action.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

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

Operators

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

Static Methods

getAction(int id) CustomSemanticsAction?
Get the action for a given identifier.
getIdentifier(CustomSemanticsAction action) int
Get the identifier for a given action.
resetForTests() → void
Resets internal state between tests. Does nothing if asserts are disabled.