Repository navigation
Description
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:
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):


Activity
sir-boformer commentedon Feb 8, 2019
I'm supporting this!
kazbeksultanov commentedon Jun 15, 2020
Me too!
dungnv2602 commentedon Jun 18, 2020
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?
nt4f04uNd commentedon Mar 2, 2021
looks like this was partially fixed by #39844
it would be still useful to be able to change the curves i think
ercantomac commentedon Nov 14, 2024
This issue is almost 6 years old... Any updates?
Ability to customize the curve used in the hero animation (flutter#26150
Ability to customize the curve used in the hero animation
Ability to customize the curve used in the hero animation
victorsanni commentedon Jun 27, 2025
Partial patch at #159393
Enhance Hero widget with customizable animation curves (#180100)
Enhance Hero widget with customizable animation curves (flutter#180100)
Enhance Hero widget with customizable animation curves (#180100)