ButtonAction class final

What a button or a list row does when tapped.

type is a free string. The renderer performs navigate, navigateBack, navigateSection and the two write actions setValue and toggleValue (9.19.0) itself; every other type is handed to the host through onAction untouched.

Constructors

ButtonAction(String type, [Map<String, String> params = const {}])
Creates an action of type with params.
const

Properties

carryRecord → bool
navigate only: the opened page gets the record scope of the node even outside a list row. Exactly true in the document, nothing else.
final
haptic → HapticWord?
The haptic request of the press (9.25.0): null for no field or an unknown word, and in an action handed to the host. The word goes to onHaptic, once per press, before track and the action.
final
hashCode → int
The hash code for this object.
no setterinherited
invalid → InvalidActionParam?
A catalog action whose parameter failed the form check. Still handed to the host (it may know more than the document), but never run by runStandardAction.
final
The target screen of a navigate action; null for any other action.
no setter
paramBindings → Map<String, String>
Parameter name -> data path, as written in the document. Empty in an action handed to the host.
final
params → Map<String, String>
Parameters of the action. Only string values are read (a number or a flag is skipped, not turned into text), and an entry whose key is not of the schema form is skipped too. In an action handed to the host these are the parameters AFTER paramBindings were applied (9.8.0).
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
sectionTarget → String?
The target screen of a navigateSection action; null for any other action and for a section action without a screen.
no setter
standard → StandardAction?
A catalog action the HOST performs (openUrl, deeplink, close) whose parameters passed the form check. null for any other action, and for an invalid one. The renderer never performs it; see runStandardAction.
final
track → TrackEvent?
The analytics event of the press, as written in the document. null in an action handed to the host: the event goes to onTrack.
final
type → String
The action type, as written in the document.
final

Methods

handOver(Object? read(String path)) → ButtonAction
The action as the HOST gets it (handedAction of the contract).
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.
inherited

Static Methods

parse(Object? raw) → ButtonAction
Reads an action from decoded JSON. Never throws: anything unusable is none.

Constants

Opens the screen named in params['screenId']. Reaches the host only when the document has no such screen.
Goes one screen back. Reaches the host only from the first screen, where it means "leave the flow".
Switches to the section screen named in params['screenId']: the stack becomes that one screen. Reaches the host only when the document has no such screen.
none → const ButtonAction
An action that does nothing.
noneType → const String
An action that does nothing and does not reach the host (it may still carry an analytics track).
screenIdParam → const String
The parameter of navigate that names the target screen.