Skip to content

Commit

Permalink
Black navigation bar after opening the scanner (#405)
Browse files Browse the repository at this point in the history
* fix: move SystemUiOverlayStyle to annotated region

* fix: specify all params
  • Loading branch information
jkoenig134 authored Jan 22, 2025
1 parent 0998546 commit e5e8d6d
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 35 deletions.
11 changes: 10 additions & 1 deletion apps/enmeshed/lib/core/widgets/scanner_view/scanner_entry.dart
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import 'dart:async';
import 'dart:math' as math;

import 'package:enmeshed_ui_kit/enmeshed_ui_kit.dart';
Expand Down Expand Up @@ -81,7 +82,15 @@ class _ScannerEntryState extends State<ScannerEntry> with SingleTickerProviderSt
final scanWindow = Rect.fromLTWH(scanWindowX, scanWindowY, scannerWindowSize, scannerWindowSize);

return AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle.light,
value: const SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
systemNavigationBarDividerColor: Colors.transparent,
systemNavigationBarColor: Colors.transparent,
systemNavigationBarContrastEnforced: false,
systemNavigationBarIconBrightness: Brightness.light,
statusBarBrightness: Brightness.light,
statusBarIconBrightness: Brightness.light,
),
child: Stack(
fit: StackFit.expand,
children: [
Expand Down
70 changes: 36 additions & 34 deletions apps/enmeshed/lib/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -472,47 +472,49 @@ class EnmeshedApp extends StatelessWidget {
]);

unawaited(SystemChrome.setEnabledSystemUIMode(SystemUiMode.edgeToEdge));
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(

return AnnotatedRegion<SystemUiOverlayStyle>(
value: SystemUiOverlayStyle(
statusBarColor: Colors.transparent,
systemNavigationBarDividerColor: Colors.transparent,
systemNavigationBarColor: Colors.transparent,
systemNavigationBarContrastEnforced: false,
systemNavigationBarIconBrightness: Theme.of(context).brightness == Brightness.light ? Brightness.dark : Brightness.light,
statusBarBrightness: Theme.of(context).brightness == Brightness.light ? Brightness.dark : Brightness.light,
statusBarIconBrightness: Theme.of(context).brightness == Brightness.light ? Brightness.dark : Brightness.light,
),
);

return Features(
child: MaterialApp.router(
routerConfig: _router,
debugShowCheckedModeBanner: false,
// dark mode is disabled until we have a proper dark theme
themeMode: ThemeMode.light,
theme: ThemeData(
colorScheme: lightColorScheme,
extensions: [lightCustomColors, woltThemeData],
navigationBarTheme: lightNavigationBarTheme,
appBarTheme: lightAppBarTheme,
textTheme: textTheme,
),
darkTheme: ThemeData(
colorScheme: darkColorScheme,
extensions: [darkCustomColors, woltThemeData],
navigationBarTheme: darkNavigationBarTheme,
appBarTheme: darkAppBarTheme,
textTheme: textTheme,
),
localizationsDelegates: [
CroppyLocalizations.delegate,
FlutterI18nDelegate(
translationLoader: FileTranslationLoader(basePath: 'assets/i18n'),
missingTranslationHandler: (key, locale) {
GetIt.I.get<Logger>().e('Missing Key: $key, locale: $locale');
},
child: Features(
child: MaterialApp.router(
routerConfig: _router,
debugShowCheckedModeBanner: false,
// dark mode is disabled until we have a proper dark theme
themeMode: ThemeMode.light,
theme: ThemeData(
colorScheme: lightColorScheme,
extensions: [lightCustomColors, woltThemeData],
navigationBarTheme: lightNavigationBarTheme,
appBarTheme: lightAppBarTheme,
textTheme: textTheme,
),
...AppLocalizations.localizationsDelegates,
],
supportedLocales: AppLocalizations.supportedLocales,
darkTheme: ThemeData(
colorScheme: darkColorScheme,
extensions: [darkCustomColors, woltThemeData],
navigationBarTheme: darkNavigationBarTheme,
appBarTheme: darkAppBarTheme,
textTheme: textTheme,
),
localizationsDelegates: [
CroppyLocalizations.delegate,
FlutterI18nDelegate(
translationLoader: FileTranslationLoader(basePath: 'assets/i18n'),
missingTranslationHandler: (key, locale) {
GetIt.I.get<Logger>().e('Missing Key: $key, locale: $locale');
},
),
...AppLocalizations.localizationsDelegates,
],
supportedLocales: AppLocalizations.supportedLocales,
),
),
);
}
Expand Down

0 comments on commit e5e8d6d

Please sign in to comment.