us router in main
This commit is contained in:
@@ -1,7 +1,8 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
import 'package:mzansi_innovation_hub/mih_config/mih_colors.dart';
|
||||||
import 'mih_config/mih_env.dart';
|
import 'mih_config/mih_env.dart';
|
||||||
import 'mih_config/mih_routeGenerator.dart';
|
// import 'mih_config/mih_routeGenerator.dart';
|
||||||
|
import 'mih_config/mih_go_router.dart';
|
||||||
import 'mih_config/mih_theme.dart';
|
import 'mih_config/mih_theme.dart';
|
||||||
|
|
||||||
class MzansiInnovationHub extends StatefulWidget {
|
class MzansiInnovationHub extends StatefulWidget {
|
||||||
@@ -53,18 +54,9 @@ class _MzansiInnovationHubState extends State<MzansiInnovationHub> {
|
|||||||
@override
|
@override
|
||||||
void initState() {
|
void initState() {
|
||||||
theme = MihTheme();
|
theme = MihTheme();
|
||||||
// var systemTheme =
|
|
||||||
// SchedulerBinding.instance.platformDispatcher.platformBrightness;
|
|
||||||
// bool isDarkMode = systemTheme == Brightness.dark;
|
|
||||||
// if (isDarkMode) {
|
|
||||||
// theme.mode = "Dark";
|
|
||||||
// } else {
|
|
||||||
// theme.mode = "Light";
|
|
||||||
// }
|
|
||||||
super.initState();
|
super.initState();
|
||||||
theme.mode = "Dark";
|
theme.mode = "Dark";
|
||||||
theme.platform = Theme.of(context).platform;
|
theme.platform = Theme.of(context).platform;
|
||||||
//doInit();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@override
|
@override
|
||||||
@@ -72,14 +64,15 @@ class _MzansiInnovationHubState extends State<MzansiInnovationHub> {
|
|||||||
double width = MediaQuery.sizeOf(context).width;
|
double width = MediaQuery.sizeOf(context).width;
|
||||||
theme.setScreenType(width);
|
theme.setScreenType(width);
|
||||||
precacheImage(theme.loadingImage(), context);
|
precacheImage(theme.loadingImage(), context);
|
||||||
return MaterialApp(
|
return MaterialApp.router(
|
||||||
title: getTitle(),
|
title: getTitle(),
|
||||||
themeMode: ThemeMode.dark,
|
themeMode: ThemeMode.dark,
|
||||||
theme: theme.getThemeData(),
|
theme: theme.getThemeData(),
|
||||||
darkTheme: theme.getThemeData(),
|
darkTheme: theme.getThemeData(),
|
||||||
debugShowCheckedModeBanner: false,
|
debugShowCheckedModeBanner: false,
|
||||||
initialRoute: '/',
|
routerConfig: MihGoRouter().mihRouter,
|
||||||
onGenerateRoute: RouteGenerator.generateRoute,
|
// initialRoute: '/',
|
||||||
|
// onGenerateRoute: RouteGenerator.generateRoute,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user