CurrentMapProperty<K, V> class

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

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

Inheritance

Constructors

CurrentMapProperty(Map<K, V> value, {String? propertyName})
CurrentMapProperty.empty({String? propertyName})
Factory constructor for initializing an CurrentMapProperty 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
isDirty bool
Returns true if the value of this CurrentProperty is different from the originalValue.
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 CurrentProperty is not null.
no setterinherited
isNull bool
Returns true if the value of this CurrentProperty is null.
no setterinherited
isPrimitiveType bool
finalinherited
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
registeredBindings Iterable<CurrentViewModelBinding>
Helper bindings registered directly against this property.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
sourceHashCode int
finalinherited
value Map<K, V>
Returns the current value of this CurrentProperty. Setting the value will update the value of this CurrentProperty and trigger a UI update if the new value is different from the current value. If T is a reference type, setting the value to a new instance of T with the same properties as the current value will still trigger a UI update since the reference has changed.
getter/setter pairinherited
values Iterable<V>
The values of the map.
no setter
viewModel CurrentStateViewModel
Returns the instance of the CurrentStateViewModel 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, bool capturePrevious = false}) → void
Adds all key/value pairs of other to this map.
addEntries(Iterable<MapEntry<K, V>> entries, {bool notifyChanges = true, bool capturePrevious = false}) → void
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 CurrentProperty.
inherited
clear({bool notifyChanges = true, bool capturePrevious = false}) → 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 CurrentProperty.
inherited
forEach(void action(dynamic, dynamic)) → void
Applies action to each key/value pair of the map.
hasValueChanged(Map<K, V> currentValue, Map<K, V> originalValue) bool
Determines whether the current value differs from the original value.
override
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.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
registerBinding(CurrentViewModelBinding binding) → void
Registers a helper binding against this property.
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.
override
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(CurrentStateViewModel viewModel) → void
Links this CurrentProperty instance with an CurrentStateViewModel.
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 ==(Object other) bool
The equality operator.
inherited
operator [](K key) → V?