Skip to content

Hero should allow specifying a curve and reverseCurve #26150

Open

Description

@marcoms

Currently in heroes.dart:

  Animation<double> get animation {
    return CurvedAnimation(
      parent: (type == HeroFlightDirection.push) ? toRoute.animation : fromRoute.animation,
      curve: Curves.fastOutSlowIn,
    );
  }

Curves.fastOutSlowIn looks decent for an entry curve, however when the hero animation is played in reverse when going to the previous route, you get something like the following:

ezgif-4-8105ac49419e

This could be solved by checking HeroFlightDirection.push/pull and flipping the curve if necessary, but IMO it would make more sense to allow the user to specify curve and reverseCurve like most of the other animation APIs we have. curve would naturally be flipped when going backwards if reverseCurve isn't specified.

When I was working on improving the animations of CupertinoPageRoute, the Hero animation of the title becoming the back button was the one thing I couldn't alter, since there isn't an API to specify a reverse curve. Example (watch the Colors title):

ezgif-4-1260e8ec0452

Activity

  1. added
    c: new featureNothing broken; request for a new capability
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    on Jan 7, 2019
  2. added this to the milestone on Jan 7, 2019
  3. sir-boformer commented on Feb 8, 2019

    @sir-boformer
    Contributor

    I'm supporting this!

  4. added
    P2Important issues not at the top of the work list
    on May 29, 2020
  5. kazbeksultanov commented on Jun 15, 2020

    @kazbeksultanov
    Contributor

    Me too!

  6. dungnv2602 commented on Jun 18, 2020

    @dungnv2602

    This should have been supported at the very beginning. Anyone can do a PR on this, It just takes up about 5 minutes to be exposed as a param I think?

  7. removed this from the milestone on Aug 17, 2020
  8. nt4f04uNd commented on Mar 2, 2021

    @nt4f04uNd
    Member

    looks like this was partially fixed by #39844

    it would be still useful to be able to change the curves i think

  9. ercantomac commented on Nov 14, 2024

    @ercantomac

    This issue is almost 6 years old... Any updates?

  10. victorsanni commented on Jun 27, 2025

    @victorsanni
    Contributor

    Partial patch at #159393

  11. added
    packageflutter/packages repository. See also p: labels.
    and removed
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work listc: new featureNothing broken; request for a new capabilityhas partial patchThere is a PR awaiting someone to take it across the finish linep: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions