Skip to content

Commit

Permalink
fix: Specify that dark theme is dark (#1699)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenjaminHalko authored Feb 25, 2024
1 parent d068955 commit d4b15ae
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions lib/ui/theme/dynamic_theme_builder.dart
Original file line number Diff line number Diff line change
Expand Up @@ -28,30 +28,13 @@ class DynamicThemeBuilder extends StatefulWidget {
class _DynamicThemeBuilderState extends State<DynamicThemeBuilder>
with WidgetsBindingObserver {
Brightness brightness = PlatformDispatcher.instance.platformBrightness;
final ManagerAPI _managerAPI = locator<ManagerAPI>();

@override
void initState() {
super.initState();
WidgetsBinding.instance.addObserver(this);
}

@override
void didChangePlatformBrightness() {
setState(() {
brightness = PlatformDispatcher.instance.platformBrightness;
});
if (_managerAPI.getThemeMode() < 2) {
SystemChrome.setSystemUIOverlayStyle(
SystemUiOverlayStyle(
systemNavigationBarIconBrightness: brightness == Brightness.light
? Brightness.dark
: Brightness.light,
),
);
}
}

@override
Widget build(BuildContext context) {
return DynamicColorBuilder(
Expand All @@ -70,6 +53,7 @@ class _DynamicThemeBuilderState extends State<DynamicThemeBuilder>
textTheme: GoogleFonts.robotoTextTheme(ThemeData.light().textTheme),
);
final ThemeData darkDynamicTheme = ThemeData(
brightness: Brightness.dark,
useMaterial3: true,
navigationBarTheme: NavigationBarThemeData(
labelTextStyle: MaterialStateProperty.all(
Expand Down

0 comments on commit d4b15ae

Please sign in to comment.