ListenableMap<K, V> class

This is a ChangeNotifier class that can be handled as a map.

When the contents of the map change, you will be notified of the change.

Inheritance
Implemented types
Implementers
Available extensions

Constructors

ListenableMap.new()
This is a ChangeNotifier class that can be handled as a map.
ListenableMap.from(Map<K, V> map)
This is a ChangeNotifier class that can be handled as a map.
ListenableMap.fromListenable(Listenable listenable)
This is a ChangeNotifier class that can be handled as a map.
factory

Properties

entries Iterable<MapEntry<K, V>>
The map entries of this.
no setteroverride
hashCode int
The hash code for this object.
no setteroverride
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isEmpty bool
Whether there is no key/value pair in the map.
no setteroverride
isEmpty bool

Available on Map<K, V>?, provided by the NullableMapExtensions extension

Whether there is no key/value pair in the map.
no setter
isJsonEncodable bool

Available on Map<K, V>, provided by the MapExtensions extension

If this object is Json encodable, true is returned.
no setter
isNotEmpty bool
Whether there is at least one key/value pair in the map.
no setteroverride
isNotEmpty bool

Available on Map<K, V>?, provided by the NullableMapExtensions extension

Whether there is at least one key/value pair in the map.
no setter
keys Iterable<K>
The keys of this.
no setteroverride
length int
The number of key/value pairs in the map.
no setteroverride
length int

Available on Map<K, V>?, provided by the NullableMapExtensions extension

The number of key/value pairs in the map.
no setter
locale String

Available on DynamicMap, provided by the MasamuneDynamicMapExtensions extension

Get the locale.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
time int

Available on DynamicMap, provided by the MasamuneDynamicMapExtensions extension

Get the time.
no setter
uid String

Available on DynamicMap, provided by the MasamuneDynamicMapExtensions extension

Get the uid.
no setter
value Map<K, V>
The current value stored in this notifier.
getter/setter pairinherited
values Iterable<V>
The values of this.
no setteroverride

Methods

addAll(Map<K, V> other) → void
Adds all key/value pairs of other to this map.
override
addAllIfEmpty(Map<K, V>? others) → void

Available on Map<K, V>, provided by the MapExtensions extension

Add others to Map.
addEntries(Iterable<MapEntry<K, V>> newEntries) → void
Adds all key/value pairs of newEntries to this map.
override
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
addWith(Map<K, V> others, Iterable<K> keys) Map<K, V>

Available on Map<K, V>, provided by the MapExtensions extension

Set only the value of the key specified by keys in the map specified by others.
cast<RK, RV>() Map<RK, RV>
Provides a view of this map as having RK keys and RV 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
containsKey(Object? key) bool

Available on Map<K, V>?, provided by the NullableMapExtensions extension

Whether this map contains the given key.
containsKeyAll(Iterable<Object?> keys) bool

Available on Map<K, V>?, provided by the NullableMapExtensions extension

Returns true if all keys are included in the keys of Map.
containsKeyAll(Iterable<Object?> keys) bool

Available on Map<K, V>, provided by the MapExtensions extension

Returns true if all keys are included in the keys of Map.
containsKeyAny(Iterable<Object?> keys) bool

Available on Map<K, V>, provided by the MapExtensions extension

Returns true if any of the keys in Map contain any of the keys in keys.
containsKeyAny(Iterable<Object?> keys) bool

Available on Map<K, V>?, provided by the NullableMapExtensions extension

Returns true if any of the keys in Map contain any of the keys in keys.
containsValue(Object? value) bool
Whether this map contains the given value.
override
containsValue(Object? value) bool

Available on Map<K, V>?, provided by the NullableMapExtensions extension

Whether this map contains the given value.
containsValueAll(Iterable<Object?> values) bool

Available on Map<K, V>, provided by the MapExtensions extension

Returns true if the value of Map contains all values.
containsValueAll(Iterable<Object?> values) bool

Available on Map<K, V>?, provided by the NullableMapExtensions extension

Returns true if the value of Map contains all values.
containsValueAny(Iterable<Object?> values) bool

Available on Map<K, V>?, provided by the NullableMapExtensions extension

Returns true if the value of Map contains one of values.
containsValueAny(Iterable<Object?> values) bool

Available on Map<K, V>, provided by the MapExtensions extension

Returns true if the value of Map contains one of values.
dependOn(Listenable listenable, [Map<K, V> filter(Map<K, V> origin)?]) → void
Sends a notification to itself when the target listenable is updated.
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener and removeListener will throw after the object is disposed).
override
equalsTo(Map<K, V> others) bool

Available on Map<K, V>, provided by the MapExtensions extension

Returns true if the internals of Map and others are compared and match.
equalsTo(Map<K, V>? others) bool

Available on Map<K, V>?, provided by the NullableMapExtensions extension

Returns true if the internals of Map and others are compared and match.
forEach(void action(K key, V value)) → void
Applies action to each key/value pair of the map.
override
get<T>(K key, T orElse) → T

Available on Map<K, V>, provided by the MapExtensions extension

Retrieves the element key from Map.
get<T>(K key, T orElse) → T

Available on Map<K, V>?, provided by the NullableMapExtensions extension

Retrieves the element key from Map.
getAsDateTime(K key, [DateTime? orElse]) DateTime

Available on Map<K, V>, provided by the MapExtensions extension

Retrieves the element of key of type Map from Map.
getAsDateTime(K key, [DateTime? orElse]) DateTime

Available on Map<K, V>?, provided by the NullableMapExtensions extension

Retrieves the element of key of type Map from Map.
getAsDouble(K key, [double orElse = 0.0]) double

Available on Map<K, V>?, provided by the NullableMapExtensions extension

Retrieves the element of key of type double from Map.
getAsDouble(K key, [double orElse = 0.0]) double

Available on Map<K, V>, provided by the MapExtensions extension

Retrieves the element of key of type double from Map.
getAsGeoData(K key, [GeoData? orElse]) GeoData

Available on Map<K, V>?, provided by the NullableGeoMapExtensions extension

Get the geo data corresponding to key in the map.
getAsGeoData(K key, [GeoData? orElse]) GeoData

Available on Map<K, V>, provided by the GeoMapExtensions extension

Get the geo data corresponding to key in the map.
getAsInt(K key, [int orElse = 0]) int

Available on Map<K, V>, provided by the MapExtensions extension

Retrieves the element of key of type int from Map.
getAsInt(K key, [int orElse = 0]) int

Available on Map<K, V>?, provided by the NullableMapExtensions extension

Retrieves the element of key of type int from Map.
getAsList<T>(K key, [List<T>? orElse]) List<T>

Available on Map<K, V>, provided by the MapExtensions extension

Retrieves the element of key of type List from Map.
getAsList<T>(K key, [List<T>? orElse]) List<T>

Available on Map<K, V>?, provided by the NullableMapExtensions extension

Retrieves the element of key of type List from Map.
getAsMap<T>(K key, [Map<String, T>? orElse]) Map<String, T>

Available on Map<K, V>, provided by the MapExtensions extension

Retrieves the element of key of type Map from Map.
getAsMap<T>(K key, [Map<String, T>? orElse]) Map<String, T>

Available on Map<K, V>?, provided by the NullableMapExtensions extension

Retrieves the element of key of type Map from Map.
getAsSet<T>(K key, [Set<T>? orElse]) Set<T>

Available on Map<K, V>?, provided by the NullableMapExtensions extension

Retrieves the element of key of type Set from Map.
getAsSet<T>(K key, [Set<T>? orElse]) Set<T>

Available on Map<K, V>, provided by the MapExtensions extension

Retrieves the element of key of type Set from Map.
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
merge(Map<K, V>? others, {K convertKeys(K key)?, V convertValues(V value)?}) Map<K, V>

Available on Map<K, V>, provided by the MapExtensions extension

Merges elements of others into Map.
mergeListenable(ValueListenable<Map<K, V>> others, {K convertKeys(K key)?, V convertValues(V value)?}) ListenableMap<K, V>

Available on ValueListenable<Map<K, V>>, provided by the ListenableMapExtensions extension

Merges the map in others with the current map.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
putIfAbsent(K key, V ifAbsent()) → V
Look up the value of key, or add a new entry if it isn't there.
override
remove(Object? key) → V?
Removes key and its associated value, if present, from the map.
override
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
removeWhere(bool test(K key, V value)) → void
Removes all entries of this map that satisfy the given test.
override
toJsonString() String

Available on DynamicMap, provided by the JsonDynamicMapExtensions extension

Convert the contents of DynamicMap to a Json String.
toList<T>(T callback(K key, V value)) Iterable<T>

Available on Map<K, V>, provided by the MapExtensions extension

Returns a list of callback return values generated from Map.
toString() String
A string representation of this object.
inherited
toTreeMap([String keyBuilder(String key)?]) Map<String, dynamic>

Available on Map<String, dynamic>, provided by the DynamicMapExtensions extension

Converts a DynamicMap with a key of String in the path structure to a DynamicMap in the tree structure.
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
where(bool test(K key, V value)) Map<K, V>

Available on Map<K, V>, provided by the MapExtensions extension

Extracts only elements for which the return value of the callback given by test is true.

Operators

operator ==(Object other) bool
The equality operator.
override
operator [](Object? key) → V?
The value for the given key, or null if key is not in the map.
override
operator []=(K key, V value) → void
Associates the key with the given value.
override