-
Notifications
You must be signed in to change notification settings - Fork 29.7k
Description
Steps to Reproduce
- Execute
flutter run -d chrome lib/adaptive_layout_demo.dartin theflutter_adaptive_scaffoldproject - 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.