ValueState<T> class

A ValueNotifier that provides shorthand methods for reading and updating its value.

Inheritance
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<List<T>>, provided by the ValueNotifierListExtension extension

Appends element to the list and notifies listeners.
addAll(Iterable<T> elements) → void

Available on ValueNotifier<List<T>>, provided by the ValueNotifierListExtension extension

Appends all elements and 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<List<T>>, provided by the ValueNotifierListExtension extension

Removes all elements and notifies listeners.
dispose() → void
Discards any resources used by the object.
inherited
getter() → T

Available on ValueNotifier<T>, provided by the ValueNotifierExtension extension

Returns the current value.
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<List<T>>, provided by the ValueNotifierListExtension extension

Removes the first occurrence of element and notifies listeners.
removeAt(int index) → void

Available on ValueNotifier<List<T>>, provided by the ValueNotifierListExtension extension

Removes the element at index and notifies listeners. Throws a RangeError if index is 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<bool>, provided by the ValueNotifierBoolExtension extension

Sets the value to true while the callback runs and resets it to false afterward.
set(T newValue) → void
Updates the current value.
setter(T newValue) → void

Available on ValueNotifier<T>, provided by the ValueNotifierExtension extension

Updates the notifier with the given value.
toggle() → void

Available on ValueNotifier<bool>, provided by the ValueNotifierBoolExtension extension

Reverses the current boolean value.
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited