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
-
- Object
- ChangeNotifier
- ValueNotifier<
Map< K, V> > - ListenableMap
- Implemented types
-
- Map<
K, V>
- Map<
- 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<
Whether there is no key/value pair in the map.K, V> ?, provided by the NullableMapExtensions extensionno setter - isJsonEncodable → bool
-
Available on Map<
If this object is Json encodable,K, V> , provided by the MapExtensions extensiontrue
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<
Whether there is at least one key/value pair in the map.K, V> ?, provided by the NullableMapExtensions extensionno 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<
The number of key/value pairs in the map.K, V> ?, provided by the NullableMapExtensions extensionno 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<
AddK, V> , provided by the MapExtensions extensionothers
to Map. -
addEntries(
Iterable< MapEntry< newEntries) → voidK, V> > -
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<
Set only the value of the key specified byK, V> , provided by the MapExtensions extensionkeys
in the map specified byothers
. -
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 -
containsKey(
Object? key) → bool -
Available on Map<
Whether this map contains the givenK, V> ?, provided by the NullableMapExtensions extensionkey
. -
containsKeyAll(
Iterable< Object?> keys) → bool -
Available on Map<
ReturnsK, V> ?, provided by the NullableMapExtensions extensiontrue
if allkeys
are included in the keys of Map. -
containsKeyAll(
Iterable< Object?> keys) → bool -
Available on Map<
ReturnsK, V> , provided by the MapExtensions extensiontrue
if allkeys
are included in the keys of Map. -
containsKeyAny(
Iterable< Object?> keys) → bool -
Available on Map<
ReturnsK, V> , provided by the MapExtensions extensiontrue
if any of the keys in Map contain any of the keys inkeys
. -
containsKeyAny(
Iterable< Object?> keys) → bool -
Available on Map<
ReturnsK, V> ?, provided by the NullableMapExtensions extensiontrue
if any of the keys in Map contain any of the keys inkeys
. -
containsValue(
Object? value) → bool -
Whether this map contains the given
value
.override -
containsValue(
Object? value) → bool -
Available on Map<
Whether this map contains the givenK, V> ?, provided by the NullableMapExtensions extensionvalue
. -
containsValueAll(
Iterable< Object?> values) → bool -
Available on Map<
ReturnsK, V> , provided by the MapExtensions extensiontrue
if the value of Map contains allvalues
. -
containsValueAll(
Iterable< Object?> values) → bool -
Available on Map<
ReturnsK, V> ?, provided by the NullableMapExtensions extensiontrue
if the value of Map contains allvalues
. -
containsValueAny(
Iterable< Object?> values) → bool -
Available on Map<
ReturnsK, V> ?, provided by the NullableMapExtensions extensiontrue
if the value of Map contains one ofvalues
. -
containsValueAny(
Iterable< Object?> values) → bool -
Available on Map<
ReturnsK, V> , provided by the MapExtensions extensiontrue
if the value of Map contains one ofvalues
. -
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<
ReturnsK, V> , provided by the MapExtensions extensiontrue
if the internals of Map andothers
are compared and match. -
equalsTo(
Map< K, V> ? others) → bool -
Available on Map<
ReturnsK, V> ?, provided by the NullableMapExtensions extensiontrue
if the internals of Map andothers
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<
Retrieves the elementK, V> , provided by the MapExtensions extensionkey
from Map. -
get<
T> (K key, T orElse) → T -
Available on Map<
Retrieves the elementK, V> ?, provided by the NullableMapExtensions extensionkey
from Map. -
getAsDateTime(
K key, [DateTime? orElse]) → DateTime -
Available on Map<
Retrieves the element ofK, V> , provided by the MapExtensions extensionkey
of type Map from Map. -
getAsDateTime(
K key, [DateTime? orElse]) → DateTime -
Available on Map<
Retrieves the element ofK, V> ?, provided by the NullableMapExtensions extensionkey
of type Map from Map. -
getAsDouble(
K key, [double orElse = 0.0]) → double -
Available on Map<
Retrieves the element ofK, V> ?, provided by the NullableMapExtensions extensionkey
of type double from Map. -
getAsDouble(
K key, [double orElse = 0.0]) → double -
Available on Map<
Retrieves the element ofK, V> , provided by the MapExtensions extensionkey
of type double from Map. -
getAsGeoData(
K key, [GeoData? orElse]) → GeoData -
Available on Map<
Get the geo data corresponding toK, V> ?, provided by the NullableGeoMapExtensions extensionkey
in the map. -
getAsGeoData(
K key, [GeoData? orElse]) → GeoData -
Available on Map<
Get the geo data corresponding toK, V> , provided by the GeoMapExtensions extensionkey
in the map. -
getAsInt(
K key, [int orElse = 0]) → int -
Available on Map<
Retrieves the element ofK, V> , provided by the MapExtensions extensionkey
of type int from Map. -
getAsInt(
K key, [int orElse = 0]) → int -
Available on Map<
Retrieves the element ofK, V> ?, provided by the NullableMapExtensions extensionkey
of type int from Map. -
getAsList<
T> (K key, [List< T> ? orElse]) → List<T> -
Available on Map<
Retrieves the element ofK, V> , provided by the MapExtensions extensionkey
of type List from Map. -
getAsList<
T> (K key, [List< T> ? orElse]) → List<T> -
Available on Map<
Retrieves the element ofK, V> ?, provided by the NullableMapExtensions extensionkey
of type List from Map. -
getAsMap<
T> (K key, [Map< String, T> ? orElse]) → Map<String, T> -
Available on Map<
Retrieves the element ofK, V> , provided by the MapExtensions extensionkey
of type Map from Map. -
getAsMap<
T> (K key, [Map< String, T> ? orElse]) → Map<String, T> -
Available on Map<
Retrieves the element ofK, V> ?, provided by the NullableMapExtensions extensionkey
of type Map from Map. -
getAsSet<
T> (K key, [Set< T> ? orElse]) → Set<T> -
Available on Map<
Retrieves the element ofK, V> ?, provided by the NullableMapExtensions extensionkey
of type Set from Map. -
getAsSet<
T> (K key, [Set< T> ? orElse]) → Set<T> -
Available on Map<
Retrieves the element ofK, V> , provided by the MapExtensions extensionkey
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<
Merges elements ofK, V> , provided by the MapExtensions extensionothers
into Map. -
mergeListenable(
ValueListenable< Map< others, {K convertKeys(K key)?, V convertValues(V value)?}) → ListenableMap<K, V> >K, V> -
Available on ValueListenable<
Merges the map inMap< , provided by the ListenableMapExtensions extensionK, V> >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<
Returns a list ofK, V> , provided by the MapExtensions extensioncallback
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<
Converts a DynamicMap with a key of String in the path structure to a DynamicMap in the tree structure.String, dynamic> , provided by the DynamicMapExtensions extension -
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<
Extracts only elements for which the return value of the callback given byK, V> , provided by the MapExtensions extensiontest
istrue
.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
override
-
operator [](
Object? key) → V? -
The value for the given
key
, or null ifkey
is not in the map.override -
operator []=(
K key, V value) → void -
Associates the
key
with the givenvalue
.override