InitialData<D> class

Describes the initial value for a StateTreeBuilder.dataState that carries a value of type D.

Constructors

InitialData(D create())
Creates an InitialData that will call the create function to obtain the initial data value. The function is called each time the data state is entered.
factory
InitialData.run(D create(TransitionContext))
Creates an InitialData that will call the create function, passing the TransitionContext for the transition in progress, to obtain the initial data value. The function is called each time the data state is entered.
factory

Properties

dataType Type
The type of D.
final
hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

call(TransitionContext transCtx) → D
Creates the initial data value.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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

Static Methods

fromAncestor<D, DAncestor>(D initialValue(DAncestor ancData)) InitialData<D>
Creates an InitialData that produces its initial value by calling initialValue with a value of type DAncestor, obtained by from an ancestor state in the state tree.
fromChannel<D, P>(Channel<P> channel, D initialValue(P payload)) InitialData<D>
Creates an InitialData that produces its value by calling initialValue with the payload provided when entering the state through channel.
fromChannelAndAncestor<D, DAncestor, P>(Channel<P> channel, D initialValue(DAncestor parentData, P payload)) InitialData<D>
Creates an InitialData that produces its initial value by calling initialValue with a value of type DAncestor, obtained by from an ancestor state in the state tree, and the payload value of channel.