Animator<T> class
abstract
An object that drives animations.
A class can extend Animator to achieve behavior similar to AnimationController, but with some tweaks to the API surface.
This class creates an interface similar to Animation, but the status field is a ValueListenable to facilitate use in e.g. Ref.watch calls.
- Inheritance
-
- Object
- ChangeNotifier
- ValueNotifier<
T> - Animator
- Implemented types
- Implementers
Constructors
- Animator(T initialValue, {AnimationStatus initialStatus = .dismissed, Vsync vsync = .fallback, AnimationBehavior behavior = .normal, Duration? duration, Curve? curve, Duration? reverseDuration, Curve? reverseCurve, String? debugLabel})
- Initializes fields for subclasses.
Properties
- behavior → AnimationBehavior
-
The animator's behavior when AccessibilityFeatures.disableAnimations
is true.
final
- curve ↔ Curve
-
The Curve for this animation to use while interpolating.
getter/setter pair
- debugDisposed → bool
-
Whether dispose has been called.
no setter
- debugLabel → String?
-
A label that is used in the toString output. Intended to aid with
identifying animation controller instances in debug output.
final
- duration ↔ Duration
-
The length of time the animation should last.
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- hasListeners → bool
-
Whether any listeners are currently registered.
no setterinherited
- isActive → bool
-
Whether this animator is currently running.
no setter
- lastElapsedDuration → Duration?
-
The amount of time that has passed between the time the animation started
and the most recent tick of the animation.
no setter
- reverseCurve ↔ Curve
-
The Curve for this animation to use in the "reverse" direction, if/when applicable.
getter/setter pair
- reverseDuration ↔ Duration
-
The length of time the animation should last in the "reverse" direction, if/when applicable.
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
status
→ ValueListenable<
AnimationStatus> -
A ValueListenable object that sends notifications when there's a change
to this animator's AnimationStatus.
no setter
-
statusNotifier
→ ValueNotifier<
AnimationStatus> -
The ValueNotifier used to track the animator's status.
final
- style → AnimationStyle
-
The AnimationStyle associated with this object.
no setter
- tickerFuture → TickerFuture?
-
A Future that completes when the currently running animation is finished.
no setter
- value ↔ T
-
The Animator's current value.
getter/setter pairinherited-setteroverride-getter
- vsync → Vsync
-
The listenable's associated Vsync.
no setteroverride
Methods
-
addListener(
VoidCallback listener) → void -
Register a closure to be called when the object changes.
inherited
-
animateTo(
T target, {T? from, Duration? duration, Curve? curve}) → TickerFuture -
Drives an animation to the specified
target, either from the animator's current value or the providedfromparameter. -
debugCheckDisposal(
String methodName) → bool - In debug mode, verifies that this object has not yet been disposed of.
-
dispose(
) → void -
Discards any resources used by the object.
override
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
notifyListeners(
) → void -
Call all the registered listeners.
inherited
-
removeListener(
VoidCallback listener) → void -
Remove a previously registered closure from the list of closures that are
notified when the object changes.
inherited
-
reset(
) → void - Reverts the animator to its initial state.
-
resync(
Vsync vsync) → void -
Called to update the listenable's associated Vsync.
override
-
start(
) → TickerFuture - Starts the clock for the Ticker. If the ticker is not muted, then this also starts calling the ticker's callback once per animation frame.
-
stop(
{bool canceled = true}) → void - Stops calling the Ticker's callback.
-
tick(
Duration elapsed) → void - Override this method to specify what happens to this animator each frame the Ticker is running.
-
toAnimation(
) → ProxyAnimator< T> - Creates an object that uses this Animator to implement the Animation interface.
-
toString(
) → String -
A string representation of this object.
override
-
updateStyle(
AnimationStyle newStyle) → void -
Applies the
newStyleto the animation.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited