BetterMapNotifications<K, V> extension

Extension to provide additional methods for VN<Map<K, V>>.

The BetterMapNotifications extension enhances the functionality of VN<Map<K, V>> by adding convenience methods for common map operations, while respecting the ChangeType configuration of the parent VN instance.

Features:

  • Key-based element access and modification.
  • Map inspection properties (isEmpty, isNotEmpty, length, etc.).
  • Methods for adding, removing, and clearing key-value pairs.
  • Functional utilities for map transformations.
on

Properties

isEmpty bool

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

Returns true if the map has no key-value pairs.
no setter
isNotEmpty bool

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

Returns true if the map has one or more key-value pairs.
no setter
keys Iterable<K>

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

Returns an iterable of all keys in the map.
no setter
length int

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

Returns the number of key-value pairs in the map.
no setter
values Iterable<V>

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

Returns an iterable of all values in the map.
no setter

Methods

clear() → void

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

Removes all key-value pairs from the map.
hardClear() → void

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

Removes all key-value pairs from the map and notifies listeners.
hardRemove(K key) → V?

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

Removes the key-value pair with the given key from the map and notifies listeners.
hardRemoveWhere(bool where(K key, V value)) → void

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

Removes all key-value pairs from the map that satisfy the predicate where and notifies listeners.
map<K2, V2>(MapEntry<K2, V2> converter(K k, V v)) Map<K2, V2>

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

Transforms the map by applying a function to all its key-value pairs.
remove(K key) → V?

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

Removes the key-value pair with the given key from the map.
removeWhere(bool where(K key, V value)) → void

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

Removes all key-value pairs from the map that satisfy the given predicate where.
silentClear() → void

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

Removes all key-value pairs from the map without notifying listeners.
silentRemove(K key) → V?

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

Removes the key-value pair with the given key from the map without notifying listeners.
silentRemoveWhere(bool where(K key, V value)) → void

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

Removes all key-value pairs from the map that satisfy the predicate where without notifying listeners.
smartClear() → void

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

Removes all key-value pairs from the map, with behavior determined by ChangeType.
smartRemove(K key) → V?

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

Removes the key-value pair with the given key from the map, with behavior determined by ChangeType.
smartRemoveWhere(bool where(K key, V value)) → void

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

Removes all key-value pairs from the map that satisfy the predicate where, with behavior determined by ChangeType.

Operators

operator [](K key) → V?

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

Retrieves the value associated with the given key in the map.
operator []=(K key, V value) → void

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

Associates the given key with the given value in the map.