Remove animations from menu orientation changes
This commit is contained in:
parent
b90108fa92
commit
8b55cca3a0
@ -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,20 +89,11 @@ class _WonderDetailsScreenState extends State<WonderDetailsScreen>
|
|||||||
valueListenable: _detailsHasScrolled,
|
valueListenable: _detailsHasScrolled,
|
||||||
builder: (_, value, ___) => MeasurableWidget(
|
builder: (_, value, ___) => MeasurableWidget(
|
||||||
onChange: _handleTabMenuSized,
|
onChange: _handleTabMenuSized,
|
||||||
|
child: WonderDetailsTabMenu(
|
||||||
/// Animate the menu in when the axis changes
|
tabController: _tabController,
|
||||||
child: Animate(
|
wonderType: wonder.type,
|
||||||
key: ValueKey(_useNavRail),
|
showBg: showTabBarBg,
|
||||||
effects: [
|
axis: _useNavRail ? Axis.vertical : Axis.horizontal),
|
||||||
FadeEffect(begin: 0, delay: $styles.times.fast),
|
|
||||||
SlideEffect(begin: _useNavRail ? Offset(-.2, 0) : Offset(0, .2)),
|
|
||||||
],
|
|
||||||
child: WonderDetailsTabMenu(
|
|
||||||
tabController: _tabController,
|
|
||||||
wonderType: wonder.type,
|
|
||||||
showBg: showTabBarBg,
|
|
||||||
axis: _useNavRail ? Axis.vertical : Axis.horizontal),
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user