have path route show up in url bar & change routes to make logical sense

This commit is contained in:
2024-08-27 14:55:35 +02:00
parent c779568d24
commit 86e6aa005a
13 changed files with 158 additions and 108 deletions

View File

@@ -10,16 +10,19 @@ import 'package:patient_manager/components/inputsAndButtons/mihTextInput.dart';
import 'package:patient_manager/components/inputsAndButtons/mihButton.dart';
import 'package:patient_manager/env/env.dart';
import 'package:patient_manager/main.dart';
import 'package:patient_manager/objects/appUser.dart';
import 'package:patient_manager/objects/arguments.dart';
import 'package:patient_manager/objects/patients.dart';
import 'package:supertokens_flutter/supertokens.dart';
import 'package:supertokens_flutter/http.dart' as http;
class EditPatient extends StatefulWidget {
final Patient selectedPatient;
final AppUser signedInUser;
const EditPatient({
super.key,
required this.selectedPatient,
required this.signedInUser,
});
@override
@@ -101,7 +104,12 @@ class _EditPatientState extends State<EditPatient> {
// print("Here4");
// print(response.statusCode);
if (response.statusCode == 200) {
Navigator.of(context).pushNamed('/home');
Navigator.of(context).pop();
Navigator.of(context).pop();
Navigator.of(context).pushNamed('/patient-profile',
arguments: PatientViewArguments(
widget.signedInUser, null, null, null, "personal"));
//Navigator.of(context).pushNamed('/');
String message =
"${fnameController.text} ${lnameController.text}'s information has been updated successfully! Their medical records and details are now current.";
successPopUp(message);
@@ -130,7 +138,11 @@ class _EditPatientState extends State<EditPatient> {
//print("Here4");
//print(response.statusCode);
if (response.statusCode == 200) {
Navigator.of(context).pushNamed('/home');
Navigator.of(context).pop();
Navigator.of(context).pop();
Navigator.of(context).popAndPushNamed('/patient-profile',
arguments: PatientViewArguments(
widget.signedInUser, null, null, null, "personal"));
String message =
"${fnameController.text} ${lnameController.text}'s record has been deleted successfully. This means it will no longer be visible in patient manager and cannot be used for future appointments.";
successPopUp(message);

View File

@@ -60,6 +60,7 @@ class _PatientViewState extends State<PatientView> {
Widget showSelection(int index) {
if (index == 0) {
return PatientDetails(
signedInUser: widget.arguments.signedInUser,
selectedPatient: widget.arguments.selectedPatient!,
type: widget.arguments.type,
);

View File

@@ -38,6 +38,7 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
final nameController = TextEditingController();
final typeController = TextEditingController();
final regController = TextEditingController();
final addressController = TextEditingController();
final logonameController = TextEditingController();
final fnameController = TextEditingController();
final lnameController = TextEditingController();
@@ -87,7 +88,7 @@ class _ProfileBusinessAddState extends State<ProfileBusinessAdd> {
);
if (response.statusCode == 201) {
uploadSelectedFile(selectedSignature, signtureController);
Navigator.of(context).pushNamed('/home');
Navigator.of(context).pushNamed('/');
String message =
"Your business profile is now live! You can now start connecting with customers and growing your business.";
successPopUp(message);

View File

@@ -149,7 +149,7 @@ class _ProfileBusinessUpdateState extends State<ProfileBusinessUpdate> {
deleteFileApiCall(oldSigPath);
}
Navigator.of(context).pushNamed('/home');
Navigator.of(context).pushNamed('/');
String message =
"Your business profile is now live! You can now start connecting with customers and growing your business.";
successPopUp(message);