forked from yaso_meth/mih-project
remove theme setting from main to auth check
This commit is contained in:
@@ -1,12 +1,8 @@
|
||||
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';
|
||||
import '../mih_theme/mih_theme.dart';
|
||||
|
||||
//import 'package:fpjs_pro_plugin/fpjs_pro_plugin.dart';
|
||||
|
||||
class MzanziInnovationHub extends StatefulWidget {
|
||||
const MzanziInnovationHub({
|
||||
super.key,
|
||||
@@ -99,14 +95,14 @@ class _MzanziInnovationHubState extends State<MzanziInnovationHub> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
var brightness =
|
||||
SchedulerBinding.instance.platformDispatcher.platformBrightness;
|
||||
bool isDarkMode = brightness == Brightness.dark;
|
||||
if (isDarkMode) {
|
||||
theme.mode = "Dark";
|
||||
} else {
|
||||
theme.mode = "Light";
|
||||
}
|
||||
// var brightness =
|
||||
// SchedulerBinding.instance.platformDispatcher.platformBrightness;
|
||||
// bool isDarkMode = brightness == Brightness.dark;
|
||||
// if (isDarkMode) {
|
||||
// theme.mode = "Dark";
|
||||
// } else {
|
||||
// theme.mode = "Light";
|
||||
// }
|
||||
double width = MediaQuery.sizeOf(context).width;
|
||||
theme.setScreenType(width);
|
||||
precacheImage(theme.loadingImage(), context);
|
||||
|
||||
Reference in New Issue
Block a user