MapSignalMixin<K, V, T extends Map<K, V> > mixin
Mixin to upgrade an map signal with reactive properties
Properties
- autoDispose ↔ bool
-
Throws and error if read after dispose and can be
disposed on last unsubscribe.
getter/setter pairinherited
- brand → Symbol
-
finalinherited
- debugLabel → String?
-
Debug label for Debug Mode
finalinherited
- disposed ↔ bool
-
Check if the effect is disposed
getter/setter pairinherited
-
entries
→ Iterable<
MapEntry< K, V> > -
The map entries of this Map.
no setteroverride
- equalityCheck ↔ bool Function(T a, T b)
-
Optional method to check if to values are the same
getter/setter pairinherited
- globalId → int
-
Global ID of the signal
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- internalValue ↔ T
-
getter/setter pairinherited
- isEmpty → bool
-
Whether there is no key/value pair in the map.
no setteroverride
- isInitialized ↔ bool
-
Check if a signal value is set (does not subscribe)
getter/setter pairinherited
- isNotEmpty → bool
-
Whether there is at least one key/value pair in the map.
no setteroverride
-
keys
→ Iterable<
K> -
The keys of this Map.
no setteroverride
- length → int
-
The number of key/value pairs in the map.
no setteroverride
- node ↔ Node?
-
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- targets ↔ Node?
-
getter/setter pairinherited
- value ↔ T
-
Compute the current value
getter/setter pairinherited
-
values
→ Iterable<
V> -
The values of this Map.
no setteroverride
- version ↔ int
-
Version numbers should always be >= 0, because the special value -1 is used
by Nodes to signify potentially unused but recyclable nodes.
getter/setter pairinherited
Methods
-
addAll(
Map< K, V> other) → void -
Adds all key/value pairs of
other
to this map.override -
addEntries(
Iterable< MapEntry< newEntries) → voidK, V> > -
Adds all key/value pairs of
newEntries
to this map.override -
afterCreate(
T val) → void -
Internal hook for after a signal is created
inherited
-
beforeUpdate(
T val) → void -
Internal hook for after a signal is updated
inherited
-
call(
) → T -
Return the value when invoked
inherited
-
cast<
RK, RV> () → Map< RK, RV> -
Provides a view of this map as having
RK
keys andRV
instances, if necessary.override -
clear(
) → void -
Removes all entries from the map.
override
-
containsKey(
Object? key) → bool -
Whether this map contains the given
key
.override -
containsValue(
Object? value) → bool -
Whether this map contains the given
value
.override -
dispose(
) → void -
Dispose the signal
inherited
-
forEach(
void action(K key, V value)) → void -
Applies
action
to each key/value pair of the map.override -
get(
) → T -
Helper method to get the current value
inherited
-
internalRefresh(
) → bool -
inherited
-
internalSetValue(
T val) → void -
inherited
-
map<
K2, V2> (MapEntry< K2, V2> convert(K key, V value)) → Map<K2, V2> -
Returns a new map where all entries of this map are transformed by
the given
convert
function.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
onDispose(
void cleanup()) → EffectCleanup -
Add a cleanup function to be called when the signal is disposed
inherited
-
overrideWith(
T val) → Signal< T> -
Override the current signal with a new value as if it was created with it
inherited
-
peek(
) → T -
In the rare instance that you have an effect that should write to another signal based on the previous value, but you don't want the effect to be subscribed to that signal, you can read a signals's previous value via
signal.peek()
.inherited -
putIfAbsent(
K key, V ifAbsent()) → V -
Look up the value of
key
, or add a new entry if it isn't there.override -
readonly(
) → ReadonlySignal< T> -
Returns a readonly signal
inherited
-
remove(
Object? key) → V? -
Removes
key
and its associated value, if present, from the map.override -
removeWhere(
bool test(K key, V value)) → void -
Removes all entries of this map that satisfy the given
test
.override -
set(
T val, {bool force = false}) → bool -
Set the current value by a method
inherited
-
subscribe(
void fn(T value)) → void Function() -
Subscribe to value changes with a dispose function
inherited
-
subscribeToNode(
Node node) → void -
inherited
-
toJson(
) → dynamic -
Convert value to JSON
inherited
-
toMap(
) → Map< K, V> -
Snapshot of
MapEntries
-
toSignal(
{String? debugLabel, bool autoDispose = false}) → MapSignal< K, V> -
Available on Map<
Convert an existing list to MapSignalK, V> , provided by the SignalMapUtils extension -
toString(
) → String -
A string representation of this object.
inherited
-
unsubscribeFromNode(
Node node) → void -
inherited
-
update(
K key, V update(V value), {V ifAbsent()?}) → V -
Updates the value for the provided
key
.override -
updateAll(
V update(K key, V value)) → void -
Updates all values.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
Object? key) → V? -
The value for the given
key
, ornull
ifkey
is not in the map.override -
operator []=(
K key, V value) → void -
Associates the
key
with the givenvalue
.override