ChangeNotifierAdapter class
Drives an Animate animation from a ChangeNotifier. The valueGetter
should provide a value in the range 0-1
when a change occurs.
See Adapter for information on direction and animated.
This example creates a ChangeNotifierAdapter
that fades in the myIcon
widget based on the progress of the myProgressNotifier
ChangeNotifier.
The valueGetter
is called whenever myProgressNotifier
changes, and
returns a position value between 0-1
, calculated from the loaded
and
total
properties of myProgressNotifier
.
myIcon.animate(
adapter: ChangeNotifierAdapter(
myProgressNotifier,
() => myProgressNotifier.loaded / myProgressNotifier.total,
)
).fadeIn();
Constructors
-
ChangeNotifierAdapter(ChangeNotifier notifier, ValueGetter<
double> valueGetter, {bool? animated, Direction? direction})
Properties
- animated → bool
-
finalinherited
- direction → Direction?
-
finalinherited
- hashCode → int
-
The hash code for this object.
no setterinherited
- notifier → ChangeNotifier
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
valueGetter
→ ValueGetter<
double> -
final
Methods
-
attach(
AnimationController controller) → void -
override
-
config(
AnimationController controller, double value, {ChangeNotifier? notifier, VoidCallback? listener}) → void -
inherited
-
detach(
) → void -
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
updateValue(
double value) → void -
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited