ValueState<T> class
A ValueNotifier that provides shorthand methods for reading and updating its value.
- Inheritance
-
- Object
- ChangeNotifier
- ValueNotifier<
T> - ValueState
- Available extensions
Constructors
- ValueState(T value)
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
- value ↔ T
-
The current value stored in this notifier.
getter/setter pairinherited
Methods
-
add(
T element) → void -
Available on ValueNotifier<
AppendsList< , provided by the ValueNotifierListExtension extensionT> >elementto the list and notifies listeners. -
addAll(
Iterable< T> elements) → void -
Available on ValueNotifier<
Appends allList< , provided by the ValueNotifierListExtension extensionT> >elementsand notifies listeners. -
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
call(
) → T - Returns the current value.
-
clear(
) → void -
Available on ValueNotifier<
Removes all elements and notifies listeners.List< , provided by the ValueNotifierListExtension extensionT> > -
dispose(
) → void -
Discards any resources used by the object.
inherited
-
getter(
) → T -
Available on ValueNotifier<
Returns the current value.T> , provided by the ValueNotifierExtension extension -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyChanged(
) → void - Notifies listeners that the state has changed.
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
remove(
T element) → void -
Available on ValueNotifier<
Removes the first occurrence ofList< , provided by the ValueNotifierListExtension extensionT> >elementand notifies listeners. -
removeAt(
int index) → void -
Available on ValueNotifier<
Removes the element atList< , provided by the ValueNotifierListExtension extensionT> >indexand notifies listeners. Throws a RangeError ifindexis out of range. -
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
run(
AsyncCallback callback) → Future< void> -
Available on ValueNotifier<
Sets the value to true while the callback runs and resets it to false afterward.bool> , provided by the ValueNotifierBoolExtension extension -
set(
T newValue) → void - Updates the current value.
-
setter(
T newValue) → void -
Available on ValueNotifier<
Updates the notifier with the given value.T> , provided by the ValueNotifierExtension extension -
toggle(
) → void -
Available on ValueNotifier<
Reverses the current boolean value.bool> , provided by the ValueNotifierBoolExtension extension -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited