|
|
|
@ -17,6 +17,7 @@ import 'add_medication.dart';
|
|
|
|
|
|
|
|
|
|
|
|
class UpdateMedicationWidget extends StatefulWidget {
|
|
|
|
class UpdateMedicationWidget extends StatefulWidget {
|
|
|
|
final PatiantInformtion patientInfo;
|
|
|
|
final PatiantInformtion patientInfo;
|
|
|
|
|
|
|
|
|
|
|
|
UpdateMedicationWidget({
|
|
|
|
UpdateMedicationWidget({
|
|
|
|
Key? key,
|
|
|
|
Key? key,
|
|
|
|
required this.patientInfo,
|
|
|
|
required this.patientInfo,
|
|
|
|
@ -33,27 +34,20 @@ class _UpdateMedicationWidgetState extends State<UpdateMedicationWidget> {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return BaseView<SOAPViewModel>(
|
|
|
|
return BaseView<SOAPViewModel>(
|
|
|
|
onModelReady: (model) async {
|
|
|
|
onModelReady: (model) async {
|
|
|
|
|
|
|
|
WidgetsBinding.instance.addPostFrameCallback((_) {
|
|
|
|
model.getHomeMedication(widget.patientInfo);
|
|
|
|
model.getHomeMedication(widget.patientInfo);
|
|
|
|
|
|
|
|
});
|
|
|
|
},
|
|
|
|
},
|
|
|
|
builder: (_, model, w) =>
|
|
|
|
builder: (_, model, w) => Column(children: [
|
|
|
|
Column(
|
|
|
|
|
|
|
|
children: [
|
|
|
|
|
|
|
|
AddSoapItem(
|
|
|
|
AddSoapItem(
|
|
|
|
title: "${TranslationBase
|
|
|
|
title: "${TranslationBase.of(context).addMedication}",
|
|
|
|
.of(context)
|
|
|
|
|
|
|
|
.addMedication}",
|
|
|
|
|
|
|
|
onAddSoapItemClicked: () {
|
|
|
|
onAddSoapItemClicked: () {
|
|
|
|
Navigator.push(
|
|
|
|
Navigator.push(
|
|
|
|
context,
|
|
|
|
context,
|
|
|
|
FadePage(
|
|
|
|
FadePage(
|
|
|
|
page: AddMedication(
|
|
|
|
page: AddMedication(
|
|
|
|
patientInfo: widget.patientInfo,
|
|
|
|
patientInfo: widget.patientInfo,
|
|
|
|
addMedicationFun:(){
|
|
|
|
addMedicationFun: () {})));
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
// openMedicationList(context);
|
|
|
|
// openMedicationList(context);
|
|
|
|
},
|
|
|
|
},
|
|
|
|
),
|
|
|
|
),
|
|
|
|
@ -75,14 +69,9 @@ class _UpdateMedicationWidgetState extends State<UpdateMedicationWidget> {
|
|
|
|
height: 18,
|
|
|
|
height: 18,
|
|
|
|
color: Color(0xffD02127),
|
|
|
|
color: Color(0xffD02127),
|
|
|
|
),
|
|
|
|
),
|
|
|
|
label: AppText(
|
|
|
|
label: AppText(TranslationBase.of(context).remove,
|
|
|
|
TranslationBase.of(context)
|
|
|
|
fontSize: 12, color: Color(0xffD02127))),
|
|
|
|
.remove,
|
|
|
|
title: AppText(
|
|
|
|
fontSize: 12,
|
|
|
|
|
|
|
|
color: Color(0xffD02127))),
|
|
|
|
|
|
|
|
title:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AppText(
|
|
|
|
|
|
|
|
medication.prescribedItemName!,
|
|
|
|
medication.prescribedItemName!,
|
|
|
|
fontSize: 12,
|
|
|
|
fontSize: 12,
|
|
|
|
fontWeight: FontWeight.w800,
|
|
|
|
fontWeight: FontWeight.w800,
|
|
|
|
@ -91,16 +80,14 @@ class _UpdateMedicationWidgetState extends State<UpdateMedicationWidget> {
|
|
|
|
subtitle: AppText(
|
|
|
|
subtitle: AppText(
|
|
|
|
'${medication.doseQuantity!} - ${medication.frequencyString!}',
|
|
|
|
'${medication.doseQuantity!} - ${medication.frequencyString!}',
|
|
|
|
fontSize: 10,
|
|
|
|
fontSize: 10,
|
|
|
|
|
|
|
|
|
|
|
|
),
|
|
|
|
),
|
|
|
|
);
|
|
|
|
);
|
|
|
|
}).toList()),
|
|
|
|
}).toList()),
|
|
|
|
|
|
|
|
]));
|
|
|
|
|
|
|
|
|
|
|
|
]
|
|
|
|
|
|
|
|
));
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
removeMedication(GetHomeMedicationList medication, SOAPViewModel model) async{
|
|
|
|
|
|
|
|
|
|
|
|
removeMedication(
|
|
|
|
|
|
|
|
GetHomeMedicationList medication, SOAPViewModel model) async {
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
GifLoaderDialogUtils.showMyDialog(context);
|
|
|
|
await model.removeCurrentMedication(medication.id!);
|
|
|
|
await model.removeCurrentMedication(medication.id!);
|
|
|
|
await model.getHomeMedication(widget.patientInfo);
|
|
|
|
await model.getHomeMedication(widget.patientInfo);
|
|
|
|
|