Skip to content

AdaptiveLayout delegate animating primaryNavigation sequentially instead of in parallel #113342

@oravecz

Description

@oravecz

Steps to Reproduce

  1. Execute flutter run -d chrome lib/adaptive_layout_demo.dart in the flutter_adaptive_scaffold project
  2. As the app is sized between medium and small breakpoints, the primary nav bar animates in and out of the screen

Expected results:

The primary navigation bar animates in nicely. The icons slide in with the background area from off screen to on screen.
When the navigation bar animates out, I would expect the animation to reverse and show the icons sliding away with its container off the screen. The bottom nav bar animates like this.

Actual results:

During the primary nav bar's "out" animation, the icons disappear in a flash, then the slot animates off the screen.

I think the intent is for the primaryNavigation outAnimation to control the SlotLayout and its child. This is how the bottomNavigation is configured in the demo. Because primaryNavigation has only an inAnimation specified, the NavigationRailBar is just disappearing at the beginning of the animation.

However, there appears to be a bug in the layout delegate. It is not animating the SlotLayout and its child together, it is animating them sequentially. For example, if you place the outAnimation on the primaryNavigation, you can see the effect.

Breakpoints.medium: SlotLayout.from(
  inAnimation: AdaptiveScaffold.leftOutIn,
  outAnimation: AdaptiveScaffold.leftInOut,   // <-- added this
  key: const Key('Primary Navigation Medium'),
  builder: (_) => AdaptiveScaffold.standardNavigationRail(
    leading: const Icon(Icons.menu),
    destinations: destinations
        .map((_) => AdaptiveScaffold.toRailDestination(_))
        .toList(),
  ),
),

The out animation for the primaryNavigation executes the outAnimation for my SlotLayout, and then sequentially executes the animation for the primary navigation's container, causing a snap shut effect.

primary_navigation_animation.mov

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Issues that are less important to the Flutter projectfound in release: 3.4Found to occur in 3.4found in release: 3.5Found to occur in 3.5has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: flutter_adaptive_scaffoldThe flutter_adaptive_scaffold packagepackageflutter/packages repository. See also p: labels.r: invalidIssue is closed as not validteam-ecosystemOwned by Ecosystem teamtriaged-ecosystemTriaged by Ecosystem team

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions