diff --git a/lib/config/theme.dart b/lib/config/theme.dart index 04bc91c..2ecc2af 100644 --- a/lib/config/theme.dart +++ b/lib/config/theme.dart @@ -24,6 +24,9 @@ ThemeData lightTheme(ColorScheme? dynamicColorScheme) => ThemeData( color: Colors.black ), ), + navigationBarTheme: NavigationBarThemeData( + indicatorColor: dynamicColorScheme != null ? dynamicColorScheme.primaryContainer : adguardGreenColor, + ), floatingActionButtonTheme: FloatingActionButtonThemeData( foregroundColor: Colors.white, backgroundColor: dynamicColorScheme != null ? dynamicColorScheme.primary : adguardGreenColor @@ -76,7 +79,7 @@ ThemeData darkTheme(ColorScheme? dynamicColorScheme) => ThemeData( scaffoldBackgroundColor: dynamicColorScheme != null ? dynamicColorScheme.background :const Color.fromRGBO(18, 18, 18, 1), dialogBackgroundColor: dynamicColorScheme != null ? dynamicColorScheme.background : const Color.fromRGBO(44, 44, 44, 1), navigationBarTheme: NavigationBarThemeData( - indicatorColor: dynamicColorScheme != null ? dynamicColorScheme.primary : adguardGreenColor, + indicatorColor: dynamicColorScheme != null ? dynamicColorScheme.primaryContainer : adguardGreenColor, ), snackBarTheme: SnackBarThemeData( contentTextStyle: const TextStyle( diff --git a/lib/widgets/bottom_nav_bar.dart b/lib/widgets/bottom_nav_bar.dart index e6cd29c..204c1c0 100644 --- a/lib/widgets/bottom_nav_bar.dart +++ b/lib/widgets/bottom_nav_bar.dart @@ -50,7 +50,16 @@ class BottomNavBar extends StatelessWidget { return NavigationBar( selectedIndex: appConfigProvider.selectedScreen, destinations: screens.map((screen) => NavigationDestination( - icon: Icon(screen.icon), + icon: Icon( + screen.icon, + color: screens.indexOf(screen) == appConfigProvider.selectedScreen + ? Theme.of(context).navigationBarTheme.indicatorColor!.computeLuminance() > 0.5 ? + appConfigProvider.useDynamicColor == true + ? Theme.of(context).primaryColor + : Colors.black + : Colors.white + : null, + ), label: translatedName(screen.name) )).toList(), onDestinationSelected: (value) {