FromToTask class

Performs an animation from from to to in duration time. If the from is not set the animation will start from the current position.

The duration is computed for a an interval from 0.0 to 1.0. (Example: animating from 0.5 to 1.0 with duration of 1000ms takes 500ms) This behavior can be changed by setting durationBasedOnZeroToOneInterval to false.

You can apply an easing curve by setting curve.

  • @Deprecated('See migration guide:')


FromToTask({@required Duration duration, @required double to, bool durationBasedOnZeroToOneInterval = true, double from, Curve curve = Curves.linear, AnimationTaskCallback onStart, AnimationTaskCallback onComplete})
Creates a new task that animate from a certain value to a another value.


curve Curve
The easing behavior of the animation. Default: Curves.linear
read / write
duration Duration
Animation duration from 0.0 to 1.0 (if durationBasedOnZeroToOneInterval is true). Else the duration of this animation task (if durationBasedOnZeroToOneInterval is false).
read / write
durationBasedOnZeroToOneInterval bool
Sets the duration behavior. See duration.
read / write
from double
Double value between 0.0 and 1.0 that indicates the start position of the animation. If it's not set the task will refer to the current position of the animation.
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
onComplete AnimationTaskCallback
Callback fired when task completes
read / write, inherited
onStart AnimationTaskCallback
Callback fired when task starts
read / write, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
startedTime Duration
Time when task started
read / write, inherited
startedValue double
Value of AnimationControllerX when task started
read / write, inherited
to double
Double value between 0.0 and 1.0 that indicates the end position of the animation.
read / write


completeTask() → dynamic
Called by computeValue when task completes.
computeValue(Duration time) double
Returns the new value of the animation
dispose() → void
Called when task disposes
isCompleted() bool
Returns whether the task is completed
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
started(Duration time, double value) → dynamic
Called when task starts
toString() String
A string representation of this object. [...]


operator ==(Object other) bool
The equality operator. [...]