add extension for reversing brightness, also fix the whole thing
This commit is contained in:
parent
090816ded3
commit
9404e1f71f
|
@ -14,6 +14,7 @@ import 'pages/profile_tab.dart';
|
||||||
import 'pages/search_tab.dart';
|
import 'pages/search_tab.dart';
|
||||||
import 'stores/accounts_store.dart';
|
import 'stores/accounts_store.dart';
|
||||||
import 'stores/config_store.dart';
|
import 'stores/config_store.dart';
|
||||||
|
import 'util/extensions/brightness.dart';
|
||||||
|
|
||||||
Future<void> main() async {
|
Future<void> main() async {
|
||||||
WidgetsFlutterBinding.ensureInitialized();
|
WidgetsFlutterBinding.ensureInitialized();
|
||||||
|
@ -109,7 +110,7 @@ class MyHomePage extends HookWidget {
|
||||||
Future.microtask(
|
Future.microtask(
|
||||||
() => SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
|
() => SystemChrome.setSystemUIOverlayStyle(SystemUiOverlayStyle(
|
||||||
systemNavigationBarColor: theme.scaffoldBackgroundColor,
|
systemNavigationBarColor: theme.scaffoldBackgroundColor,
|
||||||
systemNavigationBarIconBrightness: theme.brightness,
|
systemNavigationBarIconBrightness: theme.brightness.reverse,
|
||||||
)),
|
)),
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,6 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
extension ReverseBrightness on Brightness {
|
||||||
|
Brightness get reverse =>
|
||||||
|
this == Brightness.dark ? Brightness.light : Brightness.dark;
|
||||||
|
}
|
Loading…
Reference in New Issue