enable API call from patient manager

This commit is contained in:
2024-04-07 12:12:01 +02:00
parent 3baf507414
commit 790766fc99
5 changed files with 182 additions and 18 deletions

View File

@@ -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),
);
},
);
}
}

View File

@@ -22,6 +22,12 @@ class _MyAppDrawerState extends State<MyAppDrawer> {
color: Colors.blueAccent,
),
),
ListTile(
title: Text("Home"),
onTap: () {
Navigator.of(context).pushNamed('/home');
},
)
],
),
);