From 9404e1f71ffd8fdf629856a9a23882f69dd4806c Mon Sep 17 00:00:00 2001 From: krawieck Date: Tue, 9 Feb 2021 21:36:21 +0100 Subject: [PATCH] add extension for reversing brightness, also fix the whole thing --- lib/main.dart | 3 ++- lib/util/extensions/brightness.dart | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 lib/util/extensions/brightness.dart diff --git a/lib/main.dart b/lib/main.dart index 326005d..f074bff 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -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 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, )), ); diff --git a/lib/util/extensions/brightness.dart b/lib/util/extensions/brightness.dart new file mode 100644 index 0000000..1178f3c --- /dev/null +++ b/lib/util/extensions/brightness.dart @@ -0,0 +1,6 @@ +import 'package:flutter/material.dart'; + +extension ReverseBrightness on Brightness { + Brightness get reverse => + this == Brightness.dark ? Brightness.light : Brightness.dark; +}