MapLocalState<K, V> class
Map state adapter for managing key-value pairs.
- Inheritance
-
- Object
- ChangeNotifier
- LocalStateAdapter<
Map< K, V> > - ValueNotifierLocalState<
Map< K, V> > - MapLocalState
Constructors
-
MapLocalState([Map<
K, V> ? initial])
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
-
keys
→ Iterable<
K> -
All keys.
no setter
- length → int
-
Number of entries.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
state
→ Map<
K, V> -
Gets the current state value.
no setterinherited
-
values
→ Iterable<
V> -
All values.
no setter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
clear(
) → void - Clears all entries.
-
containsKey(
K key) → bool - Whether the map contains a key.
-
dispose(
) → void -
Discards any resources used by the object.
inherited
-
get(
K key) → V? - Gets a value by key.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
remove(
K key) → void - Removes a key.
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
set(
K key, V value) → void - Sets a value.
-
setState(
Map< K, V> newState) → void -
Updates the state with a new value.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
Map< K, V> updater(Map<K, V> current)) → void -
Updates the state using a function.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
K key) → V? - Operator [] for getting values.