forked from yaso_meth/mih-project
change arges to cater for selected patient
This commit is contained in:
@@ -56,7 +56,12 @@ class _AddOrViewPatientState extends State<AddOrViewPatient> {
|
||||
if (snapshot.hasData) {
|
||||
// Extracting data from snapshot object
|
||||
//final data = snapshot.data as String;
|
||||
return PatientView(arguments: widget.arguments);
|
||||
return PatientView(
|
||||
arguments: PatientViewArguments(
|
||||
widget.arguments.signedInUser,
|
||||
snapshot.requireData,
|
||||
widget.arguments.type,
|
||||
));
|
||||
}
|
||||
}
|
||||
return AddPatient(signedInUser: widget.arguments.signedInUser);
|
||||
|
||||
@@ -104,8 +104,10 @@ class _HomeTileGridState extends State<HomeTileGrid> {
|
||||
Icons.medication,
|
||||
"Patient Profile",
|
||||
() {
|
||||
//comeback here
|
||||
Navigator.of(context).pushNamed('/patient-profile',
|
||||
arguments: PatientViewArguments(widget.signedInUser, "personal"));
|
||||
arguments:
|
||||
PatientViewArguments(widget.signedInUser, null, "personal"));
|
||||
// Navigator.popAndPushNamed(context, '/patient-manager',
|
||||
// arguments: widget.userEmail);
|
||||
}
|
||||
@@ -140,8 +142,8 @@ class _HomeTileGridState extends State<HomeTileGrid> {
|
||||
Icons.medication,
|
||||
"Manage Patient",
|
||||
() {
|
||||
Navigator.of(context).pushNamed('/patient-manager',
|
||||
arguments: widget.signedInUser.email);
|
||||
Navigator.of(context)
|
||||
.pushNamed('/patient-manager', arguments: widget.signedInUser);
|
||||
// Navigator.popAndPushNamed(context, '/patient-manager',
|
||||
// arguments: widget.userEmail);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import 'package:patient_manager/objects/appUser.dart';
|
||||
import 'package:patient_manager/objects/business.dart';
|
||||
import 'package:patient_manager/objects/businessUser.dart';
|
||||
import 'package:patient_manager/objects/patients.dart';
|
||||
|
||||
class BusinessUpdateArguments {
|
||||
final AppUser signedInUser;
|
||||
@@ -16,10 +17,12 @@ class BusinessUpdateArguments {
|
||||
|
||||
class PatientViewArguments {
|
||||
final AppUser signedInUser;
|
||||
final Patient? selectedPatient;
|
||||
final String type;
|
||||
|
||||
PatientViewArguments(
|
||||
this.signedInUser,
|
||||
this.selectedPatient,
|
||||
this.type,
|
||||
);
|
||||
}
|
||||
|
||||
@@ -38,11 +38,11 @@ class RouteGenerator {
|
||||
return _errorRoute();
|
||||
|
||||
case '/patient-manager':
|
||||
if (args is String) {
|
||||
if (args is AppUser) {
|
||||
//print("route generator: $args");
|
||||
return MaterialPageRoute(
|
||||
builder: (_) => PatientManager(
|
||||
userEmail: args,
|
||||
signedInUser: args,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user