Fix RouteAware.didPushNext documentation inaccuracy by ishaquehassan · Pull Request #183097 · flutter/flutter
The documentation for RouteAware.didPushNext incorrectly states that the method is called when "the current route is no longer visible". However, tracing through the source code in routes.dart shows that didPushNext is called synchronously during the push operation in RouteObserver.didPush(), before the transition animation completes. At this point, the current route may still be partially visible as it animates out.
This PR corrects the documentation to accurately describe when didPushNext is called and provides guidance for developers who need to perform actions after the route is fully obscured.
This PR implements the analysis from my earlier comment on this issue.
Fixes #24594
Pre-launch Checklist
- I read the Contributor Guide and followed the process outlined there for submitting PRs.
- I read the Tree Hygiene wiki page, which explains my responsibilities.
- I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
- I signed the CLA.
- I listed at least one issue that this PR fixes in the description above.
- I updated/added relevant documentation (doc comments with
///). - I added new tests to check the change I am making, or this PR is test-exempt.
- I followed the breaking change policy and added Data Driven Fixes where supported.
- All existing and new tests are passing.
If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.