Patien View page added to display selected patient.

This commit is contained in:
2024-04-07 15:28:52 +02:00
parent 9c8406367e
commit d9e2afd571
5 changed files with 77 additions and 29 deletions

View File

@@ -48,14 +48,6 @@ class _PatientManagerState extends State<PatientManager> {
super.initState();
}
// void filterSearchResults(String query) {
// setState(() {
// futurePatients = futurePatientsList
// .where((item) => item.toLowerCase().contains(query.toLowerCase()))
// .toList();
// });
// }
@override
Widget build(BuildContext context) {
return Scaffold(
@@ -69,27 +61,33 @@ class _PatientManagerState extends State<PatientManager> {
} else if (snapshot.hasData) {
final patientsList = snapshot.data!;
return Column(children: [
//spacer
const SizedBox(height: 10),
MySearchField(
controller: searchController,
hintText: "ID Search",
onChanged: (value) {
setState(() {
searchString = value;
});
},
),
//spacer
const SizedBox(height: 10),
Expanded(
child: BuildPatientsList(
patients: patientsList,
searchString: searchString,
return Row(
children: [
Expanded(
child: Column(children: [
//spacer
const SizedBox(height: 10),
MySearchField(
controller: searchController,
hintText: "ID Search",
onChanged: (value) {
setState(() {
searchString = value;
});
},
),
//spacer
const SizedBox(height: 10),
Expanded(
child: BuildPatientsList(
patients: patientsList,
searchString: searchString,
),
),
]),
),
),
]);
],
);
} else {
return const MyAppDrawer(drawerTitle: "Error pulling email");
}

View File

@@ -0,0 +1,23 @@
import 'package:flutter/material.dart';
import 'package:patient_manager/components/myAppBar.dart';
import 'package:patient_manager/objects/patients.dart';
class PatientView extends StatefulWidget {
final Patient selectedPatient;
const PatientView({super.key, required this.selectedPatient});
@override
State<PatientView> createState() => _PatientViewState();
}
class _PatientViewState extends State<PatientView> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: const MyAppBar(barTitle: "Patient View"),
body: Center(
child: Text(widget.selectedPatient.first_name),
),
);
}
}