fix internal and external links
This commit is contained in:
@@ -6,6 +6,7 @@ import 'package:patient_manager/objects/arguments.dart';
|
|||||||
import 'package:patient_manager/pages/authentication/forgotPassword.dart';
|
import 'package:patient_manager/pages/authentication/forgotPassword.dart';
|
||||||
import 'package:patient_manager/pages/authentication/resetPassword.dart';
|
import 'package:patient_manager/pages/authentication/resetPassword.dart';
|
||||||
import 'package:patient_manager/pages/fullScreenFile.dart';
|
import 'package:patient_manager/pages/fullScreenFile.dart';
|
||||||
|
import 'package:patient_manager/pages/manageBusinessProfile.dart';
|
||||||
import 'package:patient_manager/pages/patientAccessReview.dart';
|
import 'package:patient_manager/pages/patientAccessReview.dart';
|
||||||
import 'package:patient_manager/pages/patientAdd.dart';
|
import 'package:patient_manager/pages/patientAdd.dart';
|
||||||
import 'package:patient_manager/pages/patientEdit.dart';
|
import 'package:patient_manager/pages/patientEdit.dart';
|
||||||
@@ -19,8 +20,9 @@ class RouteGenerator {
|
|||||||
static Route<dynamic> generateRoute(RouteSettings settings) {
|
static Route<dynamic> generateRoute(RouteSettings settings) {
|
||||||
final args = settings.arguments;
|
final args = settings.arguments;
|
||||||
var extPath = Uri.base.path;
|
var extPath = Uri.base.path;
|
||||||
|
// print(extPath);
|
||||||
|
// print(settings.name);
|
||||||
// External Links Navigation
|
// External Links Navigation
|
||||||
if (settings.name! == Uri.base.path && Uri.base.path != "/") {
|
|
||||||
switch (extPath) {
|
switch (extPath) {
|
||||||
case '/auth/reset-password':
|
case '/auth/reset-password':
|
||||||
return MaterialPageRoute(
|
return MaterialPageRoute(
|
||||||
@@ -29,11 +31,7 @@ class RouteGenerator {
|
|||||||
token: Uri.base.queryParameters['token'],
|
token: Uri.base.queryParameters['token'],
|
||||||
));
|
));
|
||||||
default:
|
default:
|
||||||
return _errorRoute();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// Internal Navigation
|
// Internal Navigation
|
||||||
else {
|
|
||||||
switch (settings.name) {
|
switch (settings.name) {
|
||||||
// Authgentication
|
// Authgentication
|
||||||
case '/':
|
case '/':
|
||||||
@@ -80,6 +78,16 @@ class RouteGenerator {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
return _errorRoute();
|
return _errorRoute();
|
||||||
|
case '/business-profile/manage':
|
||||||
|
if (args is BusinessArguments) {
|
||||||
|
return MaterialPageRoute(
|
||||||
|
settings: settings,
|
||||||
|
builder: (_) => ManageBusinessProfile(
|
||||||
|
arguments: args,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return _errorRoute();
|
||||||
//===============================================================
|
//===============================================================
|
||||||
|
|
||||||
// Patient Profile Pages
|
// Patient Profile Pages
|
||||||
@@ -174,6 +182,7 @@ class RouteGenerator {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Route<dynamic> _errorRoute() {
|
Route<dynamic> _errorRoute() {
|
||||||
|
print("error");
|
||||||
return MaterialPageRoute(
|
return MaterialPageRoute(
|
||||||
settings: const RouteSettings(name: '/'),
|
settings: const RouteSettings(name: '/'),
|
||||||
builder: (_) => const AuthCheck());
|
builder: (_) => const AuthCheck());
|
||||||
|
|||||||
Reference in New Issue
Block a user