EmpireMapProperty<K, V> class
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
-
- Object
- EmpireProperty<
Map< K, V> > - EmpireMapProperty
Constructors
-
EmpireMapProperty(Map<
K, V> value, {String? propertyName}) - EmpireMapProperty.empty({String? propertyName})
-
Factory constructor for initializing an EmpireMapProperty to an empty Map.
factory
Properties
-
entries
→ Iterable<
MapEntry< K, V> > -
The map entries in the map
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- isEmpty → bool
-
Whether there is no key/value pair in the map.
no setter
- isNotEmpty → bool
-
Whether there is at least one key/value pair in the map.
no setter
- isNotNull → bool
-
Returns true if the value of this is not null.
no setterinherited
- isNull → bool
-
Returns true if the value of this is null.
no setterinherited
-
keys
→ Iterable<
K> -
The keys of the map.
no setter
- length → int
-
The number of key/value pairs in the map.
no setter
-
originalValue
→ Map<
K, V> -
no setterinherited
- propertyName ↔ String?
-
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
value
→ Map<
K, V> -
no setterinherited
-
values
→ Iterable<
V> -
The values of the map.
no setter
- viewModel → EmpireViewModel
-
Returns the instance of the EmpireViewModel this
property is associated with.
no setterinherited
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< entries, {bool notifyChanges = true}) → voidK, V> > -
Adds all key/value pairs of
entries
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, bool setAsOriginal = false}) → void -
Updates the underlying
value
for this EmpireProperty.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 EmpirePropertyinherited -
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 nonexistent 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 the originalValue.
inherited
-
set(
Map< K, V> value, {bool notifyChange = true, bool setAsOriginal = false}) → 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
-
setViewModel(
EmpireViewModel viewModel) → void -
Links this EmpireProperty instance with an EmpireViewModel.
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?