pharmacy intervenention remarks added

master
parent c1f3506bae
commit 2e299e1016

@ -1254,5 +1254,13 @@ const Map<String, Map<String, String>> localizedValues = {
"youHavePendingInterventions": {"en": "You Have Pending Interventions. That need your attention", "ar":"لديك تدخلات معلقة. التي تحتاج إلى اهتمامك"},
"open": {"en": "Open", "ar":"يفتح"},
"chiefComplaintLengthErrorMsg":{"en": "The text is too short; minimum 26 characters required.", "ar":"النص قصير جدًا؛ الحد الأدنى المطلوب هو 26 حرفًا."},
"filterInPatient":{"en": "Select Dates", "ar":"حدد التواريخ."}
"filterInPatient":{"en": "Select Dates", "ar":"حدد التواريخ."},
"remarksNotAdded": {
"en": "Remarks Not Added",
"ar": "لم تتم إضافة ملاحظات"
},
"addDoctorRemarks": {
"en": " Doctor Remarks",
"ar": " ملاحظات الطبيب"
}
};

@ -54,8 +54,9 @@ class InterventionHistoryBottomSheet extends StatelessWidget {
color: Colors.white,
child: InterventionHistoryItem(
interventionHistory: interventionList[index],
onAcceptClick: (intervention) {
onAcceptClick: (intervention, remarks) {
model.updateInterventionDiseaseStatus(
remarks: remarks,
isAccepted: true,
interventionID: interventionList[index].interventionId.toString(),
successMessage: TranslationBase.of(context).interventionAcceptedSuccessfully,
@ -63,8 +64,9 @@ class InterventionHistoryBottomSheet extends StatelessWidget {
);
Navigator.pop(context);
},
onRejectClick: (intervention) {
onRejectClick: (intervention, remarks) {
model.updateInterventionDiseaseStatus(
remarks: remarks,
interventionID: interventionList[index].interventionId.toString(),
successMessage: TranslationBase.of(context).interventionRejectedSuccessfully,
errorMessage: TranslationBase.of(context).unableToPerformTheAction

@ -1,22 +1,26 @@
import 'package:doctor_app_flutter/config/config.dart';
import 'package:doctor_app_flutter/core/model/pharmacy-intervention-model/intervention_history.dart';
import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart';
import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart';
import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart';
import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart';
import 'package:flutter/material.dart';
class InterventionHistoryItem extends StatelessWidget {
final InterventionHistory interventionHistory;
final Function(InterventionHistory) onAcceptClick;
final Function(InterventionHistory, String) onAcceptClick;
// string is index here
final Function(InterventionHistory) onRejectClick;
final Function(InterventionHistory, String) onRejectClick;
final TextEditingController remarksController = TextEditingController();
const InterventionHistoryItem({
InterventionHistoryItem({
super.key,
required this.interventionHistory,
required this.onAcceptClick,
required this.onRejectClick,
});
@override
@ -56,6 +60,19 @@ class InterventionHistoryItem extends StatelessWidget {
color: Color(0xFF2B353E),
),
SizedBox(height: 8,),
AppTextFieldCustom(
hintText: TranslationBase.of(context).addDoctorRemarks,
controller: remarksController,
maxLines: 48,
minLines: 2,
hasBorder: true,
inputType: TextInputType.multiline,
onClick: () {},
onChanged: (value) {},
onFieldSubmitted: () {},
),
SizedBox(height: 16,),
Row(children: [
Expanded(
child: SizedBox(
@ -69,7 +86,11 @@ class InterventionHistoryItem extends StatelessWidget {
color: AppGlobal.appRedColor,
fontColor: Colors.white,
onPressed: () async {
onRejectClick(interventionHistory);
if(remarksController.text.isEmpty == true) {
DrAppToastMsg.showErrorToast(TranslationBase.of(context).remarksNotAdded);
return;
}
onRejectClick(interventionHistory, remarksController.text);
},
),
),
@ -89,7 +110,11 @@ class InterventionHistoryItem extends StatelessWidget {
color: AppGlobal.appGreenColor,
fontColor: Colors.white,
onPressed: () async {
onAcceptClick(interventionHistory);
if(remarksController.text.isEmpty == true) {
DrAppToastMsg.showErrorToast(TranslationBase.of(context).remarksNotAdded);
return;
}
onAcceptClick(interventionHistory,remarksController.text);
},
),
),

@ -1997,6 +1997,8 @@ class TranslationBase {
String get open => localizedValues['open']![locale.languageCode]!;
String get chiefComplaintLengthErrorMsg => localizedValues['chiefComplaintLengthErrorMsg']![locale.languageCode]!;
String get filterInPatient => localizedValues['filterInPatient']![locale.languageCode]!;
String get remarksNotAdded => localizedValues['remarksNotAdded']![locale.languageCode]!;
String get addDoctorRemarks => localizedValues['addDoctorRemarks']![locale.languageCode]!;
}
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

Loading…
Cancel
Save