Merge pull request #26 from basitali1509/feat/bottom-nav-bar-UI

FEEDBACK: Bottom Navigation Bar background color should be white in light mode
This commit is contained in:
dstark5
2023-09-12 08:44:34 +05:30
committed by GitHub

View File

@ -96,6 +96,8 @@ class _HomePageState extends ConsumerState<HomePage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
final isDarkMode = Theme.of(context).brightness == Brightness.dark;
final selectedIndex = ref.watch(selectedIndexProvider); final selectedIndex = ref.watch(selectedIndexProvider);
return Scaffold( return Scaffold(
@ -108,7 +110,7 @@ class _HomePageState extends ConsumerState<HomePage> {
bottomNavigationBar: SafeArea( bottomNavigationBar: SafeArea(
child: GNav( child: GNav(
rippleColor: Colors.redAccent, rippleColor: Colors.redAccent,
backgroundColor: Colors.black, backgroundColor: isDarkMode ? Colors.black : Colors.grey.shade300,
haptic: true, haptic: true,
tabBorderRadius: 50, tabBorderRadius: 50,
tabActiveBorder: Border.all( tabActiveBorder: Border.all(
@ -123,12 +125,12 @@ class _HomePageState extends ConsumerState<HomePage> {
iconSize: 19, // tab button icon size iconSize: 19, // tab button icon size
tabBackgroundColor: Theme.of(context).colorScheme.secondary, tabBackgroundColor: Theme.of(context).colorScheme.secondary,
padding: const EdgeInsets.symmetric(horizontal: 13, vertical: 6.5), padding: const EdgeInsets.symmetric(horizontal: 13, vertical: 6.5),
tabs: const [ tabs: [
GButton( GButton(
icon: Icons.trending_up, icon: Icons.trending_up,
text: 'Trending', text: 'Trending',
iconColor: Colors.white, iconColor: isDarkMode ? Colors.white : Colors.black,
textStyle: TextStyle( textStyle: const TextStyle(
fontWeight: FontWeight.w900, fontWeight: FontWeight.w900,
color: Colors.white, color: Colors.white,
fontSize: 11, fontSize: 11,
@ -137,8 +139,8 @@ class _HomePageState extends ConsumerState<HomePage> {
GButton( GButton(
icon: Icons.search, icon: Icons.search,
text: 'Search', text: 'Search',
iconColor: Colors.white, iconColor: isDarkMode ? Colors.white : Colors.black,
textStyle: TextStyle( textStyle: const TextStyle(
fontWeight: FontWeight.w900, fontWeight: FontWeight.w900,
color: Colors.white, color: Colors.white,
fontSize: 11, fontSize: 11,
@ -147,8 +149,8 @@ class _HomePageState extends ConsumerState<HomePage> {
GButton( GButton(
icon: Icons.collections_bookmark, icon: Icons.collections_bookmark,
text: 'My Library', text: 'My Library',
iconColor: Colors.white, iconColor: isDarkMode ? Colors.white : Colors.black,
textStyle: TextStyle( textStyle: const TextStyle(
fontWeight: FontWeight.w900, fontWeight: FontWeight.w900,
color: Colors.white, color: Colors.white,
fontSize: 11, fontSize: 11,
@ -157,8 +159,8 @@ class _HomePageState extends ConsumerState<HomePage> {
GButton( GButton(
icon: Icons.build, icon: Icons.build,
text: 'Settings', text: 'Settings',
iconColor: Colors.white, iconColor: isDarkMode ? Colors.white : Colors.black,
textStyle: TextStyle( textStyle: const TextStyle(
fontWeight: FontWeight.w900, fontWeight: FontWeight.w900,
color: Colors.white, color: Colors.white,
fontSize: 11, fontSize: 11,