ProviderModelVariable<T> class
A variable that can be used in batches and automatically detect changes as to notify listeners when it's value changes. The variable can be 'set' or 'unset' depending on whether it's value has been set or not. If it's value has not been set and it is accessed, an assertion will be thrown.
- Mixed-in types
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- set → bool
-
Whether this variable has been set or not.
no setter
- type → Type
-
The type of this variable. Runtime access to
T.no setter - unsafeValue → T
-
The value of this variable. If set is false, an assertion will be thrown.
Usually you should use getValue instead of this.
no setter
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
inherited
-
getValue(
) → Future< T> - Get the current value of this variable. This will wait until all currently queued batches have completed before returning the value.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
toString(
) → String -
A string representation of this object.
override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited