From 5a421847163ddaa7e23bffbdc4e7cbc9cf0816d4 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Mon, 3 May 2021 21:04:06 +0300 Subject: [PATCH 1/5] voice commad updated --- lib/config/localized_values.dart | 11 +- .../patients/profile/note/update_note.dart | 213 ++++++++++-------- .../referral/AddReplayOnReferralPatient.dart | 84 ++++--- .../refer-patient-screen-in-patient.dart | 167 ++++++++------ lib/util/translations_delegate_base.dart | 41 ++-- 5 files changed, 299 insertions(+), 217 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index d8427557..a5398db9 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -946,8 +946,14 @@ const Map> localizedValues = { "approvals22": {"en": "Approvals", "ar": "التامين"}, "severe": {"en": "Severe", "ar": "الشدة"}, "graphDetails": {"en": "Graph Details", "ar": "تفاصيل الرسم البياني"}, - "addNewOrderSheet": {"en": "Add a New Order Sheet", "ar": "أضف ورقة طلب جديدة"}, - "addNewProgressNote": {"en": "Add a New Progress Note", "ar": "أضف ملاحظة تقدم جديدة"}, + "addNewOrderSheet": { + "en": "Add a New Order Sheet", + "ar": "أضف ورقة طلب جديدة" + }, + "addNewProgressNote": { + "en": "Add a New Progress Note", + "ar": "أضف ملاحظة تقدم جديدة" + }, "notePending": {"en": "Pending", "ar": "قيد الانتظار"}, "noteCanceled": {"en": "Canceled", "ar": "ألغيت"}, "noteVerified": {"en": "Verified", "ar": "تم التحقق"}, @@ -964,4 +970,5 @@ const Map> localizedValues = { "discharged": {"en": "Discharged", "ar": "المفرغين"}, "none": {"en": "None", "ar": "لا شيء"}, "notRepliedYet": {"en": "Not Replied yet", "ar": "لم يرد بعد"}, + "clearText": {"en": "Clear Text", "ar": "نص واضح"}, }; diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/note/update_note.dart index 673a6e2b..b2e36d8f 100644 --- a/lib/screens/patients/profile/note/update_note.dart +++ b/lib/screens/patients/profile/note/update_note.dart @@ -97,10 +97,14 @@ class _UpdateNoteOrderState extends State { children: [ BottomSheetTitle( title: widget.visitType == 3 - ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).orderSheet - : (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, + ? (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).progressNote, ), SizedBox( height: 10.0, @@ -114,10 +118,18 @@ class _UpdateNoteOrderState extends State { children: [ AppTextFieldCustom( hintText: widget.visitType == 3 - ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).orderSheet - : (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, + ? (widget.isUpdate + ? TranslationBase.of(context) + .noteUpdate + : TranslationBase.of(context) + .noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate + ? TranslationBase.of(context) + .noteUpdate + : TranslationBase.of(context) + .noteAdd) + + TranslationBase.of(context).progressNote, //TranslationBase.of(context).addProgressNote, controller: progressNoteController, maxLines: 35, @@ -132,19 +144,23 @@ class _UpdateNoteOrderState extends State { : null, ), Positioned( - top: -2, //MediaQuery.of(context).size.height * 0, - right: projectViewModel.isArabic? MediaQuery.of(context).size.width * 0.75 : 15, - child: IconButton( - icon: Icon( - DoctorApp.speechtotext, - color: Colors.black, - ), - onPressed: () { - initSpeechState() - .then((value) => {onVoiceText()}); - }, - ), - ) + top: + -2, //MediaQuery.of(context).size.height * 0, + right: projectViewModel.isArabic + ? MediaQuery.of(context).size.width * 0.75 + : 15, + child: Column( + children: [ + IconButton( + icon: Icon(DoctorApp.speechtotext, + color: Colors.black, size: 35), + onPressed: () { + initSpeechState() + .then((value) => {onVoiceText()}); + }, + ), + ], + )) ], ), ], @@ -161,77 +177,98 @@ class _UpdateNoteOrderState extends State { child: Wrap( alignment: WrapAlignment.center, children: [ - AppButton( - title: widget.visitType == 3 - ? (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).orderSheet - : (widget.isUpdate ? TranslationBase.of(context).noteUpdate : TranslationBase.of(context).noteAdd) + - TranslationBase.of(context).progressNote, - color: Color(0xff359846), - // disabled: progressNoteController.text.isEmpty, - fontWeight: FontWeight.w700, - onPressed: () async { - setState(() { - isSubmitted = true; - }); - if (progressNoteController.text.trim().isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); - Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - - DoctorProfileModel doctorProfile = - DoctorProfileModel.fromJson(profile); - - if (widget.isUpdate) { - UpdateNoteReqModel reqModel = UpdateNoteReqModel( - admissionNo: int.parse(widget.patient.admissionNo), - cancelledNote: false, - lineItemNo: widget.note.lineItemNo, - createdBy: widget.note.createdBy, - notes: progressNoteController.text, - verifiedNote: false, - patientTypeID: widget.patient.patientType, - patientOutSA: false, - ); - await widget.patientModel - .updatePatientProgressNote(reqModel); - } else { - CreateNoteModel reqModel = CreateNoteModel( - admissionNo: int.parse(widget.patient.admissionNo), - createdBy: doctorProfile.doctorID, - visitType: widget.visitType, - patientID: widget.patient.patientId, - nursingRemarks: ' ', - patientTypeID: widget.patient.patientType, - patientOutSA: false, - notes: progressNoteController.text); + progressNoteController.text.isEmpty + ? SizedBox() + : Container( + margin: EdgeInsets.all(5), + child: Expanded( + child: AppButton( + title: TranslationBase.of(context).clearText, + onPressed: () { + setState(() { + progressNoteController.text = ''; + }); + }, + )), + ), + Container( + margin: EdgeInsets.all(5), + child: AppButton( + title: widget.visitType == 3 + ? (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).orderSheet + : (widget.isUpdate + ? TranslationBase.of(context).noteUpdate + : TranslationBase.of(context).noteAdd) + + TranslationBase.of(context).progressNote, + color: Color(0xff359846), + // disabled: progressNoteController.text.isEmpty, + fontWeight: FontWeight.w700, + onPressed: () async { + setState(() { + isSubmitted = true; + }); + if (progressNoteController.text.trim().isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - await widget.patientModel - .createPatientProgressNote(reqModel); - } + DoctorProfileModel doctorProfile = + DoctorProfileModel.fromJson(profile); - if (widget.patientModel.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(widget.patientModel.error); - } else { - ProgressNoteRequest progressNoteRequest = - ProgressNoteRequest( - visitType: widget.visitType, - // if equal 5 then this will return progress note + if (widget.isUpdate) { + UpdateNoteReqModel reqModel = UpdateNoteReqModel( + admissionNo: int.parse(widget.patient.admissionNo), + cancelledNote: false, + lineItemNo: widget.note.lineItemNo, + createdBy: widget.note.createdBy, + notes: progressNoteController.text, + verifiedNote: false, + patientTypeID: widget.patient.patientType, + patientOutSA: false, + ); + await widget.patientModel + .updatePatientProgressNote(reqModel); + } else { + CreateNoteModel reqModel = CreateNoteModel( admissionNo: int.parse(widget.patient.admissionNo), - projectID: widget.patient.projectId, + createdBy: doctorProfile.doctorID, + visitType: widget.visitType, + patientID: widget.patient.patientId, + nursingRemarks: ' ', patientTypeID: widget.patient.patientType, - languageID: 2); - await widget.patientModel - .getPatientProgressNote(progressNoteRequest.toJson()); - } - GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showSuccesToast( - "Your Order added Successfully"); - Navigator.of(context).pop(); - } else { - Helpers.showErrorToast("You cant add only spaces"); - } - }), + patientOutSA: false, + notes: progressNoteController.text); + + await widget.patientModel + .createPatientProgressNote(reqModel); + } + + if (widget.patientModel.state == ViewState.ErrorLocal) { + Helpers.showErrorToast(widget.patientModel.error); + } else { + ProgressNoteRequest progressNoteRequest = + ProgressNoteRequest( + visitType: widget.visitType, + // if equal 5 then this will return progress note + admissionNo: + int.parse(widget.patient.admissionNo), + projectID: widget.patient.projectId, + patientTypeID: widget.patient.patientType, + languageID: 2); + await widget.patientModel.getPatientProgressNote( + progressNoteRequest.toJson()); + } + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast( + "Your Order added Successfully"); + Navigator.of(context).pop(); + } else { + Helpers.showErrorToast("You cant add only spaces"); + } + })), ], ), ), @@ -278,7 +315,7 @@ class _UpdateNoteOrderState extends State { setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - progressNoteController.text = reconizedWord; + progressNoteController.text += reconizedWord + '\n'; }); } else { print(result.finalResult); diff --git a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart index fd5ec6bb..06f426d1 100644 --- a/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart +++ b/lib/screens/patients/profile/referral/AddReplayOnReferralPatient.dart @@ -19,7 +19,6 @@ import 'package:permission_handler/permission_handler.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; - class AddReplayOnReferralPatient extends StatefulWidget { final PatientReferralViewModel patientReferralViewModel; final MyReferralPatientModel myReferralInPatientModel; @@ -33,8 +32,8 @@ class AddReplayOnReferralPatient extends StatefulWidget { _AddReplayOnReferralPatientState(); } -class _AddReplayOnReferralPatientState extends State { - +class _AddReplayOnReferralPatientState + extends State { bool isSubmitted = false; stt.SpeechToText speech = stt.SpeechToText(); var reconizedWord; @@ -46,7 +45,6 @@ class _AddReplayOnReferralPatientState extends State super.initState(); } - @override Widget build(BuildContext context) { return AppScaffold( @@ -84,12 +82,13 @@ class _AddReplayOnReferralPatientState extends State : null, ), Positioned( - top: 0,//MediaQuery.of(context).size.height * 0, + top: 0, //MediaQuery.of(context).size.height * 0, right: 15, child: IconButton( icon: Icon( DoctorApp.speechtotext, color: Colors.black, + size: 35, ), onPressed: () { onVoiceText(); @@ -112,32 +111,53 @@ class _AddReplayOnReferralPatientState extends State child: Wrap( alignment: WrapAlignment.center, children: [ - AppButton( - title: 'Submit Replay', - color: Color(0xff359846), - fontWeight: FontWeight.w700, - onPressed: () async { - setState(() { - isSubmitted = true; - }); - if (progressNoteController.text.isNotEmpty) { - GifLoaderDialogUtils.showMyDialog(context); - await widget.patientReferralViewModel.replay(progressNoteController.text.trim(), widget.myReferralInPatientModel); - if (widget.patientReferralViewModel.state == ViewState.ErrorLocal) { - Helpers.showErrorToast(widget.patientReferralViewModel.error); - } else { - GifLoaderDialogUtils.hideDialog(context); - DrAppToastMsg.showSuccesToast("Your Replay Added Successfully"); - Navigator.of(context).pop(); - Navigator.of(context).pop(); - } - }else { - Helpers.showErrorToast("You can't add empty replay"); - setState(() { - isSubmitted = false; - }); - } - }), + progressNoteController.text.isEmpty + ? SizedBox() + : Container( + margin: EdgeInsets.all(5), + child: Expanded( + child: AppButton( + title: TranslationBase.of(context).clearText, + onPressed: () { + setState(() { + progressNoteController.text = ''; + }); + }, + )), + ), + Container( + margin: EdgeInsets.all(5), + child: AppButton( + title: 'Submit Replay', + color: Color(0xff359846), + fontWeight: FontWeight.w700, + onPressed: () async { + setState(() { + isSubmitted = true; + }); + if (progressNoteController.text.isNotEmpty) { + GifLoaderDialogUtils.showMyDialog(context); + await widget.patientReferralViewModel.replay( + progressNoteController.text.trim(), + widget.myReferralInPatientModel); + if (widget.patientReferralViewModel.state == + ViewState.ErrorLocal) { + Helpers.showErrorToast( + widget.patientReferralViewModel.error); + } else { + GifLoaderDialogUtils.hideDialog(context); + DrAppToastMsg.showSuccesToast( + "Your Replay Added Successfully"); + Navigator.of(context).pop(); + Navigator.of(context).pop(); + } + } else { + Helpers.showErrorToast("You can't add empty replay"); + setState(() { + isSubmitted = false; + }); + } + })), ], ), ), @@ -179,7 +199,7 @@ class _AddReplayOnReferralPatientState extends State if (result.finalResult == true) { setState(() { SpeechToText.closeAlertDialog(context); - progressNoteController.text = reconizedWord; + progressNoteController.text += reconizedWord + '\n'; }); } } diff --git a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart index 38182570..cc491cf2 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen-in-patient.dart @@ -22,6 +22,7 @@ import 'package:intl/intl.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_to_text.dart' as stt; + class PatientMakeInPatientReferralScreen extends StatefulWidget { @override _PatientMakeInPatientReferralScreenState createState() => @@ -104,7 +105,7 @@ class _PatientMakeInPatientReferralScreenState setState(() { SpeechToText.closeAlertDialog(context); speech.stop(); - _remarksController.text = reconizedWord; + _remarksController.text += reconizedWord + '\n'; }); } else { print(result.finalResult); @@ -140,13 +141,17 @@ class _PatientMakeInPatientReferralScreenState final screenSize = MediaQuery.of(context).size; return BaseView( - onModelReady: (model) => model.getReferralFrequencyList(), + onModelReady: (model) => model.getReferralFrequencyList(), builder: (_, model, w) => AppScaffold( baseViewModel: model, appBarTitle: TranslationBase.of(context).referPatient, isShowAppBar: true, appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType,isInpatient: isInpatient,), + patient, + patientType, + arrivalType, + isInpatient: isInpatient, + ), body: SingleChildScrollView( child: Container( child: Column( @@ -466,19 +471,21 @@ class _PatientMakeInPatientReferralScreenState Stack( children: [ AppTextFieldCustom( - hintText:"Remarks", + hintText: "Remarks", controller: _remarksController, inputType: TextInputType.multiline, minLines: 4, maxLines: 6, ), Positioned( - top: 0, //MediaQuery.of(context).size.height * 0, + top: + 0, //MediaQuery.of(context).size.height * 0, right: 15, child: IconButton( icon: Icon( DoctorApp.speechtotext, color: Colors.black, + size: 35, ), onPressed: () { initSpeechState() @@ -493,73 +500,91 @@ class _PatientMakeInPatientReferralScreenState ) ], ), - Container( - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), - child: AppButton( - title: TranslationBase.of(context).refer, - fontWeight: FontWeight.w700, - color: Color(0XFF359846), - onPressed: () async{ - setState(() { - if (_referTo == null) { - branchError = - TranslationBase.of(context).fieldRequired; - } else { - branchError = null; - } - if (_selectedBranch == null) { - hospitalError = - TranslationBase.of(context).fieldRequired; - } else { - hospitalError = null; - } - if (_selectedClinic == null) { - clinicError = - TranslationBase.of(context).fieldRequired; - } else { - clinicError = null; - } - if (_selectedDoctor == null) { - doctorError = - TranslationBase.of(context).fieldRequired; - } else { - doctorError = null; - } - if (_selectedFrequency == null) { - frequencyError = - TranslationBase.of(context).fieldRequired; - } else { - frequencyError = null; - } - }); - if (_selectedFrequency == null || - _selectedBranch == null || - _selectedClinic == null || - _selectedDoctor == null || - _remarksController.text == null || - _extController.text == null) return;{ - - await model.makeInPatientReferral( - patient: patient, - projectID: _selectedBranch['facilityId'], - clinicID: _selectedClinic['ClinicID'], - doctorID: _selectedDoctor['DoctorID'], - frequencyCode: _selectedFrequency['ParameterCode'], - ext: _extController.text, - remarks: _remarksController.text, - priority: _activePriority, - referralDate: appointmentDate - ); - if(model.state == ViewState.ErrorLocal) - DrAppToastMsg.showErrorToast(model.error); - else{ - DrAppToastMsg.showSuccesToast(TranslationBase.of(context).referralSuccessMsg); - Navigator.pop(context); - } - + Column( + children: [ + _remarksController.text.isEmpty + ? SizedBox() + : Container( + margin: EdgeInsets.all(5), + child: Expanded( + child: AppButton( + title: TranslationBase.of(context).clearText, + onPressed: () { + setState(() { + _remarksController.text = ''; + }); + }, + ))), + Container( + margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), + child: AppButton( + title: TranslationBase.of(context).refer, + fontWeight: FontWeight.w700, + color: Color(0XFF359846), + onPressed: () async { + setState(() { + if (_referTo == null) { + branchError = + TranslationBase.of(context).fieldRequired; + } else { + branchError = null; + } + if (_selectedBranch == null) { + hospitalError = + TranslationBase.of(context).fieldRequired; + } else { + hospitalError = null; + } + if (_selectedClinic == null) { + clinicError = + TranslationBase.of(context).fieldRequired; + } else { + clinicError = null; + } + if (_selectedDoctor == null) { + doctorError = + TranslationBase.of(context).fieldRequired; + } else { + doctorError = null; + } + if (_selectedFrequency == null) { + frequencyError = + TranslationBase.of(context).fieldRequired; + } else { + frequencyError = null; + } + }); + if (_selectedFrequency == null || + _selectedBranch == null || + _selectedClinic == null || + _selectedDoctor == null || + _remarksController.text == null || + _extController.text == null) return; + { + await model.makeInPatientReferral( + patient: patient, + projectID: _selectedBranch['facilityId'], + clinicID: _selectedClinic['ClinicID'], + doctorID: _selectedDoctor['DoctorID'], + frequencyCode: + _selectedFrequency['ParameterCode'], + ext: _extController.text, + remarks: _remarksController.text, + priority: _activePriority, + referralDate: appointmentDate); + if (model.state == ViewState.ErrorLocal) + DrAppToastMsg.showErrorToast(model.error); + else { + DrAppToastMsg.showSuccesToast( + TranslationBase.of(context) + .referralSuccessMsg); + Navigator.pop(context); + } } - }, - ), + }, + ), + ) + ], ) ], ), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index f972f14f..ba69e104 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -1301,41 +1301,34 @@ class TranslationBase { String get insurance22 => localizedValues["insurance22"][locale.languageCode]; String get approvals22 => localizedValues["approvals22"][locale.languageCode]; String get severe => localizedValues["severe"][locale.languageCode]; - String get graphDetails => localizedValues["graphDetails"][locale.languageCode]; + String get graphDetails => + localizedValues["graphDetails"][locale.languageCode]; String get discharged => localizedValues["discharged"][locale.languageCode]; String get addNewOrderSheet => localizedValues["addNewOrderSheet"][locale.languageCode]; String get addNewProgressNote => localizedValues["addNewProgressNote"][locale.languageCode]; - String get notePending => - localizedValues["notePending"][locale.languageCode]; + String get notePending => localizedValues["notePending"][locale.languageCode]; String get noteCanceled => localizedValues["noteCanceled"][locale.languageCode]; String get noteVerified => localizedValues["noteVerified"][locale.languageCode]; - String get noteVerify => - localizedValues["noteVerify"][locale.languageCode]; - String get noteConfirm => - localizedValues["noteConfirm"][locale.languageCode]; - String get noteAdd => - localizedValues["noteAdd"][locale.languageCode]; - - String get noteUpdate => - localizedValues["noteUpdate"][locale.languageCode]; - - String get orderSheet => - localizedValues["orderSheet"][locale.languageCode]; - String get order => - localizedValues["order"][locale.languageCode]; - String get sheet => - localizedValues["sheet"][locale.languageCode]; - String get medical => - localizedValues["medical"][locale.languageCode]; - String get report => - localizedValues["report"][locale.languageCode]; + String get noteVerify => localizedValues["noteVerify"][locale.languageCode]; + String get noteConfirm => localizedValues["noteConfirm"][locale.languageCode]; + String get noteAdd => localizedValues["noteAdd"][locale.languageCode]; + + String get noteUpdate => localizedValues["noteUpdate"][locale.languageCode]; + + String get orderSheet => localizedValues["orderSheet"][locale.languageCode]; + String get order => localizedValues["order"][locale.languageCode]; + String get sheet => localizedValues["sheet"][locale.languageCode]; + String get medical => localizedValues["medical"][locale.languageCode]; + String get report => localizedValues["report"][locale.languageCode]; String get discharge => localizedValues["discharge"][locale.languageCode]; String get none => localizedValues["none"][locale.languageCode]; - String get notRepliedYet => localizedValues["notRepliedYet"][locale.languageCode]; + String get notRepliedYet => + localizedValues["notRepliedYet"][locale.languageCode]; + String get clearText => localizedValues["clearText"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { From f84bc6da9d4c7057c6b2837da53c70d4db9b96b8 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 4 May 2021 10:31:11 +0300 Subject: [PATCH 2/5] voice command uodated --- lib/screens/patients/profile/note/update_note.dart | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/screens/patients/profile/note/update_note.dart b/lib/screens/patients/profile/note/update_note.dart index b2e36d8f..8997dd07 100644 --- a/lib/screens/patients/profile/note/update_note.dart +++ b/lib/screens/patients/profile/note/update_note.dart @@ -181,15 +181,14 @@ class _UpdateNoteOrderState extends State { ? SizedBox() : Container( margin: EdgeInsets.all(5), - child: Expanded( - child: AppButton( + child: AppButton( title: TranslationBase.of(context).clearText, onPressed: () { setState(() { progressNoteController.text = ''; }); }, - )), + ), ), Container( margin: EdgeInsets.all(5), From 81d518e7252c5e7b9aa7a347c019607cc96c5528 Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 4 May 2021 11:45:49 +0300 Subject: [PATCH 3/5] hot fix --- lib/config/localized_values.dart | 4 ++-- lib/screens/patients/PatientsInPatientScreen.dart | 3 +-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index a5398db9..5d2b2de8 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -47,9 +47,9 @@ const Map> localizedValues = { 'radiology': {'en': 'Radiology', 'ar': 'الأشعة'}, 'service': {'en': 'Service', 'ar': 'خدمة'}, 'referral': {'en': 'Referral', 'ar': 'الإحالة'}, - 'inPatient': {'en': 'My Patients', 'ar': 'مرضاي'}, + 'inPatient': {'en': 'My InPatients', 'ar': 'مرضاي'}, 'inPatientLabel': {'en': 'InPatients', 'ar': 'المريض الداخلي'}, - 'inPatientAll': {'en': 'All Patients', 'ar': 'كل المرضى'}, + 'inPatientAll': {'en': 'All InPatients', 'ar': 'كل المرضى'}, 'operations': {'en': 'Operations', 'ar': 'عمليات'}, 'patientServices': {'en': 'Patient Services', 'ar': 'خدمات المرضى'}, 'searchMedicine': {'en': 'Search Medicines', 'ar': 'بحث عن الدواء'}, diff --git a/lib/screens/patients/PatientsInPatientScreen.dart b/lib/screens/patients/PatientsInPatientScreen.dart index 6f2bafd9..75b65847 100644 --- a/lib/screens/patients/PatientsInPatientScreen.dart +++ b/lib/screens/patients/PatientsInPatientScreen.dart @@ -76,7 +76,6 @@ class _PatientInPatientScreenState extends State with Si fontSize: SizeConfig.textMultiplier * 2.8, fontWeight: FontWeight.bold, color: Color(0xFF2B353E), - fontFamily: 'Poppins', ), ), ]), @@ -155,7 +154,7 @@ class _PatientInPatientScreenState extends State with Si children: [ AppText( title, - fontSize: SizeConfig.textMultiplier * 1.6, + fontSize: SizeConfig.textMultiplier * 1.5, color: isActive ? Colors.white : Color(0xFF2B353E), fontWeight: FontWeight.w700, ), From 583edfed89e57cf969dcfbd47d5695488fa1d43a Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Tue, 4 May 2021 11:54:54 +0300 Subject: [PATCH 4/5] fix out patient number --- lib/screens/patients/out_patient/out_patient_screen.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/screens/patients/out_patient/out_patient_screen.dart b/lib/screens/patients/out_patient/out_patient_screen.dart index 8d1d2eb8..c8d197de 100644 --- a/lib/screens/patients/out_patient/out_patient_screen.dart +++ b/lib/screens/patients/out_patient/out_patient_screen.dart @@ -132,7 +132,7 @@ class _OutPatientsScreenState extends State { onTap: () async { setState(() { _activeLocation = _times.indexOf(item); - outPatientFilterType= _activeLocation==0?OutPatientFilterType.Previous:_activeLocation==0?OutPatientFilterType.Today:OutPatientFilterType.NextWeek; + outPatientFilterType= _activeLocation==0?OutPatientFilterType.Previous:_activeLocation==1?OutPatientFilterType.Today:OutPatientFilterType.NextWeek; _controller.text=""; }); model.searchData(""); From 302294afada420888f4b926d2448e07de956bc81 Mon Sep 17 00:00:00 2001 From: Sultan Khan Date: Tue, 4 May 2021 12:12:06 +0300 Subject: [PATCH 5/5] session issue fix --- lib/util/helpers.dart | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/lib/util/helpers.dart b/lib/util/helpers.dart index 13b7b2ae..3e410c86 100644 --- a/lib/util/helpers.dart +++ b/lib/util/helpers.dart @@ -1,6 +1,7 @@ import 'package:connectivity/connectivity.dart'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; +import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/models/doctor/list_doctor_working_hours_table_model.dart'; import 'package:doctor_app_flutter/screens/auth/login_screen.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; @@ -16,6 +17,7 @@ import '../util/dr_app_toast_msg.dart'; import 'dr_app_shared_pref.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + class Helpers { static int cupertinoPickerIndex = 0; @@ -82,7 +84,6 @@ class Helpers { style: TextStyle(fontSize: SizeConfig.textMultiplier * 2), ); }).toList(), - itemExtent: 25, looping: false, onSelectedItemChanged: (int index) { @@ -100,6 +101,7 @@ class Helpers { DrAppToastMsg.showErrorToast(localMsg); } + static Future checkConnection() async { ConnectivityResult connectivityResult = await (Connectivity().checkConnectivity()); @@ -144,8 +146,13 @@ class Helpers { String lang = await sharedPref.getString(APP_Language); await clearSharedPref(); sharedPref.setString(APP_Language, lang); - Navigator.pushAndRemoveUntil(AppGlobal.CONTEX, FadePage(page: Loginsreen(),), (r) => false); - + ProjectViewModel().isLogin = false; + Navigator.pushAndRemoveUntil( + AppGlobal.CONTEX, + FadePage( + page: Loginsreen(), + ), + (r) => false); } navigateToUpdatePage(String message, String androidLink, iosLink) { @@ -158,7 +165,7 @@ class Helpers { iosLink: iosLink, ), ), - (r) => false); + (r) => false); } static String parseHtmlString(String htmlString) {