From e34479ccd8fd08e0adf7534e55cac858138e4116 Mon Sep 17 00:00:00 2001 From: Shawn Date: Tue, 5 Dec 2023 10:59:01 -0700 Subject: [PATCH] Keep backBtn in landscape mode, just align it to the right --- .../screens/editorial/editorial_screen.dart | 31 +++++++++++-------- 1 file changed, 18 insertions(+), 13 deletions(-) diff --git a/lib/ui/screens/editorial/editorial_screen.dart b/lib/ui/screens/editorial/editorial_screen.dart index d59a721c..dc66e056 100644 --- a/lib/ui/screens/editorial/editorial_screen.dart +++ b/lib/ui/screens/editorial/editorial_screen.dart @@ -73,7 +73,7 @@ class _WonderEditorialScreenState extends State { /// Attempt to maintain a similar aspect ratio for the image within the app-bar double maxAppBarHeight = min(context.widthPx, $styles.sizes.maxContentWidth1) * 1.2; - bool showBackBtn = appLogic.shouldUseNavRail() == false; + final backBtnAlign = appLogic.shouldUseNavRail() ? Alignment.topRight : Alignment.topLeft; return PopRouterOnOverScroll( controller: _scroller, child: ColoredBox( @@ -169,18 +169,23 @@ class _WonderEditorialScreenState extends State { ), /// Home Btn - if (showBackBtn) ...[ - AnimatedBuilder( - animation: _scroller, - builder: (_, child) { - return AnimatedOpacity( - opacity: _scrollPos.value > 0 ? 0 : 1, - duration: $styles.times.med, - child: child, - ); - }, - child: AppHeader(backIcon: AppIcons.north, isTransparent: true)) - ], + AnimatedBuilder( + animation: _scroller, + builder: (_, child) { + return AnimatedOpacity( + opacity: _scrollPos.value > 0 ? 0 : 1, + duration: $styles.times.med, + child: child, + ); + }, + child: Align( + alignment: backBtnAlign, + child: Padding( + padding: EdgeInsets.all($styles.insets.sm), + child: BackBtn(icon: AppIcons.north), + ), + ), + ) ], ), ),