MpStateManager class

Typed facade around MpStore owned by a mini-program host instance.

Constructors

MpStateManager({MpStore? store, MiniProgramLiveStatePolicy policy = const MiniProgramLiveStatePolicy()})
Creates a state manager backed by store or a new MpStore.

Properties

hashCode int
The hash code for this object.
no setterinherited
policy MiniProgramLiveStatePolicy
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
store MpStore
Backing store for advanced host-side inspection and tests.
final

Methods

batchUpdates(void updates()) → void
Applies synchronous state writes atomically with one watcher update.
clear() → void
Clears all memory state for this mini-program instance.
contains(String key) bool
Whether key currently exists, including null values.
dispose() → void
Releases state resources.
get<T>(String key) → T?
Reads key and casts it to T when possible.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
put(String key, Object? value) → void
Creates or replaces key with value.
remove(String key) → void
Removes key if present.
set(String key, Object? value) → void
Replaces key with value.
toBindingData() Map<String, dynamic>
Binding data exposed under {{state.*}}.
toString() String
A string representation of this object.
inherited
updatePolicy(MiniProgramLiveStatePolicy policy) → void
watch(String key) ValueListenable<Object?>
Watches key for related changes.

Operators

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