Implement reverseTransitionDuration for TransitionRoute#48274
Implement reverseTransitionDuration for TransitionRoute#48274shihaohong merged 4 commits intoflutter:masterfrom shihaohong:transition-route-reverse-duration
Conversation
| final Completer<T> _transitionCompleter = Completer<T>(); | ||
|
|
||
| /// The duration the transition lasts. | ||
| /// The duration the transition going forwards. |
There was a problem hiding this comment.
Maybe add a "see also" section to link to reverseTransitionDuration?
| /// The duration the transition going forwards. | ||
| Duration get transitionDuration; | ||
|
|
||
| /// The duration the transition going in reverse. |
There was a problem hiding this comment.
Mention the default and link it to transitionDuraiton?
| ); | ||
|
|
||
| @override | ||
| Duration get reverseTransitionDuration => _reverseTransitionDuration; |
There was a problem hiding this comment.
This and the next line could be simplified to:
@override
final Duration reverseTransitionDuration;and then in the constructor you could just have this.reverseTransitionDuration.
|
What does it look like when you have a transitionDuration of x and a reverseTransitionDuration of y and while the push of a route is ongoing you pop it again? Is there a jump in the animation? Or does it smoothly switch direction? |
|
When you interrupt the push of a route that is ongoing with a pop, it does not cause a jump in animation if the animations are properly defined. For example, with Edit: |
goderbauer
left a comment
There was a problem hiding this comment.
LGTM
Maybe add a simple test to ensure that we never break the smooth animation when you pop while a push is ongoing with different durations?
|
@goderbauer I added the forward smooth transition test. PTAL |
* Implement reverseTransitionDuration in TransitionRoute
Description
This change allows developers to implement a reverse duration for a page transition. It defaults to the forward transitionDuration if it isn't specified.
Related Issues
n/a
Tests
I added the following tests:
Added a test for the default reverse transition duration
Added a test for a custom reverse transition duration
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]). This will ensure a smooth and quick review process.///).flutter analyze --flutter-repo) does not report any problems on my PR.Breaking Change
Did any tests fail when you ran them? Please read Handling breaking changes.