ValueState<T> class
A ValueNotifier that supports explicit change notifications.
- Inheritance
-
- Object
- ChangeNotifier
- ValueNotifier<
T> - ValueState
- Available extensions
Constructors
- ValueState(T initialValue)
Properties
- first → T
-
Available on ValueNotifier<
Returns the first element of the list.List< , provided by the ValueNotifierListExtension extensionT> >no setter - firstOrNull → T?
-
Available on ValueNotifier<
Returns the first element of the list or null if the list is empty.List< , provided by the ValueNotifierListExtension extensionT> >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<
Returns true if the current value is null.T> , provided by the ValueNotifierExtension extensionno setter - hasValue → bool
-
Available on ValueNotifier<
Returns true if the current value is not null.T> , provided by the ValueNotifierExtension extensionno setter - initialValue → T
-
The initial value of the state, stored without copying.
final
- isEmpty → bool
-
Available on ValueNotifier<
Returns true if the list is empty.List< , provided by the ValueNotifierListExtension extensionT> >no setter - isEmpty → bool
-
Available on ValueNotifier<
Returns true if the current value is empty.String> , provided by the ValueNotifierStringExtension extensionno setter - isNotEmpty → bool
-
Available on ValueNotifier<
Returns true if the list is not empty.List< , provided by the ValueNotifierListExtension extensionT> >no setter - isNotEmpty → bool
-
Available on ValueNotifier<
Returns true if the current value is not empty.String> , provided by the ValueNotifierStringExtension extensionno setter - last → T
-
Available on ValueNotifier<
Returns the last element of the list.List< , provided by the ValueNotifierListExtension extensionT> >no setter - lastOrNull → T?
-
Available on ValueNotifier<
Returns the last element of the list or null if the list is empty.List< , provided by the ValueNotifierListExtension extensionT> >no setter - length → int
-
Available on ValueNotifier<
Returns the number of elements in the list.List< , provided by the ValueNotifierListExtension extensionT> >no setter - length → int
-
Available on ValueNotifier<
Returns the number of UTF-16 code units in the string.String> , provided by the ValueNotifierStringExtension extensionno setter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- single → T
-
Available on ValueNotifier<
Returns the single element of the list.List< , provided by the ValueNotifierListExtension extensionT> >no setter - singleOrNull → T?
-
Available on ValueNotifier<
Returns the single element of the list or null if the list is empty.List< , provided by the ValueNotifierListExtension extensionT> >no setter - trimmed → String
-
Available on ValueNotifier<
Returns the current value without leading and trailing whitespace.String> , provided by the ValueNotifierStringExtension extensionno setter - 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
-
clear(
) → void -
Available on ValueNotifier<
Removes all elements and notifies listeners.List< , provided by the ValueNotifierListExtension extensionT> > -
clear(
) → void -
Available on ValueNotifier<
Clears the current value by setting it to an empty string.String> , provided by the ValueNotifierStringExtension extension -
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
-
reset(
) → void - Resets the state to its initial value.
-
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 -
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
-
operator [](
int index) → T -
Available on ValueNotifier<
Returns the element at the given index.List< , provided by the ValueNotifierListExtension extensionT> > -
operator []=(
int index, T element) → void -
Available on ValueNotifier<
Replaces the element at the given index and notifies listeners.List< , provided by the ValueNotifierListExtension extensionT> >