EmpireMapProperty<K, V> class Null safety

An EmpireProperty with similar characteristics as a dart Map<K, V>

Any change to the internal map will send a EmpireStateChanged event by default. This includes automatically triggering a UI rebuild.

Inheritance

Constructors

EmpireMapProperty(Map<K, V> value, EmpireViewModel viewModel, {String? propertyName})

Properties

entries Iterable<MapEntry<K, V>>
The map entries in the map
read-only
hashCode int
The hash code for this object.
read-only, inherited
isEmpty bool
Whether there is no key/value pair in the map.
read-only
isNotEmpty bool
Whether there is at least one key/value pair in the map.
read-only
isNotNull bool
read-only, inherited
isNull bool
read-only, inherited
keys Iterable<K>
The keys of the map.
read-only
length int
The number of key/value pairs in the map.
read-only
originalValue Map<K, V>
read-only, inherited
propertyName String?
read / write, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
value Map<K, V>
read-only, inherited
values Iterable<V>
The values of the map.
read-only

Methods

add(K key, V value, {bool notifyChanges = true}) → void
If the key is already in this map, the corresponding value is overwritten.
addAll(Map<K, V> other, {bool notifyChanges = true}) → void
Adds all key/value pairs of other to this map.
addEntries(Iterable<MapEntry<K, V>> entries, {bool notifyChanges = true}) → void
Adds all key/value pairs of newEntries to this map.
addEntry(MapEntry<K, V> entry, {bool notifyChanges = true}) → void
Adds the key/value pair to this map.
call(Map<K, V> value, {bool notifyChange = true}) → void
inherited
clear({bool notifyChanges = true}) → void
Removes all entries from the map.
containsKey(K key) bool
Whether this map contains the given key.
containsValue(V value) bool
Whether this map contains the given value.
equals(dynamic other) bool
Checks if other is equal to the value of this EmpireProperty
inherited
forEach(void action(dynamic, dynamic)) → void
Applies action to each key/value pair of the map.
map<K2, V2>(MapEntry<K2, V2> convert(dynamic, dynamic)) Map<K2, V2>
Returns a new map where all entries of this map are transformed by the given convert function.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed.
inherited
remove(K key, {bool notifyChanges = true}) → V?
Removes key and its associated value, if present, from the map.
removeWhere(bool test(K key, V value), {bool notifyChanges = true}) → void
Removes all entries of this map that satisfy the given test.
reset({bool notifyChange = true}) → void
Resets the value to what it was initialized with.
inherited
set(Map<K, V> value, {bool notifyChange = true}) Map<K, V>
Updates the property value. Notifies any listeners to the change
inherited
setOriginalValueToCurrent() → void
Updates the original value to what the current value of this property is.
inherited
toString() String
A string representation of this object.
inherited
update(K key, V update(V value), {V ifAbsent()?, bool notifyChanges = true}) → V
Updates the value for the provided key.
updateAll(V update(K key, V value), {bool notifyChanges = true}) → void
Updates all values.

Operators

operator ==(dynamic other) bool
The equality operator.
inherited
operator [](K key) → V?