EventTransition<T> class

A transition based on a named event such as 'turnOn'.

It's easiest to create one of these using one of these using the Transition factory method.

Note that transitions, like states, are immutable once created.

Inheritance
Annotations
  • @immutable

Constructors

EventTransition({Iterable<String> targets = const [], required String event, String? description, Condition<T>? condition, dynamic type = TransitionType.externalTransition, Action<T>? action})

Properties

action Action<T>?
An action to take when the transition is triggered.
finalinherited
condition Condition<T>?
If true, this transition should be triggered.
finalinherited
description String
A human-readable description. If none supplied, returns a default description.
no setterinherited
event String
The event name to match
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
source State<T>?
Reference back to the containing state.
latefinalinherited
targets Iterable<String>
IDs of all of the target states to activate.
finalinherited
targetStates Iterable<State<T>>
The actual target states.
latefinalinherited
type TransitionType
Is this triggered by internal or external events?
finalinherited

Methods

matches({String? anEvent, Duration? elapsedTime, T? context, dynamic ignoreContext = false}) bool
Tests whether this transition matches based on event and/or condition, ignoring elapsedTime.
override
meetsCondition(T? context) bool
Tests condition
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveStates(State<T> parent, Map<String, State<T>> stateMap) → void
Populates targetStates from targets.
inherited
toString() String
A string representation of this object.
inherited

Operators

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