Skip to content

Clarify route transition animations#186552

Open
mvincentong wants to merge 1 commit into
flutter:mainfrom
mvincentong:docs-route-transition-animations
Open

Clarify route transition animations#186552
mvincentong wants to merge 1 commit into
flutter:mainfrom
mvincentong:docs-route-transition-animations

Conversation

@mvincentong
Copy link
Copy Markdown

Issue: fixes #23206

The PageRouteBuilder and RouteTransitionsBuilder docs pointed readers to ModalRoute.buildTransitions, but the callback docs themselves did not explain the practical difference between the primary animation and secondaryAnimation parameters.

Fix:

Clarify that animation drives the route's own push/pop transition, while secondaryAnimation lets the route coordinate with a route pushed above it. The docs now also mention that secondaryAnimation only runs when the adjacent routes allow transition coordination through canTransitionTo/canTransitionFrom.

Tests:

  • ./bin/dart format --output=none --set-exit-if-changed packages/flutter/lib/src/widgets/routes.dart packages/flutter/lib/src/widgets/pages.dart
  • ./bin/flutter analyze packages/flutter/lib/src/widgets/routes.dart packages/flutter/lib/src/widgets/pages.dart
  • git diff --check

Risk:

Docs-only change in two route API comments. No runtime behavior changes.

@github-actions github-actions Bot added framework flutter/packages/flutter repository. See also f: labels. f: routes Navigator, Router, and related APIs. labels May 15, 2026
Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request enhances the documentation for PageRouteBuilder and RouteTransitionsBuilder by detailing the roles of the animation and secondaryAnimation parameters in route transitions and coordination. The review feedback recommends using square brackets for parameter references to ensure consistency with Flutter documentation standards and suggests providing more specific details regarding transition coordination methods.

Comment thread packages/flutter/lib/src/widgets/pages.dart Outdated
Comment thread packages/flutter/lib/src/widgets/routes.dart Outdated
@mvincentong mvincentong force-pushed the docs-route-transition-animations branch from 4548e6c to 6e2f225 Compare May 15, 2026 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

f: routes Navigator, Router, and related APIs. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant