Groups keyboard shortcuts have been updated
Dismiss
See shortcuts

[Breaking Change] Ensure all Navigator push animations are consistent and trigger secondaryAnimations

254 views
Skip to first unread message

Joel Lurcook

unread,
Oct 18, 2019, 3:17:11 PM10/18/19
to Flutter Public Announcements (flutter-announce)

Hello,

I propose that the Flutter Navigator code be amended to ensure animation consistency between all Navigator methods that perform a push animation, in particular that pushAndRemoveUntil() and pushReplacement() be changed to ensure that the secondaryAnimation of relevant route transitions is triggered.

Currently, the push() method will invoke the secondaryAnimation, whereas pushAndRemoveUntil() and pushReplacement() do not. This creates inconsistency between different flavours of 'push...' actions. It also means that the secondaryAnimation parameter of a RouteTransitionsBuilder will be entirely redundant when invoked via the latter methods, and the writer of the builder has no means to identify when the parameter is redundant.

Instead, it is proposed the secondaryAnimation is always triggered for all push actions, and it is left to the RouteTransitionsBuilder developer to decide whether they wish to use it.

Issue:
https://github.com/flutter/flutter/issues/41680

Pull Request:

https://github.com/flutter/flutter/pull/42100


Porting - this change does not make any interface or signature changes, it only ensures that the secondaryAnimation of a RouteTransitionsBuilder is consistently active. Developers can retain current behaviour by not using the parameter, which they should already be doing if relying on the animation having no effect. If developers wish to use the animation only for push() method invocations, they would need to create and manage separate, independent state that indicates whether the secondaryAnimation should be used.

Should anyone wish for my assistance porting this issue, I am happy to provide what help I can.

If anyone feels this change will cause a problem, please post comments for discussion on the pull request linked above.

Kind regards,

Joel Lurcook

Reply all
Reply to author
Forward
0 new messages