forked from yaso_meth/mih-project
On boot, check system theme and set MIH Theme
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/scheduler.dart';
|
||||
//import 'package:fpjs_pro_plugin/error.dart';
|
||||
import '../mih_env/env.dart';
|
||||
import '../mih_router/routeGenerator.dart';
|
||||
@@ -79,7 +80,15 @@ class _MzanziInnovationHubState extends State<MzanziInnovationHub> {
|
||||
_themeMode = ThemeMode.dark;
|
||||
theme = MyTheme();
|
||||
theme.platform = Theme.of(context).platform;
|
||||
theme.mode = "Dark";
|
||||
var brightness =
|
||||
SchedulerBinding.instance.platformDispatcher.platformBrightness;
|
||||
bool isDarkMode = brightness == Brightness.dark;
|
||||
if (isDarkMode) {
|
||||
theme.mode = "Dark";
|
||||
} else {
|
||||
theme.mode = "Light";
|
||||
}
|
||||
|
||||
super.initState();
|
||||
//doInit();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user