KeyValueNotifer<K, V> class
A ChangeNotifier that keeps track of it's listeners by
assigning each listener a key of type K
.
This is not a subtype of ChangeNotifier, because the ChangeNotifier.addListener and ChangeNotifier.removeListener methods require a different signature in a KeyValueNotifer.
- Implemented types
-
- KeyValueListenable<
K, V>
- KeyValueListenable<
- Mixed in types
Constructors
- KeyValueNotifer(V value)
-
Initialize this KeyValueNotifer with an AdvancedValueNotifier
that is initialized with
value
.factory - KeyValueNotifer.empty()
-
Initialize this KeyValueNotifer with an EmptyValueNotifier.empty().
factory
-
KeyValueNotifer.withNotifier(ValueNotifierBase<
V> notifier) -
Initialize this KeyValueNotifer with
notifier
as it's internal ValueNotifierBase.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
no setteroverride
- isEmpty → bool?
-
If the internal NotifierBase is an EmptyValueNotifier, you can check
if it is empty.
no setteroverride
- isNotEmpty → bool?
-
If the internal NotifierBase is an EmptyValueNotifier, you can check
if it is not empty.
no setteroverride
-
keys
→ Iterable<
K> -
no setteroverride
- notifierType → Type
-
Get the Type of the underlying NotifierBase.
no setteroverride
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- value ↔ V
-
The current value stored in this notifier.
getter/setter pairoverride-getter
Methods
-
addListener(
K key, VoidCallback listener) → bool -
Returns
true
ifkey
was not already used for another listener.override -
addValueListener(
K key, ValueCallback< V> listener) → bool -
Returns
true
ifkey
was not already used for another listener.override -
dispose(
) → void -
This method calls
dispose()
on the notifier this KeyValueNotifer was instantiated with.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
removeListener(
K key) → bool -
Returns
true
ifkey
was used for a listener and therefore successfully removed.override -
removeValueListener(
K key) → bool -
Returns
true
ifkey
was used for a listener and therefore successfully removed.override -
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited