add extension for reversing brightness, also fix the whole thing

This commit is contained in:
krawieck 2021-02-09 21:36:21 +01:00
parent 090816ded3
commit 9404e1f71f
2 changed files with 8 additions and 1 deletions

View File

@ -14,6 +14,7 @@ import 'pages/profile_tab.dart';
import 'pages/search_tab.dart';
import 'stores/accounts_store.dart';
import 'stores/config_store.dart';
import 'util/extensions/brightness.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
@ -109,7 +110,7 @@ class MyHomePage extends HookWidget {
Future.microtask(
() => SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
systemNavigationBarColor: theme.scaffoldBackgroundColor,
systemNavigationBarIconBrightness: theme.brightness,
systemNavigationBarIconBrightness: theme.brightness.reverse,
)),
);

View File

@ -0,0 +1,6 @@
import 'package:flutter/material.dart';
extension ReverseBrightness on Brightness {
Brightness get reverse =>
this == Brightness.dark ? Brightness.light : Brightness.dark;
}