RefAppState class
- Inheritance
-
- Object
- SimpleAppState
- RefAppState
Constructors
-
RefAppState({Map<
String, dynamic> ? data}) -
data: The initial value of the managed state. This can usually be null. This value is assigned by the factory constructor when the data is restored.
Properties
Methods
-
addUIListener(
StateSlot key, String subscriberId, void callback()) → void -
(en) Adds a listener for UI updates associated with the specified
slot and ID.
Normally, you should not use this directly. Instead, consider using
a class that extends SlotStatefulWidget or StateSlotBuilder.
inherited
-
batch(
void fn()) → void -
inherited
-
clone(
) → RefAppState -
(en) Returns a clone if all contents of this class are cloneable.
Throws an error if any non-cloneable objects are included.
override
-
get<
T> (StateSlot< T> key) → T -
(en) Retrieves the value associated with the specified key.
The value that can be retrieved may be a reference value.
override
-
joinGroup(
AppStateGroup group) → void -
(en) Joins the given
groupfor coordinated batch processing. When this state belongs to a group, calling batch on any member will batch all states in the group together.inherited -
leaveGroup(
) → void -
(en) Leaves the current group.
inherited
-
loadFromDict(
Map< String, dynamic> src, Map<String, CloneableFile Function(Map< fromDictMap, {bool notifyListeners = true}) → voidString, dynamic> )> -
(en) This method is not available for this class.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyAll(
) → void -
(en) It will batch notifications to all UI listeners immediately.
inherited
-
removeStateListener(
) → void -
(en) Remove StateListener.
inherited
-
removeUIListener(
{required String subscriberId, StateSlot? key}) → void -
(en) Deletes the UI update listener associated with the specified
slot and ID.
Normally, you should not use this directly. Instead, consider using
a class that extends SlotStatefulWidget or StateSlotBuilder.
inherited
-
replaceDataFrom(
SimpleAppState other, {bool notifyListeners = true}) → void -
(en) For operations such as Undo, the current listeners are retained and
only the data is replaced. The data is deep copied.
After that, notifications are sent to all UI listeners in a batch process
to update.
In other words, the screen the user currently has open is automatically
updated.
Note that this operation deep copies the data to support Undo and Redo.
If any data cannot be deep copied, a runtime error will be thrown.
override
-
set<
T> (StateSlot< T> key, T value) → void -
(en) Sets the value for the specified key.
The data is set without copying.
Any listeners associated with the key will also be notified.
override
-
setDebugListener(
DebugListener? listener) → void -
(en) This method is not available for this class.
Use setRefDebugListener instead of this method.
override
-
setInitial<
T> (StateSlot< T> key, T value) → void -
(en) This is a set method dedicated to setting the initial value of
the Slot. This method does not notify listeners.
The data is set without copying.
override
-
setRefDebugListener(
RefDebugListener? listener) → void - (en) Adds a debug listener for developers. This listener will notify you of any value changes whenever they are made. Please note that this means that any intermediate changes to values will be tracked during batch processing, etc.
-
setStateListener(
StateListener? listener) → void -
(en) Adds a listener suitable for managing Undo and Redo.
This listener will only notify when the value change is confirmed.
For this reason, in batch processing, etc.,
notification will only be sent once at the end of the processing.
inherited
-
slot<
T> (String name, {required T initial, T caster(dynamic value)?}) → RefSlot< T> -
(en)
Returns a typed state slot associated with the given name.
override
-
toDict(
) → Map< String, dynamic> -
(en) This method is not available for this class.
override
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override