Interface for reactive map signals.
MapSignal extends Signal to provide full Map functionality while maintaining reactivity. All map operations (put, remove, clear, etc.) will trigger notifications to subscribers.
Example:
MapSignal<String, dynamic> userMap = MapSignal({'name': 'Alice', 'age': 30});
Effect(() => print('User: ${userMap['name']}'));
userMap['name'] = 'Bob'; // Triggers effect
- Implemented types
-
- Signal<
Map< K, V> > - MapSignalMixin<
K, V>
- Signal<
- Implementers
Constructors
-
MapSignal(Map<
K, V> ? value, {JoltDebugOption? debug}) -
Creates a reactive map signal with the given initial map.
factory
Properties
-
entries
→ Iterable<
MapEntry< K, V> > -
The map entries of this map.
no setterinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- isDisposed → bool
-
Whether this node has been disposed.
no setterinherited
- isEmpty → bool
-
Whether this map is empty.
no setterinherited
- isNotEmpty → bool
-
Whether this map is not empty.
no setterinherited
-
keys
→ Iterable<
K> -
The keys of this map.
no setterinherited
- length → int
-
The number of key-value pairs in the map.
no setterinherited
-
peek
→ Map<
K, V> -
Gets the current value without establishing a reactive dependency.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
value
↔ Map<
K, V> -
Gets the current value and establishes a reactive dependency.
getter/setter pairinherited
-
values
→ Iterable<
V> -
The values of this map.
no setterinherited
Methods
-
addAll(
Map< K, V> other) → void -
Adds all key-value pairs from the given map to this map.
inherited
-
addEntries(
Iterable< MapEntry< newEntries) → voidK, V> > -
Adds all entries from the given iterable to this map.
inherited
-
cast<
RK, RV> () → Map< RK, RV> -
Returns a view of this map as having
RKkeys andRVinstances.inherited -
clear(
) → void -
Removes all entries from the map.
inherited
-
containsKey(
Object? key) → bool -
Returns true if this map contains the given key.
inherited
-
containsValue(
Object? targetValue) → bool -
Returns true if this map contains the given value.
inherited
-
dispose(
) → void -
Disposes this node and cleans up resources.
inherited
-
forEach(
void action(K key, V value)) → void -
Applies the given function to each key-value pair in the map.
inherited
-
map<
K2, V2> (MapEntry< K2, V2> convert(K key, V value)) → Map<K2, V2> -
Returns a new map where each entry is transformed by the given function.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notify(
[bool force]) → void -
Triggers a change notification without modifying the value.
inherited
-
putIfAbsent(
K key, V ifAbsent()) → V -
Look up the value of
key, or add a new entry if it isn't there.inherited -
remove(
Object? key) → V? -
Removes the entry for the given key and returns its value.
inherited
-
removeWhere(
bool test(K key, V value)) → void -
Removes all entries that satisfy the given test.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
update(
K key, V update(V value), {V ifAbsent()?}) → V -
Updates the value for the given key.
inherited
-
updateAll(
V update(K key, V value)) → void -
Updates all values in the map.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
Object? key) → V? -
Gets the value associated with the given key.
inherited
-
operator []=(
K key, V value) → void -
Sets the value associated with the given key.
inherited