Reaction class final

A trigger and the actions it runs, in order: one chain. A blocking action is awaited before the next; a failing one stops the chain. JSON:

{"id": "r1", "name": "Add one", "trigger": {"type": "click"},
 "actions": [{"type": "setVariable", "variable": "count", "op": "add", "value": "1"}]}
Annotations
  • @immutable

Constructors

Reaction({String id = '', String name = '', required Trigger trigger, List<ActionDef> actions = const []})
const

Properties

actions → List<ActionDef>
final
allActions → Iterable<ActionDef>
Every action, nested ones included, depth first.
no setter
hashCode → int
The hash code for this object.
no setteroverride
id → String
final
name → String
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
trigger → Trigger
final
type → TriggerType
no setter

Methods

copyWith({String? id, String? name, Trigger? trigger, List<ActionDef>? actions}) → Reaction
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toJson() → Json
toString() → String
A string representation of this object.
override

Operators

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

Static Methods

fromJson(Object? json, {Catalog? catalog}) → Reaction?
Decodes a reaction, its actions with catalog (default: Catalog.current); null without a known trigger.
listFromJson(Object? json, {Catalog? catalog}) → List<Reaction>