remove loading
This commit is contained in:
@@ -1,9 +1,9 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:go_router/go_router.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/app_user.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_components/mih_objects/arguments.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_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/about_mih/about_mih.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_packages/access_review/mih_access.dart';
|
import 'package:mzansi_innovation_hub/mih_packages/access_review/mih_access.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_packages/calculator/mih_calculator.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/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_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/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_edit.dart';
|
||||||
import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_profile/patient_profile.dart';
|
import 'package:mzansi_innovation_hub/mih_packages/patient_profile/pat_profile/patient_profile.dart';
|
||||||
import 'package:supertokens_flutter/supertokens.dart';
|
import 'package:supertokens_flutter/supertokens.dart';
|
||||||
@@ -37,8 +38,7 @@ class MihGoRouterPaths {
|
|||||||
// Internal
|
// Internal
|
||||||
// static const String authCheck = '/';
|
// static const String authCheck = '/';
|
||||||
static const String mihAuthentication = '/mih-authentication';
|
static const String mihAuthentication = '/mih-authentication';
|
||||||
static const String mihLoading = '/';
|
static const String mihHome = '/';
|
||||||
static const String mihHome = '/mih-home';
|
|
||||||
static const String notifications = '/notifications';
|
static const String notifications = '/notifications';
|
||||||
static const String forgotPassword = '/mih-authentication/forgot-password';
|
static const String forgotPassword = '/mih-authentication/forgot-password';
|
||||||
static const String aboutMih = '/about';
|
static const String aboutMih = '/about';
|
||||||
@@ -67,7 +67,7 @@ class MihGoRouterPaths {
|
|||||||
|
|
||||||
class MihGoRouter {
|
class MihGoRouter {
|
||||||
final GoRouter mihRouter = GoRouter(
|
final GoRouter mihRouter = GoRouter(
|
||||||
initialLocation: MihGoRouterPaths.mihLoading,
|
initialLocation: MihGoRouterPaths.mihHome,
|
||||||
redirect: (BuildContext context, GoRouterState state) async {
|
redirect: (BuildContext context, GoRouterState state) async {
|
||||||
final bool isUserSignedIn = await SuperTokens.doesSessionExist();
|
final bool isUserSignedIn = await SuperTokens.doesSessionExist();
|
||||||
final unauthenticatedPaths = [
|
final unauthenticatedPaths = [
|
||||||
@@ -76,7 +76,6 @@ class MihGoRouter {
|
|||||||
MihGoRouterPaths.resetPassword,
|
MihGoRouterPaths.resetPassword,
|
||||||
MihGoRouterPaths.aboutMih,
|
MihGoRouterPaths.aboutMih,
|
||||||
MihGoRouterPaths.businessProfileView,
|
MihGoRouterPaths.businessProfileView,
|
||||||
MihGoRouterPaths.mihLoading,
|
|
||||||
];
|
];
|
||||||
KenLogger.success(
|
KenLogger.success(
|
||||||
"Redirect Check: ${state.fullPath}, isUserSignedIn: $isUserSignedIn");
|
"Redirect Check: ${state.fullPath}, isUserSignedIn: $isUserSignedIn");
|
||||||
@@ -92,19 +91,6 @@ class MihGoRouter {
|
|||||||
return null; // Stay on current route
|
return null; // Stay on current route
|
||||||
},
|
},
|
||||||
routes: [
|
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 ==================================
|
// ========================== MIH Auth ==================================
|
||||||
GoRoute(
|
GoRoute(
|
||||||
name: "mihAuthentication",
|
name: "mihAuthentication",
|
||||||
@@ -457,6 +443,24 @@ class MihGoRouter {
|
|||||||
},
|
},
|
||||||
),
|
),
|
||||||
// ========================== End ==================================
|
// ========================== 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(
|
// GoRoute(
|
||||||
// name: "notifications",
|
// name: "notifications",
|
||||||
// path: MihGoRouterPaths.notifications,
|
// path: MihGoRouterPaths.notifications,
|
||||||
@@ -464,22 +468,6 @@ class MihGoRouter {
|
|||||||
// final NotificationArguments? args = state.extra as NotificationArguments?;
|
// final NotificationArguments? args = state.extra as NotificationArguments?;
|
||||||
// return MIHNotificationMessage(arguments: args!);
|
// 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`
|
// 3. Error handling with `errorBuilder` and `redirect`
|
||||||
|
|||||||
Reference in New Issue
Block a user