CurvedAnimation class

An animation that applies a curve to another animation.

CurvedAnimation is useful when you want to apply a non-linear Curve to an animation object wrapped in the CurvedAnimation.

For example, the following code snippet shows how you can apply a curve to a linear animation produced by an AnimationController:

    final AnimationController controller =
        new AnimationController(duration: const Duration(milliseconds: 500));
    final CurvedAnimation animation =
        new CurvedAnimation(parent: controller, curve: Curves.ease);

Depending on the given curve, the output of the CurvedAnimation could have a wider range than its input. For example, elastic curves such as Curves.elasticIn will significantly overshoot or undershoot the default range of 0.0 to 1.0.

If you want to apply a Curve to a Tween, consider using CurveTween.

Inheritance
Mixes-in

Constructors

CurvedAnimation({@required Animation<double> parent, @required Curve curve, Curve reverseCurve })
Creates a curved animation. [...]

Properties

curve Curve
The curve to use in the forward direction.
read / write
parent Animation<double>
The animation to which this animation applies a curve.
final
reverseCurve Curve
The curve to use in the reverse direction. [...]
read / write
value double
The current value of the animation.
read-only
hashCode int
The hash code for this object. [...]
read-only, inherited
isCompleted bool
Whether this animation is stopped at the end.
read-only, inherited
isDismissed bool
Whether this animation is stopped at the beginning.
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
status AnimationStatus
The current status of this animation.
read-only, inherited

Methods

toString() String
addListener(VoidCallback listener) → void
Calls the listener every time the value of the animation changes. [...]
inherited
addStatusListener(AnimationStatusListener listener) → void
Calls listener every time the status of the animation changes. [...]
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
removeListener(VoidCallback listener) → void
Stop calling the listener every time the value of the animation changes. [...]
inherited
removeStatusListener(AnimationStatusListener listener) → void
Stops calling the listener every time the status of the animation changes. [...]
inherited
toStringDetails() String
Provides a string describing the status of this object, but not including information about the object itself. [...]
inherited

Operators

operator ==(dynamic other) bool
The equality operator. [...]
inherited