SyncStateMixin<T extends StatefulComponent, U> mixin

Mixin on State that syncs state data from the server with the client

Requires a GlobalKey on the component.

Superclass Constraints
Implemented types

Properties

component → T
The current configuration.
no setterinherited
context BuildContext
The location in the tree where this component builds.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
mounted bool
Whether this State object is currently in a tree.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
syncCodec Codec<U, dynamic>?
Codec used to serialize the state data on the server and deserialize on the client Should convert the state to any dynamic type: Null, bool, double, int, Uint8List, String, Map, List
no setteroverride
syncId String
Globally unique id used to identify the state data between server and client Returns null if state should not be synced
no setteroverride

Methods

activate() → void
Called when this object is reinserted into the tree after having been removed via deactivate.
inherited
build(BuildContext context) Iterable<Component>
Describes the part of the user interface represented by this component.
inherited
deactivate() → void
Called when this object is removed from the tree.
inherited
didChangeDependencies() → void
Called when a dependency of this State object changes.
inherited
didUpdateComponent(covariant T oldComponent) → void
Called whenever the component configuration changes.
inherited
dispose() → void
Called when this object is removed from the tree permanently.
override
getState() → U
Called on the server after the initial build, to retrieve the state data of this component.
inherited
initState() → void
Called when this object is inserted into the tree.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
setState(VoidCallback fn) → void
Notify the framework that the internal state of this object has changed.
inherited
toString() String
A string representation of this object.
inherited
updateState(U? value) → void
Called on the client when a new state value is available, either when the state is first initialized, or when the state becomes available through lazy loading a route.
override
wantsSync() bool
Can be overridden to signal that the state should not be synced
override

Operators

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