WD: Flutter errors removed and parent widget issue resolved

update_flutter_3.24_vida_plus_episode_MDS
taha.alam 11 months ago
parent 48f67dc532
commit 5da6083c91

@ -113,35 +113,33 @@ class _EnterDiagnosisState extends State<EnterDiagnosis> {
}, },
), ),
), ),
Positioned( Material(
child: Material( elevation: 4.0, // Optional: for shadow effect
elevation: 4.0, // Optional: for shadow effect child: ConstrainedBox(
child: ConstrainedBox( constraints: BoxConstraints(minHeight: 0, maxHeight: 300),
constraints: BoxConstraints(minHeight: 0, maxHeight: 300), child: ListView.builder(
child: ListView.builder( shrinkWrap: true,
shrinkWrap: true, itemCount: model.icdVersionList.length,
itemCount: model.icdVersionList.length, itemBuilder: (context, index) {
itemBuilder: (context, index) { return ListTile(
return ListTile( title: InkWell(
title: InkWell( child: AppText(model.icdVersionList[index]),
child: AppText(model.icdVersionList[index]), onTap: () {
onTap: () { setState(
setState( () {
() { selectedDiagnosis =
selectedDiagnosis = model.findTheDiagnosisItem(
model.findTheDiagnosisItem( model.icdVersionList[index]);
model.icdVersionList[index]); filteredSearchController.text =
filteredSearchController.text = model.icdVersionList[index];
model.icdVersionList[index]; model.searchDiagnosisList.clear();
model.searchDiagnosisList.clear(); model.icdVersionList.clear();
model.icdVersionList.clear(); },
}, );
); },
}, ),
), );
); },
},
),
), ),
), ),
), ),

@ -104,7 +104,8 @@ class _AddChiefComplaintState extends State<AddChiefComplaint> {
}); });
} }
episodeByChiefComplaint(SOAPViewModel model) async{ episodeByChiefComplaint(SOAPViewModel model) async{
await model.episodeByChiefComplaint(widget.patientInfo); WidgetsBinding.instance.addPostFrameCallback((_) async{
await model.episodeByChiefComplaint(widget.patientInfo);});
} }
createCCByEpisode(model, List<PatientPomrs> chiefComplaint) async{ createCCByEpisode(model, List<PatientPomrs> chiefComplaint) async{

@ -281,8 +281,9 @@ class _ComplaintSelectionState extends State<ComplaintSelection> {
),) ),)
],), ],),
Stack(children: [ Padding(
Positioned(child:Material( padding: const EdgeInsets.all(8.0),
child: Material(
elevation: 4.0, // Optional: for shadow effect elevation: 4.0, // Optional: for shadow effect
child: child:
ConstrainedBox( ConstrainedBox(
@ -304,7 +305,8 @@ class _ComplaintSelectionState extends State<ComplaintSelection> {
widget.onSave!(cc!); widget.onSave!(cc!);
searchController.text =''; searchController.text ='';
})); }));
}))))]), }))),
),
SizedBox( SizedBox(
height: 43, height: 43,

@ -44,19 +44,14 @@ class _ComplaintItemsState extends State<ComplaintItems> {
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
widget.isDeletable ? Positioned( widget.isDeletable ? InkWell(
top:0, onTap: () {
bottom: 0, widget.onCrossClicked(widget.complaint);
right: 10, },
child: InkWell( child: Icon(
onTap: () { Icons.close,
widget.onCrossClicked(widget.complaint); size: 18,
}, color: Color(0xFFD02127),
child: Icon(
Icons.close,
size: 18,
color: Color(0xFFD02127),
),
), ),
) :SizedBox() ) :SizedBox()
],), ],),

@ -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,77 +34,63 @@ 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 {
model.getHomeMedication(widget.patientInfo); WidgetsBinding.instance.addPostFrameCallback((_) {
model.getHomeMedication(widget.patientInfo);
});
}, },
builder: (_, model, w) => builder: (_, model, w) => Column(children: [
Column( AddSoapItem(
children: [ title: "${TranslationBase.of(context).addMedication}",
AddSoapItem( onAddSoapItemClicked: () {
title: "${TranslationBase Navigator.push(
.of(context) context,
.addMedication}", FadePage(
onAddSoapItemClicked: () { page: AddMedication(
Navigator.push( patientInfo: widget.patientInfo,
context, addMedicationFun: () {})));
FadePage( // openMedicationList(context);
page: AddMedication( },
patientInfo: widget.patientInfo, ),
addMedicationFun:(){ SizedBox(
height: 20,
} ),
) ListView(
padding: EdgeInsets.all(10),
)); shrinkWrap: true,
// openMedicationList(context); physics: NeverScrollableScrollPhysics(),
}, children: model.getHomeMedicationList!.map((medication) {
), return ListTile(
SizedBox( trailing: TextButton.icon(
height: 20, onPressed: () {
), removeMedication(medication, model);
ListView( },
padding: EdgeInsets.all(10), icon: SvgPicture.asset(
shrinkWrap: true, "assets/images/svgs/delete.svg",
physics: NeverScrollableScrollPhysics(), height: 18,
children: model.getHomeMedicationList!.map((medication) { color: Color(0xffD02127),
return ListTile(
trailing: TextButton.icon(
onPressed: () {
removeMedication(medication, model);
},
icon: SvgPicture.asset(
"assets/images/svgs/delete.svg",
height: 18,
color: Color(0xffD02127),
),
label: AppText(
TranslationBase.of(context)
.remove,
fontSize: 12,
color: Color(0xffD02127))),
title:
AppText(
medication.prescribedItemName!,
fontSize: 12,
fontWeight: FontWeight.w800,
letterSpacing: -0.48,
),
subtitle: AppText(
'${medication.doseQuantity!} - ${ medication.frequencyString!}',
fontSize: 10,
), ),
); label: AppText(TranslationBase.of(context).remove,
}).toList()), fontSize: 12, color: Color(0xffD02127))),
title: AppText(
medication.prescribedItemName!,
] fontSize: 12,
)); fontWeight: FontWeight.w800,
letterSpacing: -0.48,
),
subtitle: AppText(
'${medication.doseQuantity!} - ${medication.frequencyString!}',
fontSize: 10,
),
);
}).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);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
} }
} }

Loading…
Cancel
Save