1) Update search field to cater for ontap of icon and required and editable parameters.
2) remove Unnesasay signed in user from widget, add menu height. 3) add medicine object to cater for results of med api call. 4) update search input to cater for new parameters. 5) create prescriotion popUp widget. 6) Create medicine search pop Up widget
This commit is contained in:
parent
3bacfe27ba
commit
b18f8dd1d0
34 changed files with 605 additions and 20 deletions
47
Frontend/patient_manager/lib/components/buildMedList.dart
Normal file
47
Frontend/patient_manager/lib/components/buildMedList.dart
Normal file
|
|
@ -0,0 +1,47 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:patient_manager/objects/medicine.dart';
|
||||
|
||||
class BuildMedicinesList extends StatefulWidget {
|
||||
final TextEditingController contoller;
|
||||
final List<Medicine> medicines;
|
||||
//final searchString;
|
||||
|
||||
const BuildMedicinesList({
|
||||
super.key,
|
||||
required this.contoller,
|
||||
required this.medicines,
|
||||
//required this.searchString,
|
||||
});
|
||||
|
||||
@override
|
||||
State<BuildMedicinesList> createState() => _BuildMedicinesListState();
|
||||
}
|
||||
|
||||
int indexOn = 0;
|
||||
|
||||
class _BuildMedicinesListState extends State<BuildMedicinesList> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ListView.separated(
|
||||
separatorBuilder: (BuildContext context, int index) {
|
||||
return const Divider();
|
||||
},
|
||||
itemCount: widget.medicines.length,
|
||||
itemBuilder: (context, index) {
|
||||
//final patient = widget.patients[index].id_no.contains(widget.searchString);
|
||||
return ListTile(
|
||||
title: Text(widget.medicines[index].name),
|
||||
subtitle: Text(
|
||||
"${widget.medicines[index].unit} - ${widget.medicines[index].form}"),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
widget.contoller.text = widget.medicines[index].name;
|
||||
Navigator.of(context).pop();
|
||||
});
|
||||
},
|
||||
trailing: const Icon(Icons.arrow_forward),
|
||||
);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue