Remove animations from menu orientation changes

This commit is contained in:
Shawn 2023-04-18 11:22:19 -06:00
parent b90108fa92
commit 8b55cca3a0

View File

@ -57,6 +57,7 @@ class _WonderDetailsScreenState extends State<WonderDetailsScreen>
bool showTabBarBg = tabIndex != 1; bool showTabBarBg = tabIndex != 1;
final tabBarSize = _tabBarSize ?? 0; final tabBarSize = _tabBarSize ?? 0;
final menuPadding = _useNavRail ? EdgeInsets.only(left: tabBarSize) : EdgeInsets.only(bottom: tabBarSize); final menuPadding = _useNavRail ? EdgeInsets.only(left: tabBarSize) : EdgeInsets.only(bottom: tabBarSize);
return ColoredBox( return ColoredBox(
color: Colors.black, color: Colors.black,
child: Stack( child: Stack(
@ -65,17 +66,16 @@ class _WonderDetailsScreenState extends State<WonderDetailsScreen>
LazyIndexedStack( LazyIndexedStack(
index: _tabController.index, index: _tabController.index,
children: [ children: [
WonderEditorialScreen(wonder, onScroll: _handleDetailsScrolled), Padding(
padding: menuPadding,
child: WonderEditorialScreen(wonder, onScroll: _handleDetailsScrolled),
),
PhotoGallery(collectionId: wonder.unsplashCollectionId, wonderType: wonder.type), PhotoGallery(collectionId: wonder.unsplashCollectionId, wonderType: wonder.type),
AnimatedPadding( Padding(
duration: $styles.times.fast,
curve: Curves.easeOut,
padding: menuPadding, padding: menuPadding,
child: ArtifactCarouselScreen(type: wonder.type), child: ArtifactCarouselScreen(type: wonder.type),
), ),
AnimatedPadding( Padding(
duration: $styles.times.fast,
curve: Curves.easeOut,
padding: menuPadding, padding: menuPadding,
child: WonderEvents(type: widget.type), child: WonderEvents(type: widget.type),
), ),
@ -89,14 +89,6 @@ class _WonderDetailsScreenState extends State<WonderDetailsScreen>
valueListenable: _detailsHasScrolled, valueListenable: _detailsHasScrolled,
builder: (_, value, ___) => MeasurableWidget( builder: (_, value, ___) => MeasurableWidget(
onChange: _handleTabMenuSized, onChange: _handleTabMenuSized,
/// Animate the menu in when the axis changes
child: Animate(
key: ValueKey(_useNavRail),
effects: [
FadeEffect(begin: 0, delay: $styles.times.fast),
SlideEffect(begin: _useNavRail ? Offset(-.2, 0) : Offset(0, .2)),
],
child: WonderDetailsTabMenu( child: WonderDetailsTabMenu(
tabController: _tabController, tabController: _tabController,
wonderType: wonder.type, wonderType: wonder.type,
@ -105,7 +97,6 @@ class _WonderDetailsScreenState extends State<WonderDetailsScreen>
), ),
), ),
), ),
),
], ],
), ),
); );