Skip to content

Commit

Permalink
Fix system navigation bar color
Browse files Browse the repository at this point in the history
  • Loading branch information
AhsanSarwar45 committed Sep 8, 2024
1 parent 266a502 commit e9dc31b
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions lib/navigation/widgets/app_top_bar.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit e9dc31b

Please sign in to comment.