From d51be0577bb0034af52b78e05c568281b24417cb Mon Sep 17 00:00:00 2001 From: tuxsudo Date: Tue, 18 Nov 2025 12:42:53 -0500 Subject: [PATCH] Fix navigation gradient (#2657) * Fix navigation gradient --- lib/src/screens/dashboard/dashboard_page.dart | 61 +++++++++++++------ .../dashboard/pages/navigation_dock.dart | 26 -------- 2 files changed, 43 insertions(+), 44 deletions(-) diff --git a/lib/src/screens/dashboard/dashboard_page.dart b/lib/src/screens/dashboard/dashboard_page.dart index 15e0697b1..4b145b212 100644 --- a/lib/src/screens/dashboard/dashboard_page.dart +++ b/lib/src/screens/dashboard/dashboard_page.dart @@ -34,6 +34,7 @@ import 'package:shared_preferences/shared_preferences.dart'; import 'package:smooth_page_indicator/smooth_page_indicator.dart'; import 'package:cake_wallet/main.dart'; import 'package:cake_wallet/src/screens/release_notes/release_notes_screen.dart'; +import 'package:cake_wallet/themes/core/theme_extension.dart'; class DashboardPage extends StatefulWidget { DashboardPage({ @@ -232,27 +233,51 @@ class _DashboardPageView extends BasePage { ); }, ), - Positioned( - child: Container( - alignment: Alignment.bottomCenter, - margin: EdgeInsets.only(bottom: 110), - child: Semantics( - container: true, - label: 'Page indicator', - hint: 'Swipe left or right to change page, or double tap buttons below to navigate directly.', - child: ExcludeSemantics( - excluding: false, - child: PageIndicator( - controller: controller, - dashboardViewModel: dashboardViewModel, + Stack( + alignment: Alignment.bottomCenter, + children: [ + IgnorePointer( + child: Container( + alignment: Alignment.bottomCenter, + height: 220, + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, + end: Alignment.bottomCenter, + colors: [ + context.customColors.backgroundGradientColor.withAlpha(5), + context.customColors.backgroundGradientColor.withAlpha(50), + context.customColors.backgroundGradientColor.withAlpha(125), + context.customColors.backgroundGradientColor.withAlpha(150), + context.customColors.backgroundGradientColor.withAlpha(200), + context.customColors.backgroundGradientColor, + context.customColors.backgroundGradientColor, + ], + ), + ), ), ), - ), - ), + Container( + margin: EdgeInsets.only(bottom: 110), + child: Semantics( + container: true, + label: 'Page indicator', + hint: + 'Swipe left or right to change page, or double tap buttons below to navigate directly.', + child: ExcludeSemantics( + excluding: false, + child: PageIndicator( + controller: controller, + dashboardViewModel: dashboardViewModel, + ), + ), + ), + ), + NavigationDock( + dashboardViewModel: dashboardViewModel, + ) + ], ), - NavigationDock( - dashboardViewModel: dashboardViewModel, - ) ], ), ), diff --git a/lib/src/screens/dashboard/pages/navigation_dock.dart b/lib/src/screens/dashboard/pages/navigation_dock.dart index c4ee6b09b..12fd55c22 100644 --- a/lib/src/screens/dashboard/pages/navigation_dock.dart +++ b/lib/src/screens/dashboard/pages/navigation_dock.dart @@ -21,23 +21,9 @@ class NavigationDock extends StatelessWidget { return Container( height: 84, alignment: Alignment.bottomCenter, - decoration: dashboardViewModel.settingsStore.backgroundImage.isEmpty - ? BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: _getColors(context), - ), - ) - : null, child: Container( decoration: BoxDecoration( borderRadius: BorderRadius.circular(50), - gradient: LinearGradient( - begin: Alignment.topCenter, - end: Alignment.bottomCenter, - colors: _getColors(context), - ), ), margin: const EdgeInsets.only(left: 8, right: 8, bottom: 16), child: ClipRRect( @@ -105,16 +91,4 @@ class NavigationDock extends StatelessWidget { ), ); } - - List _getColors(BuildContext context) { - return [ - context.customColors.backgroundGradientColor.withAlpha(5), - context.customColors.backgroundGradientColor.withAlpha(50), - context.customColors.backgroundGradientColor.withAlpha(125), - context.customColors.backgroundGradientColor.withAlpha(150), - context.customColors.backgroundGradientColor.withAlpha(200), - context.customColors.backgroundGradientColor, - context.customColors.backgroundGradientColor, - ]; - } }