From e9dc31b6a3a2619fba3d08d2d032b5a997c55401 Mon Sep 17 00:00:00 2001 From: AhsanSarwar45 Date: Sun, 8 Sep 2024 23:04:17 +0500 Subject: [PATCH] Fix system navigation bar color --- lib/navigation/widgets/app_top_bar.dart | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/lib/navigation/widgets/app_top_bar.dart b/lib/navigation/widgets/app_top_bar.dart index 95852f10..530fb879 100644 --- a/lib/navigation/widgets/app_top_bar.dart +++ b/lib/navigation/widgets/app_top_bar.dart @@ -20,17 +20,22 @@ class AppTopBar extends StatelessWidget implements PreferredSizeWidget { final colorScheme = theme.colorScheme; final textTheme = theme.textTheme; + Brightness iconBrightness = + colorScheme.background.computeLuminance() > 0.179 + ? Brightness.dark + : Brightness.light; + return PreferredSize( preferredSize: preferredSize, child: Padding( padding: const EdgeInsets.symmetric(horizontal: 8.0), child: AppBar( systemOverlayStyle: SystemUiOverlayStyle( + systemNavigationBarColor: colorScheme.background, + systemNavigationBarDividerColor: Colors.transparent, + systemNavigationBarIconBrightness: iconBrightness, statusBarColor: colorScheme.background, - statusBarIconBrightness: - colorScheme.background.computeLuminance() > 0.179 - ? Brightness.dark - : Brightness.light, // For Android (dark icons) + statusBarIconBrightness: iconBrightness, // For Android (dark icons) ), scrolledUnderElevation: 0, toolbarHeight: preferredSize.height,