Flutter curves: every Curves constant, animated, with a Cubic editor
All 43 Flutter Curves constants plotted and animated with their real control points, a compare mode, and a cubic-bezier editor that writes Cubic() and CSS.
Flutter's Curves class has 43 ready-made easing curves, from Curves.linear and Curves.easeInOut to Curves.bounceOut and Curves.elasticIn. Pass one as the curve: of an implicit animation such as AnimatedContainer, or wrap a controller in CurvedAnimation. Below, every one of them is plotted and animated with the exact control points and formulas from Flutter's curves.dart, next to an editor for your own Cubic.
How to use a curve in Flutter
A curve maps the animation's progress, from 0.0 to 1.0, to the value the widget actually shows. It never changes how long the animation runs, only how the movement is spread over that time. There are four common places to plug one in:
// 1. Implicit animations take a curve directly.
AnimatedContainer(
duration: const Duration(milliseconds: 300),
curve: Curves.easeInOut,
width: expanded ? 200 : 100,
)
// 2. With a controller, wrap it in a CurvedAnimation.
final animation = CurvedAnimation(
parent: controller,
curve: Curves.fastOutSlowIn,
reverseCurve: Curves.easeIn, // optional, used when running backwards
);
// 3. Or chain it into a Tween.
final offset = Tween(begin: Offset.zero, end: const Offset(0, 1))
.chain(CurveTween(curve: Curves.easeOutBack))
.animate(controller);
// 4. Run a curve over part of the timeline only.
const secondHalf = Interval(0.5, 1.0, curve: Curves.easeOut);Any curve can also be turned around with .flipped: Curves.easeIn.flipped behaves like an ease-out. CurvedAnimation uses curve forwards and, if you give one, reverseCurve when the controller runs backwards, which is how a sheet can slide in with a deceleration and out with an acceleration.
Which curve to pick
- Something moving on screen from A to B:
Curves.easeInOutorCurves.fastOutSlowIn, Material's long-standing standard curve, which starts faster and settles longer. - Something entering: an ease-out such as
Curves.easeOutorCurves.easeOutCubic, so it arrives quickly and comes to rest gently. - Something leaving: an ease-in such as
Curves.easeIn, so it gathers speed as it goes. - Playful feedback:
Curves.easeOutBackovershoots by about 9% and comes back;Curves.elasticOutandCurves.bounceOutare stronger and look best on small things, for short durations.
For Material 3 motion, the framework also has an Easing class in the material library, with tokens such as Easing.standard (Cubic(0.2, 0.0, 0.0, 1.0)) and Easing.emphasizedDecelerate, and matching durations in Durations, for example Durations.medium2 (300 ms). They are listed in the editor's presets.
Cubic and CSS cubic-bezier() are the same curve
Cubic(a, b, c, d) is a cubic Bézier from (0, 0) to (1, 1) with control points (a, b) and (c, d), exactly like CSS cubic-bezier(x1, y1, x2, y2), so the numbers copy straight across. Four of Flutter's curves are the CSS keywords: Curves.ease is ease, Curves.easeIn is ease-in, Curves.easeOut is ease-out and Curves.easeInOut is ease-in-out. The x values must stay within 0 to 1, because time can't go backwards; the y values can go outside it, which is how the Back curves overshoot. Flutter solves the curve for a given time by bisection, to within 0.001, and this page uses the same method.
The bounce, elastic, decelerate and the two ThreePointCubic curves aren't single Béziers, so CSS has no cubic-bezier() for them; the gallery's CSS button gives a linear() easing sampled from the real function instead. Their definitions, from curves.dart:
double _bounce(double t) {
if (t < 1.0 / 2.75) return 7.5625 * t * t;
if (t < 2 / 2.75) { t -= 1.5 / 2.75; return 7.5625 * t * t + 0.75; }
if (t < 2.5 / 2.75) { t -= 2.25 / 2.75; return 7.5625 * t * t + 0.9375; }
t -= 2.625 / 2.75; return 7.5625 * t * t + 0.984375;
}
// bounceOut(t) = _bounce(t) bounceIn(t) = 1 - _bounce(1 - t)
// elasticOut, period p = 0.4, s = p / 4:
// 2^(-10t) * sin((t - s) * 2π / p) + 1elasticIn and elasticInOut use the same exponent and sine, mirrored. All three take an optional period, as in ElasticOutCurve(0.3), where a shorter period wobbles more. If you're animating vector artwork rather than widgets, the SVG to Flutter converter turns an SVG into Path code and a line-drawing animation that these curves can drive.
Every Curves constant
| Curve | Flutter definition | CSS |
|---|---|---|
Curves.linear | t | linear |
Curves.ease | Cubic(0.25, 0.1, 0.25, 1.0) | cubic-bezier(0.25, 0.1, 0.25, 1) |
Curves.easeIn | Cubic(0.42, 0.0, 1.0, 1.0) | cubic-bezier(0.42, 0, 1, 1) |
Curves.easeOut | Cubic(0.0, 0.0, 0.58, 1.0) | cubic-bezier(0, 0, 0.58, 1) |
Curves.easeInOut | Cubic(0.42, 0.0, 0.58, 1.0) | cubic-bezier(0.42, 0, 0.58, 1) |
Curves.fastOutSlowIn | Cubic(0.4, 0.0, 0.2, 1.0) | cubic-bezier(0.4, 0, 0.2, 1) |
Curves.easeInOutCubicEmphasized | ThreePointCubic(Offset(0.05, 0), Offset(0.133333, 0.06), Offset(0.166666, 0.4), Offset(0.208333, 0.82), Offset(0.25, 1)) | linear() approximation |
Curves.decelerate | 1 − (1 − t)² | linear() approximation |
Curves.fastLinearToSlowEaseIn | Cubic(0.18, 1.0, 0.04, 1.0) | cubic-bezier(0.18, 1, 0.04, 1) |
Curves.fastEaseInToSlowEaseOut | ThreePointCubic(Offset(0.056, 0.024), Offset(0.108, 0.3085), Offset(0.198, 0.541), Offset(0.3655, 1), Offset(0.5465, 0.989)) | linear() approximation |
Curves.easeInToLinear | Cubic(0.67, 0.03, 0.65, 0.09) | cubic-bezier(0.67, 0.03, 0.65, 0.09) |
Curves.linearToEaseOut | Cubic(0.35, 0.91, 0.33, 0.97) | cubic-bezier(0.35, 0.91, 0.33, 0.97) |
Curves.slowMiddle | Cubic(0.15, 0.85, 0.85, 0.15) | cubic-bezier(0.15, 0.85, 0.85, 0.15) |
Curves.easeInSine | Cubic(0.47, 0.0, 0.745, 0.715) | cubic-bezier(0.47, 0, 0.745, 0.715) |
Curves.easeInQuad | Cubic(0.55, 0.085, 0.68, 0.53) | cubic-bezier(0.55, 0.085, 0.68, 0.53) |
Curves.easeInCubic | Cubic(0.55, 0.055, 0.675, 0.19) | cubic-bezier(0.55, 0.055, 0.675, 0.19) |
Curves.easeInQuart | Cubic(0.895, 0.03, 0.685, 0.22) | cubic-bezier(0.895, 0.03, 0.685, 0.22) |
Curves.easeInQuint | Cubic(0.755, 0.05, 0.855, 0.06) | cubic-bezier(0.755, 0.05, 0.855, 0.06) |
Curves.easeInExpo | Cubic(0.95, 0.05, 0.795, 0.035) | cubic-bezier(0.95, 0.05, 0.795, 0.035) |
Curves.easeInCirc | Cubic(0.6, 0.04, 0.98, 0.335) | cubic-bezier(0.6, 0.04, 0.98, 0.335) |
Curves.easeInBack | Cubic(0.6, -0.28, 0.735, 0.045) | cubic-bezier(0.6, -0.28, 0.735, 0.045) |
Curves.easeOutSine | Cubic(0.39, 0.575, 0.565, 1.0) | cubic-bezier(0.39, 0.575, 0.565, 1) |
Curves.easeOutQuad | Cubic(0.25, 0.46, 0.45, 0.94) | cubic-bezier(0.25, 0.46, 0.45, 0.94) |
Curves.easeOutCubic | Cubic(0.215, 0.61, 0.355, 1.0) | cubic-bezier(0.215, 0.61, 0.355, 1) |
Curves.easeOutQuart | Cubic(0.165, 0.84, 0.44, 1.0) | cubic-bezier(0.165, 0.84, 0.44, 1) |
Curves.easeOutQuint | Cubic(0.23, 1.0, 0.32, 1.0) | cubic-bezier(0.23, 1, 0.32, 1) |
Curves.easeOutExpo | Cubic(0.19, 1.0, 0.22, 1.0) | cubic-bezier(0.19, 1, 0.22, 1) |
Curves.easeOutCirc | Cubic(0.075, 0.82, 0.165, 1.0) | cubic-bezier(0.075, 0.82, 0.165, 1) |
Curves.easeOutBack | Cubic(0.175, 0.885, 0.32, 1.275) | cubic-bezier(0.175, 0.885, 0.32, 1.275) |
Curves.easeInOutSine | Cubic(0.445, 0.05, 0.55, 0.95) | cubic-bezier(0.445, 0.05, 0.55, 0.95) |
Curves.easeInOutQuad | Cubic(0.455, 0.03, 0.515, 0.955) | cubic-bezier(0.455, 0.03, 0.515, 0.955) |
Curves.easeInOutCubic | Cubic(0.645, 0.045, 0.355, 1.0) | cubic-bezier(0.645, 0.045, 0.355, 1) |
Curves.easeInOutQuart | Cubic(0.77, 0.0, 0.175, 1.0) | cubic-bezier(0.77, 0, 0.175, 1) |
Curves.easeInOutQuint | Cubic(0.86, 0.0, 0.07, 1.0) | cubic-bezier(0.86, 0, 0.07, 1) |
Curves.easeInOutExpo | Cubic(1.0, 0.0, 0.0, 1.0) | cubic-bezier(1, 0, 0, 1) |
Curves.easeInOutCirc | Cubic(0.785, 0.135, 0.15, 0.86) | cubic-bezier(0.785, 0.135, 0.15, 0.86) |
Curves.easeInOutBack | Cubic(0.68, -0.55, 0.265, 1.55) | cubic-bezier(0.68, -0.55, 0.265, 1.55) |
Curves.bounceIn | 1 − bounce(1 − t) | linear() approximation |
Curves.bounceOut | bounce(t) | linear() approximation |
Curves.bounceInOut | bounce halves, mirrored | linear() approximation |
Curves.elasticIn | ElasticInCurve(0.4) | linear() approximation |
Curves.elasticOut | ElasticOutCurve(0.4) | linear() approximation |
Curves.elasticInOut | ElasticInOutCurve(0.4) | linear() approximation |
Sources
- Curves class, Cubic, CurvedAnimation and Easing in the Flutter API docs
- curves.dart in the Flutter repository, for the control points and formulas
- CSS Easing Functions Level 1 (W3C), for
cubic-bezier()andlinear()
Questions
What are curves in Flutter?
A Curve maps an animation's progress from 0.0 to 1.0 to the value it shows, so movement can speed up, slow down or overshoot instead of running at a constant rate. The Curves class has 43 ready-made ones.
What is the difference between Curves.easeInOut and Curves.fastOutSlowIn?
Both start and end slowly. easeInOut is Cubic(0.42, 0.0, 0.58, 1.0), symmetric like CSS ease-in-out; fastOutSlowIn is Cubic(0.4, 0.0, 0.2, 1.0), which speeds up sooner and spends longer settling at the end.
How do I make a custom curve in Flutter?
For a Bézier, use Cubic(x1, y1, x2, y2) with the same four numbers as a CSS cubic-bezier(). For anything else, extend Curve and override transformInternal(double t), returning 0.0 at t = 0 and 1.0 at t = 1.
How do I convert a CSS cubic-bezier to Flutter?
Copy the four numbers into Cubic in the same order: cubic-bezier(0.25, 0.1, 0.25, 1) becomes const Cubic(0.25, 0.1, 0.25, 1.0), which is also Curves.ease. Paste it into the editor above to check it.
How do I use a different curve when the animation reverses?
Give CurvedAnimation a reverseCurve: CurvedAnimation(parent: controller, curve: Curves.easeOut, reverseCurve: Curves.easeIn). Or use curve.flipped to get the mirror image of a curve.
Why does Curves.elasticOut go above 1?
Elastic and Back curves overshoot on purpose: elasticOut peaks at about 1.27 before settling at 1.0. Clamp the value, or pick an ease-out curve, if the property can't go past its target, such as an opacity.