Major Change Inputs & Co
This commit is contained in:
@@ -9,6 +9,7 @@ import 'package:oc_front/core/sections/header/header.dart';
|
||||
import 'package:oc_front/core/sections/header/menu.dart';
|
||||
import 'package:oc_front/core/sections/left_menu.dart';
|
||||
import 'package:oc_front/core/services/auth.service.dart';
|
||||
import 'package:oc_front/core/services/enum_service.dart';
|
||||
import 'package:oc_front/core/services/router.dart';
|
||||
import 'package:oc_front/core/sections/end_drawer.dart';
|
||||
import 'package:oc_front/widgets/dialog/login.dart';
|
||||
@@ -27,6 +28,8 @@ class MyApp extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
AuthService.init();
|
||||
EnumService.init();
|
||||
SearchConstants.clear();
|
||||
return MaterialApp.router( routerConfig: GoRouter( routes: AppRouter.routes ) );
|
||||
}
|
||||
}
|
||||
@@ -68,7 +71,7 @@ double getMainHeight(BuildContext context) {
|
||||
double getMainWidth(BuildContext context) {
|
||||
return getWidth(context) - 50;
|
||||
}
|
||||
|
||||
bool loginIsSet = false;
|
||||
class MainPageState extends State<MainPage> {
|
||||
bool isCtrl = false;
|
||||
final FocusNode node = FocusNode();
|
||||
@@ -89,12 +92,12 @@ class MainPageState extends State<MainPage> {
|
||||
// than having to individually change instances of widgets.i
|
||||
scaffoldKey = GlobalKey<ScaffoldState>();
|
||||
isCtrl = false;
|
||||
if (!AuthService.isConnected()) {
|
||||
print("isConnected: ${AuthService.isConnected()}");
|
||||
if (!AuthService.isConnected() && !loginIsSet) {
|
||||
Future.delayed(const Duration(milliseconds: 500), () {
|
||||
loginIsSet = true;
|
||||
showDialog(
|
||||
barrierDismissible: false,
|
||||
context: context, builder: (context) {
|
||||
context: context ?? context, builder: (context) {
|
||||
return AlertDialog(
|
||||
insetPadding: EdgeInsets.zero,
|
||||
backgroundColor: Colors.white,
|
||||
@@ -105,9 +108,7 @@ class MainPageState extends State<MainPage> {
|
||||
}
|
||||
return FutureBuilder(future: AuthService.init(),
|
||||
builder: (e, s) {
|
||||
WorkspaceLocal.init(context, false);
|
||||
CollaborativeAreaLocal.init(context, false);
|
||||
|
||||
WorkspaceLocal.init(context, false);
|
||||
HeaderConstants.height = HeaderConstants.isNoHeader(AppRouter.currentRoute.route) || AppRouter.currentRoute.factory.searchFill() ? 50 : 100;
|
||||
return Scaffold( key: scaffoldKey, endDrawer: EndDrawerWidget(), body:
|
||||
SingleChildScrollView(
|
||||
|
||||
Reference in New Issue
Block a user