CurveTween class
Transforms the value of the given animation by the given curve.
This class differs from CurvedAnimation in that CurvedAnimation applies a curve to an existing Animation object whereas CurveTween can be chained with another Tween prior to receiving the underlying Animation. (CurvedAnimation also has the additional ability of having different curves when the animation is going forward vs when it is going backward, which can be useful in some scenarios.)
The following code snippet shows how you can apply a curve to a linear
animation produced by an AnimationController
link
controller
:
final Animation<double> animation = _controller.drive(
CurveTween(curve: Curves.ease),
);
See also:
- CurvedAnimation, for an alternative way of expressing the sample above.
- AnimationController, for examples of creating and disposing of an AnimationController.
- Inheritance
-
- Object
- Animatable<
double> - CurveTween
Constructors
- CurveTween({required Curve curve})
- Creates a curve tween.
Properties
Methods
-
animate(
Animation< double> parent) → Animation<double> -
Returns a new Animation that is driven by the given animation but that
takes on values determined by this object.
inherited
-
chain(
Animatable< double> parent) → Animatable<double> -
Returns a new Animatable whose value is determined by first evaluating
the given parent and then evaluating this object.
inherited
-
evaluate(
Animation< double> animation) → double -
The current value of this object for the given Animation.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
override
-
transform(
double t) → double -
Returns the value of the object at point
t
.override
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited