Visitar URL original
Fix RouteAware.didPushNext documentation inaccuracy by ishaquehassan · Pull Request #183097 · flutter/flutter · GitHub
Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: address review comments - differentiate opening line, use second…
…aryAnimation, add tool snippet template
  • Loading branch information
ishaquehassan committed Mar 13, 2026
commit f2571d5c059b2846703a3a36c8e05b44c717e9bd
13 changes: 8 additions & 5 deletions packages/flutter/lib/src/widgets/routes.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2525,21 +2525,24 @@ abstract mixin class RouteAware {
/// Called when the current route has been popped off.
void didPop() {}

/// Called when a new route has been pushed.
/// Called when a new route has been pushed on top of this route, temporarily
/// obscuring it.
///
/// This method is called synchronously during the push operation, before the
/// transition animation completes. The current route may still be partially
/// visible as it animates out. To perform actions after the route is fully
/// obscured, consider using [ModalRoute.animation] to listen for animation
/// completion, for example:
/// obscured, consider using [ModalRoute.secondaryAnimation] to listen for
/// animation completion, for example:
///
/// {@tool snippet}
/// ```dart
Comment thread
ishaquehassan marked this conversation as resolved.
Resolved
/// ModalRoute.of(context)?.animation?.addStatusListener((AnimationStatus status) {
/// ModalRoute.of(context)?.secondaryAnimation?.addStatusListener((AnimationStatus status) {
/// if (status == AnimationStatus.completed) {
/// // The new route is now fully visible and the old route is fully obscured.
/// // This route is now fully obscured by the new route.
/// }
/// });
/// ```
/// {@end-tool}
void didPushNext() {}
}

Expand Down