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