Stateful class abstract
Designates a node as Stateful, meaning it can save and load its state. You are responsible for implementing load / save state methods.
Constructors
- Stateful()
Properties
- $storage → NodeStorage?
-
Available on Stateful, provided by the XStateful extension
no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- storageKey → String
-
Available on Stateful, provided by the XStateful extension
The storage key for this node, expects a tag to be included in the key if you want regular tag support.no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onLoad(
Map< String, dynamic> state, {bool hotloaded = false}) → Future<void> - Called when the node needs to load its state from storage. After startup, your state will be saved again so feel free to modify your node for assuming defaults if needed.
-
onSave(
) → Future< Map< String, dynamic> > - Called when the node needs to save its state to storage.
-
reloadState(
) → Future< void> -
saveState(
) → Future< void> -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
$callLoad(
Node node, NodeStorage storage, PrecisionStopwatch wallClock, {bool hotload = false}) → Future< void> -
$callSave(
Node node, NodeStorage storage, PrecisionStopwatch wallClock) → Future< void>