ValueState<T> class

A ValueNotifier that supports explicit change notifications.

Inheritance
Available extensions

Constructors

ValueState(T initialValue)

Properties

first → T

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

Returns the first element of the list.
no setter
firstOrNull → T?

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

Returns the first element of the list or null if the list is empty.
no setter
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
hasNoValue → bool

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

Returns true if the current value is null.
no setter
hasValue → bool

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

Returns true if the current value is not null.
no setter
initialValue → T
The initial value of the state, stored without copying.
final
isEmpty → bool

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

Returns true if the list is empty.
no setter
isEmpty → bool

Available on ValueNotifier<String>, provided by the ValueNotifierStringExtension extension

Returns true if the current value is empty.
no setter
isNotEmpty → bool

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

Returns true if the list is not empty.
no setter
isNotEmpty → bool

Available on ValueNotifier<String>, provided by the ValueNotifierStringExtension extension

Returns true if the current value is not empty.
no setter
last → T

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

Returns the last element of the list.
no setter
lastOrNull → T?

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

Returns the last element of the list or null if the list is empty.
no setter
length → int

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

Returns the number of elements in the list.
no setter
length → int

Available on ValueNotifier<String>, provided by the ValueNotifierStringExtension extension

Returns the number of UTF-16 code units in the string.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
single → T

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

Returns the single element of the list.
no setter
singleOrNull → T?

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

Returns the single element of the list or null if the list is empty.
no setter
trimmed → String

Available on ValueNotifier<String>, provided by the ValueNotifierStringExtension extension

Returns the current value without leading and trailing whitespace.
no setter
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
clear() → void

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

Removes all elements and notifies listeners.
clear() → void

Available on ValueNotifier<String>, provided by the ValueNotifierStringExtension extension

Clears the current value by setting it to an empty string.
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
reset() → void
Resets the state to its initial value.
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.
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
operator [](int index) → T

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

Returns the element at the given index.
operator []=(int index, T element) → void

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

Replaces the element at the given index and notifies listeners.