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
- Object
- Listenable
- Animation<double>
- CurvedAnimation
- Mixes-in
- AnimationWithParentMixin<double>
Constructors
- CurvedAnimation({Animation<double> parent, 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.
read-only - reverseCurve → Curve
-
The curve to use in the reverse direction.
read / write - value → double
-
read-only
- hashCode → int
-
Get a 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
Operators
-
operator ==(
other) → bool -
The equality operator.
inherited
Methods
-
toString(
) → String -
Returns a string representation of this object.
-
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