From b668f6b9ae54375b6e5b59a9f984dd6a63a5d2a0 Mon Sep 17 00:00:00 2001 From: mathiskirchner Date: Sat, 22 Nov 2025 16:31:15 +0100 Subject: [PATCH] fix black top/bottom bar when wrapping scaffold in safearea --- .../main_menu/custom_navigation_bar.dart | 131 +++++++++--------- 1 file changed, 67 insertions(+), 64 deletions(-) diff --git a/lib/presentation/views/main_menu/custom_navigation_bar.dart b/lib/presentation/views/main_menu/custom_navigation_bar.dart index 2805689..709d541 100644 --- a/lib/presentation/views/main_menu/custom_navigation_bar.dart +++ b/lib/presentation/views/main_menu/custom_navigation_bar.dart @@ -31,73 +31,76 @@ class _CustomNavigationBarState extends State @override Widget build(BuildContext context) { - return SafeArea( - minimum: EdgeInsets.symmetric(vertical: 30), - child: Scaffold( - appBar: AppBar( - centerTitle: true, - title: Text( - _currentTabTitle(), - style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold), + return Container( + decoration: BoxDecoration(color: CustomTheme.backgroundColor), + child: SafeArea( + minimum: EdgeInsets.symmetric(vertical: 30), + child: Scaffold( + appBar: AppBar( + centerTitle: true, + title: Text( + _currentTabTitle(), + style: const TextStyle(fontSize: 20, fontWeight: FontWeight.bold), + ), + backgroundColor: CustomTheme.backgroundColor, + scrolledUnderElevation: 0, + actions: [ + IconButton( + onPressed: () => Navigator.push( + context, + MaterialPageRoute(builder: (_) => const SettingsView()), + ), + icon: const Icon(Icons.settings), + ), + ], + elevation: 0, ), backgroundColor: CustomTheme.backgroundColor, - scrolledUnderElevation: 0, - actions: [ - IconButton( - onPressed: () => Navigator.push( - context, - MaterialPageRoute(builder: (_) => const SettingsView()), - ), - icon: const Icon(Icons.settings), - ), - ], - elevation: 0, - ), - backgroundColor: CustomTheme.backgroundColor, - body: tabs[currentIndex], - extendBody: true, - bottomNavigationBar: Padding( - padding: const EdgeInsets.symmetric(horizontal: 12.0), - child: Material( - elevation: 10, - borderRadius: BorderRadius.circular(24), - color: CustomTheme.primaryColor, - child: ClipRRect( + body: tabs[currentIndex], + extendBody: true, + bottomNavigationBar: Padding( + padding: const EdgeInsets.symmetric(horizontal: 12.0), + child: Material( + elevation: 10, borderRadius: BorderRadius.circular(24), - child: SizedBox( - height: 60, - child: Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, - children: [ - NavbarItem( - index: 0, - isSelected: currentIndex == 0, - icon: Icons.home_rounded, - label: 'Home', - onTabTapped: onTabTapped, - ), - NavbarItem( - index: 1, - isSelected: currentIndex == 1, - icon: Icons.gamepad_rounded, - label: 'Games', - onTabTapped: onTabTapped, - ), - NavbarItem( - index: 2, - isSelected: currentIndex == 2, - icon: Icons.group_rounded, - label: 'Groups', - onTabTapped: onTabTapped, - ), - NavbarItem( - index: 3, - isSelected: currentIndex == 3, - icon: Icons.bar_chart_rounded, - label: 'Stats', - onTabTapped: onTabTapped, - ), - ], + color: CustomTheme.primaryColor, + child: ClipRRect( + borderRadius: BorderRadius.circular(24), + child: SizedBox( + height: 60, + child: Row( + mainAxisAlignment: MainAxisAlignment.spaceAround, + children: [ + NavbarItem( + index: 0, + isSelected: currentIndex == 0, + icon: Icons.home_rounded, + label: 'Home', + onTabTapped: onTabTapped, + ), + NavbarItem( + index: 1, + isSelected: currentIndex == 1, + icon: Icons.gamepad_rounded, + label: 'Games', + onTabTapped: onTabTapped, + ), + NavbarItem( + index: 2, + isSelected: currentIndex == 2, + icon: Icons.group_rounded, + label: 'Groups', + onTabTapped: onTabTapped, + ), + NavbarItem( + index: 3, + isSelected: currentIndex == 3, + icon: Icons.bar_chart_rounded, + label: 'Stats', + onTabTapped: onTabTapped, + ), + ], + ), ), ), ),