Bugfix to avoid that ThemeData doesn't get changed correctly when darkTheme is s…
…et in GetMaterialApp and Theme should be changed to a ThemeData with Brightness.dark.
Showing
1 changed file
with
6 additions
and
2 deletions
@@ -37,10 +37,14 @@ class GetMaterialController extends GetxController { | @@ -37,10 +37,14 @@ class GetMaterialController extends GetxController { | ||
37 | Map<int, GlobalKey<NavigatorState>> keys = {}; | 37 | Map<int, GlobalKey<NavigatorState>> keys = {}; |
38 | 38 | ||
39 | void setTheme(ThemeData value) { | 39 | void setTheme(ThemeData value) { |
40 | - if (value.brightness == Brightness.light) { | 40 | + if (darkTheme == null) { |
41 | theme = value; | 41 | theme = value; |
42 | } else { | 42 | } else { |
43 | - darkTheme = value; | 43 | + if (value.brightness == Brightness.light) { |
44 | + theme = value; | ||
45 | + } else { | ||
46 | + darkTheme = value; | ||
47 | + } | ||
44 | } | 48 | } |
45 | update(); | 49 | update(); |
46 | } | 50 | } |
-
Please register or login to post a comment