flutter_value_notifier
library
Classes
-
DependencyProvider<T>
-
Takes a
Create
function that is responsible for creating the dependency
and a child
which will have access to the dependency via
DependencyProvider.of(context)
.
It is used as a dependency injection (DI) widget so that a single instance
of a dependency can be provided to multiple widgets within a subtree.
-
MultiDependencyProvider
-
Merges multiple DependencyProvider widgets into one widget tree.
-
MultiValueNotifierListener
-
Merges multiple ValueNotifierListener widgets into one widget tree.
-
MultiValueNotifierProvider
-
Merges multiple ValueNotifierProvider widgets into one widget tree.
-
ValueNotifierBuilder<VN extends ValueNotifier<V>, V>
-
ValueNotifierBuilder handles building a widget in response to new
values
.
ValueNotifierBuilder is analogous to ValueListenableBuilder but has
simplified API to reduce the amount of boilerplate code needed as well as
notifier-specific performance improvements.
Please refer to ValueNotifierListener if you want to "do" anything in
response to value
changes such as navigation, showing a dialog, etc...
-
ValueNotifierBuilderBase<VN extends ValueNotifier<V>, V>
-
Base class for widgets that build themselves based on interaction with
a specified notifier.
-
ValueNotifierConsumer<VN extends ValueNotifier<V>, V>
-
ValueNotifierConsumer exposes a builder and listener in order react
to new values.
ValueNotifierConsumer is analogous to a nested ValueNotifierListener
and ValueNotifierBuilder but reduces the amount of boilerplate needed.
ValueNotifierConsumer should only be used when it is necessary to both
rebuild UI and execute other reactions to value changes in the
notifier.
-
ValueNotifierListener<VN extends ValueNotifier<V>, V>
-
Takes a ValueNotifierWidgetListener and an optional notifier and
invokes the listener in response to
value
changes in the
notifier.
It should be used for functionality that needs to occur only in response to
a value
change such as navigation, showing a SnackBar
, showing
a Dialog
, etc...
The listener is guaranteed to only be called once for each value
change
unlike the builder
in ValueNotifierBuilder
.
-
ValueNotifierListenerBase<VN extends ValueNotifier<V>, V>
-
Base class for widgets that listen to value changes in a specified
notifier.
-
ValueNotifierProvider<T extends ValueNotifier<Object?>>
-
Takes a
Create
function that is responsible for
creating the ValueNotifier and a child which will have access
to the instance via ValueNotifierProvider.of(context)
.
It is used as a dependency injection (DI) widget so that a single instance
of a ValueNotifier can be provided to multiple widgets within a subtree.
-
ValueNotifierSelector<VN extends ValueNotifier<V>, V, T>
-
ValueNotifierSelector is analogous to ValueNotifierBuilder but allows
developers to filter updates by selecting a new value based on the notifier
value. Unnecessary builds are prevented if the selected value does not
change.