forked from yaso_meth/mih-project
remove loading
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:go_router/go_router.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_layout/mih_print_prevew.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/app_user.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/arguments.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_package_components/Example/package_test.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_components/mih_pop_up_messages/mih_loading_circle.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/about_mih/about_mih.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/access_review/mih_access.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/calculator/mih_calculator.dart';
|
||||
@@ -24,6 +24,7 @@ import 'package:mzansi_innovation_hub/mih_packages/mzansi_wallet/components/mih_
|
||||
import 'package:mzansi_innovation_hub/mih_packages/mzansi_wallet/mih_wallet.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_manager/pat_manager.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_profile/add_or_view_patient.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_profile/components/full_screen_file.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_profile/patient_edit.dart';
|
||||
import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_profile/patient_profile.dart';
|
||||
import 'package:supertokens_flutter/supertokens.dart';
|
||||
@@ -37,8 +38,7 @@ class MihGoRouterPaths {
|
||||
// Internal
|
||||
// static const String authCheck = '/';
|
||||
static const String mihAuthentication = '/mih-authentication';
|
||||
static const String mihLoading = '/';
|
||||
static const String mihHome = '/mih-home';
|
||||
static const String mihHome = '/';
|
||||
static const String notifications = '/notifications';
|
||||
static const String forgotPassword = '/mih-authentication/forgot-password';
|
||||
static const String aboutMih = '/about';
|
||||
@@ -67,7 +67,7 @@ class MihGoRouterPaths {
|
||||
|
||||
class MihGoRouter {
|
||||
final GoRouter mihRouter = GoRouter(
|
||||
initialLocation: MihGoRouterPaths.mihLoading,
|
||||
initialLocation: MihGoRouterPaths.mihHome,
|
||||
redirect: (BuildContext context, GoRouterState state) async {
|
||||
final bool isUserSignedIn = await SuperTokens.doesSessionExist();
|
||||
final unauthenticatedPaths = [
|
||||
@@ -76,7 +76,6 @@ class MihGoRouter {
|
||||
MihGoRouterPaths.resetPassword,
|
||||
MihGoRouterPaths.aboutMih,
|
||||
MihGoRouterPaths.businessProfileView,
|
||||
MihGoRouterPaths.mihLoading,
|
||||
];
|
||||
KenLogger.success(
|
||||
"Redirect Check: ${state.fullPath}, isUserSignedIn: $isUserSignedIn");
|
||||
@@ -92,19 +91,6 @@ class MihGoRouter {
|
||||
return null; // Stay on current route
|
||||
},
|
||||
routes: [
|
||||
// ========================== MIH Loading ==================================
|
||||
GoRoute(
|
||||
name: "mihLoading",
|
||||
path: MihGoRouterPaths.mihLoading,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
KenLogger.success("MihGoRouter: mihAuthentication");
|
||||
return Scaffold(
|
||||
body: Center(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
// ========================== MIH Auth ==================================
|
||||
GoRoute(
|
||||
name: "mihAuthentication",
|
||||
@@ -457,6 +443,24 @@ class MihGoRouter {
|
||||
},
|
||||
),
|
||||
// ========================== End ==================================
|
||||
GoRoute(
|
||||
name: "fileViewer",
|
||||
path: MihGoRouterPaths.fileViewer,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
final FileViewArguments? args = state.extra as FileViewArguments?;
|
||||
return FullScreenFileViewer(arguments: args!);
|
||||
},
|
||||
),
|
||||
GoRoute(
|
||||
name: "printPreview",
|
||||
path: MihGoRouterPaths.printPreview,
|
||||
builder: (BuildContext context, GoRouterState state) {
|
||||
final PrintPreviewArguments? args =
|
||||
state.extra as PrintPreviewArguments?;
|
||||
return MIHPrintPreview(arguments: args!);
|
||||
},
|
||||
),
|
||||
// ========================== End ==================================
|
||||
// GoRoute(
|
||||
// name: "notifications",
|
||||
// path: MihGoRouterPaths.notifications,
|
||||
@@ -464,22 +468,6 @@ class MihGoRouter {
|
||||
// final NotificationArguments? args = state.extra as NotificationArguments?;
|
||||
// return MIHNotificationMessage(arguments: args!);
|
||||
// },
|
||||
// ),
|
||||
// GoRoute(
|
||||
// name: "fileViewer",
|
||||
// path: MihGoRouterPaths.fileViewer,
|
||||
// builder: (BuildContext context, GoRouterState state) {
|
||||
// final FileViewArguments? args = state.extra as FileViewArguments?;
|
||||
// return FullScreenFileViewer(arguments: args!);
|
||||
// },
|
||||
// ),
|
||||
// GoRoute(
|
||||
// name: "printPreview",
|
||||
// path: MihGoRouterPaths.printPreview,
|
||||
// builder: (BuildContext context, GoRouterState state) {
|
||||
// final PrintPreviewArguments? args = state.extra as PrintPreviewArguments?;
|
||||
// return MIHPrintPreview(arguments: args!);
|
||||
// },
|
||||
// ),
|
||||
],
|
||||
// 3. Error handling with `errorBuilder` and `redirect`
|
||||
|
||||
Reference in New Issue
Block a user