treamz

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.

Checked Runs in your browser: nothing you enter is sent anywhere.

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.

43 curves

Each plot shows the value (up) against time (right); the dashed lines are 0 and 1, so anything outside them overshoots. The box under it moves by the same value. “CSS” copies the CSS equivalent: cubic-bezier() for a Cubic, a sampled linear() easing for the rest.

Compare

Tick “Compare” on up to five curves to race them on the same clock.

    Cubic bezier editor

    Drag the two round handles, or focus one and use the arrow keys (Shift for steps of 0.1).

    Dart

    CSS

    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.easeInOut or Curves.fastOutSlowIn, Material's long-standing standard curve, which starts faster and settles longer.
    • Something entering: an ease-out such as Curves.easeOut or Curves.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.easeOutBack overshoots by about 9% and comes back; Curves.elasticOut and Curves.bounceOut are 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) + 1

    elasticIn 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

    CurveFlutter definitionCSS
    Curves.lineartlinear
    Curves.easeCubic(0.25, 0.1, 0.25, 1.0)cubic-bezier(0.25, 0.1, 0.25, 1)
    Curves.easeInCubic(0.42, 0.0, 1.0, 1.0)cubic-bezier(0.42, 0, 1, 1)
    Curves.easeOutCubic(0.0, 0.0, 0.58, 1.0)cubic-bezier(0, 0, 0.58, 1)
    Curves.easeInOutCubic(0.42, 0.0, 0.58, 1.0)cubic-bezier(0.42, 0, 0.58, 1)
    Curves.fastOutSlowInCubic(0.4, 0.0, 0.2, 1.0)cubic-bezier(0.4, 0, 0.2, 1)
    Curves.easeInOutCubicEmphasizedThreePointCubic(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.decelerate1 − (1 − t)²linear() approximation
    Curves.fastLinearToSlowEaseInCubic(0.18, 1.0, 0.04, 1.0)cubic-bezier(0.18, 1, 0.04, 1)
    Curves.fastEaseInToSlowEaseOutThreePointCubic(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.easeInToLinearCubic(0.67, 0.03, 0.65, 0.09)cubic-bezier(0.67, 0.03, 0.65, 0.09)
    Curves.linearToEaseOutCubic(0.35, 0.91, 0.33, 0.97)cubic-bezier(0.35, 0.91, 0.33, 0.97)
    Curves.slowMiddleCubic(0.15, 0.85, 0.85, 0.15)cubic-bezier(0.15, 0.85, 0.85, 0.15)
    Curves.easeInSineCubic(0.47, 0.0, 0.745, 0.715)cubic-bezier(0.47, 0, 0.745, 0.715)
    Curves.easeInQuadCubic(0.55, 0.085, 0.68, 0.53)cubic-bezier(0.55, 0.085, 0.68, 0.53)
    Curves.easeInCubicCubic(0.55, 0.055, 0.675, 0.19)cubic-bezier(0.55, 0.055, 0.675, 0.19)
    Curves.easeInQuartCubic(0.895, 0.03, 0.685, 0.22)cubic-bezier(0.895, 0.03, 0.685, 0.22)
    Curves.easeInQuintCubic(0.755, 0.05, 0.855, 0.06)cubic-bezier(0.755, 0.05, 0.855, 0.06)
    Curves.easeInExpoCubic(0.95, 0.05, 0.795, 0.035)cubic-bezier(0.95, 0.05, 0.795, 0.035)
    Curves.easeInCircCubic(0.6, 0.04, 0.98, 0.335)cubic-bezier(0.6, 0.04, 0.98, 0.335)
    Curves.easeInBackCubic(0.6, -0.28, 0.735, 0.045)cubic-bezier(0.6, -0.28, 0.735, 0.045)
    Curves.easeOutSineCubic(0.39, 0.575, 0.565, 1.0)cubic-bezier(0.39, 0.575, 0.565, 1)
    Curves.easeOutQuadCubic(0.25, 0.46, 0.45, 0.94)cubic-bezier(0.25, 0.46, 0.45, 0.94)
    Curves.easeOutCubicCubic(0.215, 0.61, 0.355, 1.0)cubic-bezier(0.215, 0.61, 0.355, 1)
    Curves.easeOutQuartCubic(0.165, 0.84, 0.44, 1.0)cubic-bezier(0.165, 0.84, 0.44, 1)
    Curves.easeOutQuintCubic(0.23, 1.0, 0.32, 1.0)cubic-bezier(0.23, 1, 0.32, 1)
    Curves.easeOutExpoCubic(0.19, 1.0, 0.22, 1.0)cubic-bezier(0.19, 1, 0.22, 1)
    Curves.easeOutCircCubic(0.075, 0.82, 0.165, 1.0)cubic-bezier(0.075, 0.82, 0.165, 1)
    Curves.easeOutBackCubic(0.175, 0.885, 0.32, 1.275)cubic-bezier(0.175, 0.885, 0.32, 1.275)
    Curves.easeInOutSineCubic(0.445, 0.05, 0.55, 0.95)cubic-bezier(0.445, 0.05, 0.55, 0.95)
    Curves.easeInOutQuadCubic(0.455, 0.03, 0.515, 0.955)cubic-bezier(0.455, 0.03, 0.515, 0.955)
    Curves.easeInOutCubicCubic(0.645, 0.045, 0.355, 1.0)cubic-bezier(0.645, 0.045, 0.355, 1)
    Curves.easeInOutQuartCubic(0.77, 0.0, 0.175, 1.0)cubic-bezier(0.77, 0, 0.175, 1)
    Curves.easeInOutQuintCubic(0.86, 0.0, 0.07, 1.0)cubic-bezier(0.86, 0, 0.07, 1)
    Curves.easeInOutExpoCubic(1.0, 0.0, 0.0, 1.0)cubic-bezier(1, 0, 0, 1)
    Curves.easeInOutCircCubic(0.785, 0.135, 0.15, 0.86)cubic-bezier(0.785, 0.135, 0.15, 0.86)
    Curves.easeInOutBackCubic(0.68, -0.55, 0.265, 1.55)cubic-bezier(0.68, -0.55, 0.265, 1.55)
    Curves.bounceIn1 − bounce(1 − t)linear() approximation
    Curves.bounceOutbounce(t)linear() approximation
    Curves.bounceInOutbounce halves, mirroredlinear() approximation
    Curves.elasticInElasticInCurve(0.4)linear() approximation
    Curves.elasticOutElasticOutCurve(0.4)linear() approximation
    Curves.elasticInOutElasticInOutCurve(0.4)linear() approximation

    Sources

    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.