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

@@ -43,7 +43,7 @@ class _HomeTileGridState extends State<HomeTileGrid> {
tileList.add(HomeTile(
onTap: () {
Navigator.of(context)
.pushNamed('/profile', arguments: widget.signedInUser);
.pushNamed('/user-profile', arguments: widget.signedInUser);
// Navigator.of(context).pushNamedAndRemoveUntil(
// '/profile',
// (route) => false,
@@ -62,7 +62,7 @@ class _HomeTileGridState extends State<HomeTileGrid> {
tileList.add(HomeTile(
onTap: () {
Navigator.of(context).popAndPushNamed(
'/business/add',
'/business-profile/set-up',
arguments: widget.signedInUser,
);
// Navigator.of(context).pushNamedAndRemoveUntil(
@@ -104,7 +104,7 @@ class _HomeTileGridState extends State<HomeTileGrid> {
tileList.add(HomeTile(
onTap: () {
Navigator.of(context).pushNamed(
'/patient-access-review',
'/access-review',
arguments: widget.signedInUser,
);
// Navigator.of(context).pushNamedAndRemoveUntil(
@@ -196,7 +196,7 @@ class _HomeTileGridState extends State<HomeTileGrid> {
tileList.add(HomeTile(
onTap: () {
Navigator.of(context).pushNamed(
'/business/add',
'/business-profile/set-up',
arguments: widget.signedInUser,
);
// Navigator.of(context).pushNamedAndRemoveUntil(
@@ -212,7 +212,7 @@ class _HomeTileGridState extends State<HomeTileGrid> {
));
tileList.add(HomeTile(
onTap: () {
Navigator.of(context).pushNamed('/patient-manager/add',
Navigator.of(context).pushNamed('/patient-profile/set-up',
arguments: widget.signedInUser);
// Navigator.of(context).pushNamedAndRemoveUntil(
// '/patient-manager/add',
@@ -229,9 +229,8 @@ class _HomeTileGridState extends State<HomeTileGrid> {
onTap: () {
// Navigator.of(context)
// .popAndPushNamed('/profile', arguments: widget.signedInUser);
Navigator.of(context).pushNamedAndRemoveUntil(
'/profile',
(route) => false,
Navigator.of(context).pushNamed(
'/user-profile',
arguments: widget.signedInUser,
);
},

View File

@@ -139,7 +139,7 @@ class _MIHAppDrawerState extends State<MIHAppDrawer> {
),
onTap: () {
Navigator.of(context)
.pushNamedAndRemoveUntil('/home', (route) => false);
.pushNamedAndRemoveUntil('/', (route) => false);
},
),
ListTile(
@@ -166,7 +166,7 @@ class _MIHAppDrawerState extends State<MIHAppDrawer> {
onTap: () {
//signedInUser = snapshot.data!;
//print("MIHAppDrawer: ${signedInUser.runtimeType}");
Navigator.of(context).popAndPushNamed('/profile',
Navigator.of(context).popAndPushNamed('/user-profile',
arguments: widget.signedInUser);
},
),
@@ -219,7 +219,7 @@ class _MIHAppDrawerState extends State<MIHAppDrawer> {
MzanziInnovationHub.of(context)!.changeTheme(ThemeMode.dark);
//print("Dark Mode: $darkm");
}
Navigator.of(context).popAndPushNamed('/home');
Navigator.of(context).popAndPushNamed('/');
});
},
icon: Icon(

View File

@@ -1,13 +1,17 @@
import 'package:flutter/material.dart';
import 'package:patient_manager/components/inputsAndButtons/mihTextInput.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';
class PatientDetails extends StatefulWidget {
final AppUser signedInUser;
final Patient selectedPatient;
final String type;
const PatientDetails({
super.key,
required this.signedInUser,
required this.selectedPatient,
required this.type,
});
@@ -194,8 +198,9 @@ class _PatientDetailsState extends State<PatientDetails> {
alignment: Alignment.topRight,
color: MzanziInnovationHub.of(context)!.theme.secondaryColor(),
onPressed: () {
Navigator.of(context).pushNamed('/patient-manager/patient/edit',
arguments: widget.selectedPatient);
Navigator.of(context).pushNamed('/patient-profile/edit',
arguments: PatientEditArguments(
widget.signedInUser, widget.selectedPatient));
},
)
];