enable API call from patient manager
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/objects/patients.dart';
|
||||
|
||||
class BuildPatientsList extends StatefulWidget {
|
||||
final List<Patient> patients;
|
||||
const BuildPatientsList({
|
||||
super.key,
|
||||
required this.patients,
|
||||
});
|
||||
|
||||
@override
|
||||
State<BuildPatientsList> createState() => _BuildPatientsListState();
|
||||
}
|
||||
|
||||
class _BuildPatientsListState extends State<BuildPatientsList> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView.builder(
|
||||
itemCount: widget.patients.length,
|
||||
itemBuilder: (context, index) {
|
||||
final patient = widget.patients[index];
|
||||
return ListTile(
|
||||
title: Text(patient.first_name + " " + patient.last_name),
|
||||
subtitle: Text(patient.id_no),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -22,6 +22,12 @@ class _MyAppDrawerState extends State<MyAppDrawer> {
|
||||
color: Colors.blueAccent,
|
||||
),
|
||||
),
|
||||
ListTile(
|
||||
title: Text("Home"),
|
||||
onTap: () {
|
||||
Navigator.of(context).pushNamed('/home');
|
||||
},
|
||||
)
|
||||
],
|
||||
),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user