From 054933b280af32a49e7c35026ed9026db03f96cb Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 21 Jun 2020 09:14:08 +0300 Subject: [PATCH 1/8] Translation stage four --- lib/config/localized_values.dart | 42 ++++++++++- lib/screens/dashboard_screen.dart | 17 +++-- lib/screens/patients/patients_screen.dart | 71 +++++++++++++------ .../profile/insurance_approvals_screen.dart | 26 +++++-- .../profile/refer_patient_screen.dart | 36 ++++++---- lib/util/translations_delegate_base.dart | 35 ++++++++- .../profile/profile_medical_info_widget.dart | 2 +- lib/widgets/shared/bottom_nav_bar.dart | 9 +-- 8 files changed, 179 insertions(+), 59 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index f483a042..07a61e2f 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -6,7 +6,7 @@ const Map> localizedValues = { 'lanArabic': {'en': 'العربية', 'ar': 'العربية'}, 'doctorReply': {'en': 'Doctor Reply', 'ar': 'رد الطبيب'}, 'time': {'en': 'Time', 'ar': 'الوقت'}, - 'fileNo': {'en': 'File No', 'ar': 'رقم الملف'}, + 'fileNo': {'en': 'File No:', 'ar': 'رقم الملف:'}, 'mobileNo': {'en': 'Mobile No', 'ar': 'رقم الموبايل'}, 'messagesScreenToolbarTitle': {'en': 'Messages', 'ar': 'الرسائل'}, 'mySchedule': {'en': 'My Schedule', 'ar': 'جدولي'}, @@ -157,4 +157,44 @@ const Map> localizedValues = { 'en': 'Please enter the code', 'ar': 'الرجاء ادخال الرمز' }, + 'youDon\'tHaveAnyPatient': { + 'en': 'You don\'t have any patient', + 'ar': 'ليس لديك اي مرضى' + }, + 'age': {'en': 'Age', 'ar': 'العمر'}, + 'today': {'en': 'Today', 'ar': 'اليوم'}, + 'yesterday': {'en': 'Yesterday', 'ar': 'الأمس'}, + 'tomorrow': {'en': 'Tomorrow', 'ar': 'الغد'}, + 'nextWeek': {'en': 'Next Week', 'ar': 'الاسبوع القادم'}, + 'all': {'en': 'All', 'ar': 'الجميع'}, + 'errorNoInsuranceApprovals': { + 'en': 'You don\'t have any Insurance Approvals', + 'ar': 'ليس لديك اي موفقات تأمين' + }, + 'searchInsuranceApprovals': { + 'en': 'Search InsuranceApprovals', + 'ar': 'بحث عن موافقات التأمين' + }, + 'status': {'en': 'STATUS', 'ar': 'الحالة'}, + 'expiryDate': {'en': 'EXPIRY DATE', 'ar': 'تاريخ الانتهاء'}, + 'producerName': {'en': 'PRODUCER NAME', 'ar': 'اسم المنتج'}, + 'receiptOn': {'en': 'RECEIPT ON', 'ar': 'تاريخ الاستلام'}, + 'approvalNo': {'en': 'Approval No:', 'ar': 'رقم الموافقة:'}, + 'doctor': {'en': 'Doctor', 'ar': 'الدكتور'}, + 'ext': {'en': 'Ext#', 'ar': 'رقم التحويلة'}, + 'veryUrgent': {'en': 'Very Urgent', 'ar': 'عاجل جدا'}, + 'urgent': {'en': 'Urgent', 'ar': 'عاجل'}, + 'routine': {'en': 'Routine', 'ar': 'روتيني'}, + 'send': {'en': 'Send', 'ar': 'ارسال'}, + 'referralFrequency': {'en': 'Referral Frequency:', 'ar': 'تواتر الحالة:'}, + 'clinicalDetailsAndRemarks': { + 'en': 'Clinical Details and Remarks', + 'ar': 'التفاصيل السرسرية والملاحظات' + }, + 'remarks': {'en': 'Remarks', 'ar': 'ملاحظات'}, + 'pleaseFill': { + 'en': 'Please fill all fields..!', + 'ar': 'الرجاء ملأ جميع الحقول..!' + }, + 'replay2': {'en': 'Replay', 'ar': 'رد الطبيب'}, }; diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index f09ba102..f8c91d80 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -146,10 +146,11 @@ class _DashboardScreenState extends State { CrossAxisAlignment.stretch, children: [ Expanded( - child: DashboardItemTexts( - TranslationBase.of(context).arrived, - "23", - )), + child: DashboardItemTexts( + TranslationBase.of(context).arrived, + "23", + ), + ), Expanded( child: DashboardItemTexts( TranslationBase.of(context) @@ -235,7 +236,7 @@ class _DashboardScreenState extends State { child: new DashboardItemIconText( widget.iconURL + 'in_patient_white.svg', "23", - "In-Patient", + TranslationBase.of(context).outPatients, showBorder: true, backgroundColor: Colors.red[900], iconColor: Colors.white), @@ -245,7 +246,7 @@ class _DashboardScreenState extends State { child: new DashboardItemIconText( widget.iconURL + 'operations.svg', "23", - TranslationBase.of(context).operations, + TranslationBase.of(context).inPatient, showBorder: true, backgroundColor: Colors.red[900], )), @@ -503,7 +504,7 @@ class _DashboardScreenState extends State { } changeClinic(clinicId, BuildContext context) async { - Navigator.pop(context); + Navigator.pop(context); changeIsLoading(true); Map profile = await sharedPref.getObj(DOCTOR_PROFILE); DoctorProfileModel doctorProfile = new DoctorProfileModel.fromJson(profile); @@ -517,10 +518,8 @@ class _DashboardScreenState extends State { // authProvider.getDocProfiles(docInfo) authProvider.getDocProfiles(docInfo.toJson()).then((res) async { - changeIsLoading(false); sharedPref.setObj(DOCTOR_PROFILE, res['DoctorProfileList'][0]); - }).catchError((err) { changeIsLoading(false); helpers.showErrorToast(err); diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index f0a543f2..0012cb7b 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -30,6 +30,7 @@ import 'package:hexcolor/hexcolor.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; import '../../widgets/shared/card_with_bg_widget.dart'; import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; class PatientsScreen extends StatefulWidget { @override @@ -53,7 +54,7 @@ class _PatientsScreenState extends State { final String assetName = 'assets/image.svg'; // List _locations = ['Today', 'Old Date', 'YESTERDAY']; - List _locations = ['All','Today', 'Tomorrow', 'Next Week']; + List _locations = ['All', 'Today', 'Tomorrow', 'Next Week']; int _activeLocation = 0; bool _isInit = true; @@ -268,22 +269,22 @@ class _PatientsScreenState extends State { if ((currentTime.year == checkedTime.year) && (currentTime.month == checkedTime.month) && (currentTime.day == checkedTime.day)) { - return "Today"; + return TranslationBase.of(context).today; } else if ((currentTime.year == checkedTime.year) && (currentTime.month == checkedTime.month)) { if ((currentTime.day - checkedTime.day) == 1) { - return "YESTERDAY"; + return TranslationBase.of(context).yesterday; } else if ((currentTime.day - checkedTime.day) == -1) { - return "Tomorrow"; + return TranslationBase.of(context).tomorrow; } if ((currentTime.day - checkedTime.day) <= -2) { - return "Next Week"; + return TranslationBase.of(context).nextWeek; } else { - return "All"; + return TranslationBase.of(context).all; } } - return "All"; + return TranslationBase.of(context).all; } /* @@ -305,7 +306,8 @@ class _PatientsScreenState extends State { : _isError ? DrAppEmbeddedError(error: error) : litems == null - ? DrAppEmbeddedError(error: 'You don\'t have any patient') + ? DrAppEmbeddedError( + error: TranslationBase.of(context).youDontHaveAnyPatient) : Container( child: ListView( scrollDirection: Axis.vertical, @@ -348,7 +350,9 @@ class _PatientsScreenState extends State { this.searchData(str); }, decoration: buildInputDecoration( - context, 'Search '), + context, + TranslationBase.of(context) + .search), ), ), SizedBox( @@ -384,28 +388,49 @@ class _PatientsScreenState extends State { mainAxisAlignment: MainAxisAlignment .start, - children: [ + children: < + Widget>[ Container( - decoration: BoxDecoration( + decoration: + BoxDecoration( gradient: LinearGradient( - begin: Alignment(-1, -1), - end: Alignment(1, 1), + begin: Alignment( + -1, + -1), + end: Alignment( + 1, + 1), colors: [ Colors.grey[100], Colors.grey[200], ]), boxShadow: [ BoxShadow( - color: Color.fromRGBO(0, 0, 0, 0.08), - offset: Offset(0.0, 5.0), - blurRadius: 16.0) + color: Color.fromRGBO( + 0, + 0, + 0, + 0.08), + offset: Offset(0.0, + 5.0), + blurRadius: + 16.0) ], - borderRadius: BorderRadius.all(Radius.circular(50.0)), + borderRadius: + BorderRadius.all( + Radius.circular(50.0)), ), width: 80, height: 80, - child: Icon(item.genderDescription == "Male" ? DoctorApp.male : DoctorApp.femaleicon,size: 80,)), - + child: Icon( + item.genderDescription == + "Male" + ? DoctorApp + .male + : DoctorApp + .femaleicon, + size: 80, + )), ], ), SizedBox( @@ -435,7 +460,9 @@ class _PatientsScreenState extends State { height: 8, ), AppText( - "File Number:" + + TranslationBase.of( + context) + .fileNo + item.patientId .toString(), fontSize: 2.0 * @@ -453,7 +480,9 @@ class _PatientsScreenState extends State { // height: 8, // ), AppText( - "Age:" + + TranslationBase.of( + context) + .age + item.age .toString(), fontSize: 2.0 * diff --git a/lib/screens/patients/profile/insurance_approvals_screen.dart b/lib/screens/patients/profile/insurance_approvals_screen.dart index c4dba964..7338b2d5 100644 --- a/lib/screens/patients/profile/insurance_approvals_screen.dart +++ b/lib/screens/patients/profile/insurance_approvals_screen.dart @@ -85,7 +85,8 @@ class _InsuranceApprovalsState extends State { ? DrAppEmbeddedError(error: patientsProv.error) : patientsProv.insuranceApporvalsList == null ? DrAppEmbeddedError( - error: 'You don\'t have any Insurance Approvals') + error: + TranslationBase.of(context).errorNoInsuranceApprovals) : Column( children: [ Container( @@ -97,7 +98,9 @@ class _InsuranceApprovalsState extends State { this.searchData(str); }, decoration: buildInputDecoration( - context, 'Search Insurance Approvals'), + context, + TranslationBase.of(context) + .searchInsuranceApprovals), ), ), Expanded( @@ -231,7 +234,8 @@ class _InsuranceApprovalsState extends State { marginBottom: 2, ), AppText( - "Approval No:", + TranslationBase.of(context) + .approvalNo, color: Colors.white, fontSize: 16, marginTop: 2, @@ -249,7 +253,9 @@ class _InsuranceApprovalsState extends State { .start, children: [ AppText( - "PRODUCER NAME", + TranslationBase.of( + context) + .producerName, fontSize: 10, color: Colors.white, @@ -291,7 +297,9 @@ class _InsuranceApprovalsState extends State { .start, children: [ AppText( - "STATUS", + TranslationBase.of( + context) + .status, fontSize: 10, color: Colors.white, @@ -329,7 +337,9 @@ class _InsuranceApprovalsState extends State { .start, children: [ AppText( - "RECEIPT ON", + TranslationBase.of( + context) + .receiptOn, fontSize: 10, color: Colors.white, @@ -372,7 +382,9 @@ class _InsuranceApprovalsState extends State { .start, children: [ AppText( - "EXPIRY DATE", + TranslationBase.of( + context) + .expiryDate, fontSize: 10, color: Colors.white, diff --git a/lib/screens/patients/profile/refer_patient_screen.dart b/lib/screens/patients/profile/refer_patient_screen.dart index 1da89f97..e12a9240 100644 --- a/lib/screens/patients/profile/refer_patient_screen.dart +++ b/lib/screens/patients/profile/refer_patient_screen.dart @@ -16,6 +16,7 @@ import '../../../widgets/shared/app_scaffold_widget.dart'; import '../../../widgets/shared/app_texts_widget.dart'; import '../../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; import '../../../util/extenstions.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); @@ -48,8 +49,7 @@ class _ReferPatientState extends State { String _selectedDoctor; String _selectedReferralFrequancy; - List _priorities = ['Very Urgent', 'Urgent', 'Routine']; - int _activePriority = 2; + int _activePriority = 1; FocusNode myFocusNode; @@ -69,7 +69,7 @@ class _ReferPatientState extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: "Refer Patient", + appBarTitle: TranslationBase.of(context).myReferralPatient, body: patientsProv.isLoading ? DrAppCircularProgressIndeicator() : patientsProv.isError @@ -82,7 +82,7 @@ class _ReferPatientState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "Clinic", + TranslationBase.of(context).clinic, fontSize: 18, fontWeight: FontWeight.bold, marginLeft: 15, @@ -166,7 +166,7 @@ class _ReferPatientState extends State { ), //--------------------------------------------------------------------// AppText( - "Doctor", + TranslationBase.of(context).doctor, fontSize: 18, fontWeight: FontWeight.bold, marginLeft: 15, @@ -246,7 +246,7 @@ class _ReferPatientState extends State { ), ), //-----------------------------/// AppText( - "Ext#", + TranslationBase.of(context).ext, fontSize: 18, fontWeight: FontWeight.bold, marginLeft: 15, @@ -255,7 +255,7 @@ class _ReferPatientState extends State { Padding( padding: const EdgeInsets.all(10.0), child: AppTextFormField( - hintText: "Ext#", + hintText: TranslationBase.of(context).ext, controller: _extController, inputFormatter: ONLY_NUMBERS, textInputType: TextInputType.number, @@ -263,7 +263,7 @@ class _ReferPatientState extends State { ), ), AppText( - "Priority", + TranslationBase.of(context).priority, fontSize: 18, fontWeight: FontWeight.bold, marginLeft: 15, @@ -273,14 +273,15 @@ class _ReferPatientState extends State { priorityBar(context), AppText( - "Replay Before: " + getPriority(), + TranslationBase.of(context).referralFrequency + + getPriority(), fontWeight: FontWeight.bold, marginLeft: 15, marginTop: 15, ), AppText( - "Referral Frequency", + TranslationBase.of(context).referralFrequency, fontSize: 18, fontWeight: FontWeight.bold, marginLeft: 15, @@ -338,7 +339,7 @@ class _ReferPatientState extends State { _selectedReferralFrequancy)); freqId = freqInfo['ParameterCode'] .toString(); - myFocusNode.requestFocus(); + myFocusNode.requestFocus(); }) }, items: patientsProv @@ -359,7 +360,7 @@ class _ReferPatientState extends State { ), ), AppText( - "Clinical Details and Remarks", + TranslationBase.of(context).clinicDetailsandRemarks, fontSize: 18, fontWeight: FontWeight.bold, marginLeft: 15, @@ -368,7 +369,7 @@ class _ReferPatientState extends State { Padding( padding: const EdgeInsets.all(10.0), child: AppTextFormField( - hintText: "Remarks", + hintText: TranslationBase.of(context).remarks, focusNode: myFocusNode, controller: _remarksController, inputFormatter: ONLY_LETTERS, @@ -381,7 +382,7 @@ class _ReferPatientState extends State { child: Column( children: [ AppText( - "Please fill all fields..!", + TranslationBase.of(context).pleaseFill, color: Colors.red, fontWeight: FontWeight.bold, margin: 10, @@ -389,7 +390,7 @@ class _ReferPatientState extends State { isValid == null ? false : !isValid, ), AppButton( - title: "Send", + title: TranslationBase.of(context).send, color: Color(PRIMARY_COLOR), onPressed: () => {referToDoctor(context)}, ) @@ -402,6 +403,11 @@ class _ReferPatientState extends State { } Widget priorityBar(BuildContext _context) { + List _priorities = [ + TranslationBase.of(context).veryUrgent, + TranslationBase.of(context).urgent, + TranslationBase.of(context).routine, + ]; return Container( height: MediaQuery.of(context).size.height * 0.065, width: SizeConfig.screenWidth * 0.9, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index c1544b97..64f302b2 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -68,7 +68,7 @@ class TranslationBase { String get radiology => localizedValues['radiology'][locale.languageCode]; String get referral => localizedValues['referral'][locale.languageCode]; String get inPatient => localizedValues['inPatient'][locale.languageCode]; - String get operations => localizedValues['inPatient'][locale.languageCode]; + String get operations => localizedValues['operations'][locale.languageCode]; String get patientServices => localizedValues['patientServices'][locale.languageCode]; String get searchMedicine => @@ -179,6 +179,39 @@ class TranslationBase { String get smsBy => localizedValues['smsBy'][locale.languageCode]; String get pleaseEnterTheCode => localizedValues['pleaseEnterTheCode'][locale.languageCode]; + String get youDontHaveAnyPatient => + localizedValues['youDon\'tHaveAnyPatient'][locale.languageCode]; + + String get age => localizedValues['age'][locale.languageCode]; + String get today => localizedValues['today'][locale.languageCode]; + String get tomorrow => localizedValues['tomorrow'][locale.languageCode]; + String get all => localizedValues['all'][locale.languageCode]; + String get nextWeek => localizedValues['nextWeek'][locale.languageCode]; + String get yesterday => localizedValues['yesterday'][locale.languageCode]; + String get errorNoInsuranceApprovals => + localizedValues['errorNoInsuranceApprovals'][locale.languageCode]; + String get searchInsuranceApprovals => + localizedValues['searchInsuranceApprovals'][locale.languageCode]; + String get status => localizedValues['status'][locale.languageCode]; + String get expiryDate => localizedValues['expiryDate'][locale.languageCode]; + String get producerName => + localizedValues['producerName'][locale.languageCode]; + String get receiptOn => localizedValues['receiptOn'][locale.languageCode]; + String get approvalNo => localizedValues['approvalNo'][locale.languageCode]; + String get doctor => localizedValues['doctor'][locale.languageCode]; + String get ext => localizedValues['ext'][locale.languageCode]; + String get veryUrgent => localizedValues['veryUrgent'][locale.languageCode]; + String get urgent => localizedValues['urgent'][locale.languageCode]; + String get routine => localizedValues['routine'][locale.languageCode]; + String get send => localizedValues['send'][locale.languageCode]; + String get referralFrequency => + localizedValues['referralFrequency'][locale.languageCode]; + String get clinicalDetailsAndRemarks => + localizedValues['clinicalDetailsAndRemarks'][locale.languageCode]; + String get remarks => localizedValues['remarks'][locale.languageCode]; + String get pleaseFill => localizedValues['pleaseFill'][locale.languageCode]; + String get replay2 => localizedValues['replay2'][locale.languageCode]; + String get outPatient => localizedValues['outPatient'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index d3034c86..b37a360f 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -76,7 +76,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { key: key, patient: patient, route: REFER_PATIENT, - name: 'Refer Patient', + name: TranslationBase.of(context).myReferralPatient, icon: 'note.png')), Visibility( visible: selectedPatientType != 0 && selectedPatientType != 5, diff --git a/lib/widgets/shared/bottom_nav_bar.dart b/lib/widgets/shared/bottom_nav_bar.dart index f2fd66cc..ca31f2bf 100644 --- a/lib/widgets/shared/bottom_nav_bar.dart +++ b/lib/widgets/shared/bottom_nav_bar.dart @@ -3,6 +3,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'bottom_navigation_item.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; class BottomNavBar extends StatefulWidget { final ValueChanged changeIndex; @@ -41,7 +42,7 @@ class _BottomNavBarState extends State { changeIndex: _changeIndex, index: _index, currentIndex: 0, - name: 'HOME', + name: TranslationBase.of(context).home, ), BottomNavigationItem( icon: DoctorApp.message_icon, @@ -49,7 +50,7 @@ class _BottomNavBarState extends State { changeIndex: _changeIndex, index: _index, currentIndex: 1, - name: 'REPLAY', + name: TranslationBase.of(context).replay2, ), BottomNavigationItem( icon: DoctorApp.schedule_icon, @@ -57,7 +58,7 @@ class _BottomNavBarState extends State { changeIndex: _changeIndex, index: _index, currentIndex: 2, - name: 'SCHEDULE', + name: TranslationBase.of(context).mySchedule, ), BottomNavigationItem( icon: DoctorApp.menu_icon, @@ -65,7 +66,7 @@ class _BottomNavBarState extends State { changeIndex: _changeIndex, index: _index, currentIndex: 3, - name: 'SERVICES', + name: TranslationBase.of(context).services, ) ], ), From c62340e8346568d18a9251d550fff95b8aacbfbf Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Sun, 21 Jun 2020 11:02:07 +0300 Subject: [PATCH 2/8] modify IMEI --- lib/widgets/auth/login_form.dart | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/widgets/auth/login_form.dart b/lib/widgets/auth/login_form.dart index 1b800613..033f445c 100644 --- a/lib/widgets/auth/login_form.dart +++ b/lib/widgets/auth/login_form.dart @@ -300,8 +300,8 @@ class _LoginFormState extends State { try { platformImei = await ImeiPlugin.getImei(shouldShowRequestPermissionRationale: false); - idunique = await ImeiPlugin.getId(); - } on PlatformException { + idunique = await ImeiPlugin.getImei(); + } catch(e) { platformImei = 'Failed to get platform version.'; } From 91ffdabd730fb80ab4de38db394c72de9122a265 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 21 Jun 2020 16:38:27 +0300 Subject: [PATCH 3/8] Translation stage five --- lib/config/localized_values.dart | 20 +- lib/lookups/patient_lookup.dart | 12 +- lib/screens/dashboard_screen.dart | 11 +- lib/screens/doctor/doctor_reply_screen.dart | 50 +-- .../medicine/pharmacies_list_screen.dart | 325 +++++++++--------- ...t_patient_prescription_details_screen.dart | 5 +- .../patients/patient_search_screen.dart | 25 +- .../profile/patient_orders_screen.dart | 40 ++- ...n_patient_prescription_details_screen.dart | 3 +- .../radiology/radiology_report_screen.dart | 21 +- .../vital_sign/vital_sign_details_screen.dart | 21 +- lib/util/translations_delegate_base.dart | 18 + lib/widgets/auth/verfiy_account.dart | 4 +- .../dashboard_item_texts_widget.dart | 14 +- .../profile/profile_medical_info_widget.dart | 2 +- lib/widgets/shared/app_drawer_widget.dart | 9 +- 16 files changed, 336 insertions(+), 244 deletions(-) diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 07a61e2f..133dbfef 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -14,7 +14,7 @@ const Map> localizedValues = { 'en': 'You don\'t have any Schedule', 'ar': 'ليس لديك أي جدول زمني' }, - 'verify': {'en': 'Verify', 'ar': 'تحقق'}, + 'verify': {'en': 'VERIFY', 'ar': 'تحقق'}, 'referralDoctor': {'en': 'Referral Doctor', 'ar': 'الطبيب المُحول إليه'}, 'referringClinic': {'en': 'Referring Clinic', 'ar': 'العيادة المُحول إليها'}, 'frequency': {'en': 'Frequency', 'ar': 'نوع التحويلا'}, @@ -51,7 +51,7 @@ const Map> localizedValues = { 'patientID': {'en': 'Patient ID', 'ar': 'رقم المريض'}, 'patientFile': {'en': 'Patient File', 'ar': 'ملف المريض'}, 'familyMedicine': {'en': 'Family Medicine Clinic', 'ar': 'عيادة طب الأسرة'}, - 'search': {'en': 'Search', 'ar': 'بحث'}, + 'search': {'en': 'Search', 'ar': 'بحث '}, 'onlyArrivedPatient': { 'en': 'Only Arrived Patient', 'ar': 'المريض الذي حضر للموعد' @@ -60,7 +60,7 @@ const Map> localizedValues = { 'en': 'Search Medicine Name Here', 'ar': 'ابحث عن الدواء هنا' }, - 'youCanFind': {'en': 'You Can Find', 'ar': 'تستطيع ان تجد '}, + 'youCanFind': {'en': 'You Can Find', 'ar': 'تستطيع ان تجد '}, 'itemsInSearch': {'en': 'items in search', 'ar': 'عناصر في البحث'}, 'qrReader': {'en': 'QR Reader', 'ar': 'قارىء رمز الQR'}, 'startScanning': {'en': 'Start Scanning', 'ar': 'بدء المسح'}, @@ -137,6 +137,7 @@ const Map> localizedValues = { 'sms': {'en': 'SMS', 'ar': 'رسالة قصيرة'}, 'fingerprint': {'en': 'Fingerprint', 'ar': 'بصمة'}, 'faceId': {'en': 'Face ID', 'ar': 'معرف الوجه'}, + 'whatsAppBy': {'en': 'by WhatsApp', 'ar': 'عن طريق واتس اب'}, 'whatsApp': {'en': 'WhatsApp', 'ar': 'واتس اب'}, 'pleaseChoose': { 'en': 'Please choose one of the Following option to verify', @@ -197,4 +198,17 @@ const Map> localizedValues = { 'ar': 'الرجاء ملأ جميع الحقول..!' }, 'replay2': {'en': 'Replay', 'ar': 'رد الطبيب'}, + 'logout': {'en': 'Logout', 'ar': 'تسجيل خروج'}, + 'pharmaciesList': {'en': 'Pharmacies List', 'ar': 'قائمة الصيدليات'}, + 'price': {'en': 'Price', 'ar': 'السعر'}, + 'youCanFindItIn': {'en': 'You can Find it in', 'ar': 'تستطيع ان تجده هنا '}, + 'radiologyReport': {'en': 'Radiology Report', 'ar': 'تقرير الاشعة'}, + 'orders': {'en': 'Orders', 'ar': ' الطلبات'}, + 'searchOrders': {'en': 'Search Orders', 'ar': ' بحث عن الطلبات'}, + 'prescriptionDetails': {'en': 'Prescription Details', 'ar': 'تفاصبل الوصفة'}, + 'prescriptionInfo': {'en': 'Prescription Info', 'ar': 'معلومات الوصفة'}, + 'errorNoOrders': { + 'en': 'You don\'t have any Orders', + 'ar': 'لا يوجد لديك اي طلبات' + }, }; diff --git a/lib/lookups/patient_lookup.dart b/lib/lookups/patient_lookup.dart index 5db5fd96..189535ce 100644 --- a/lib/lookups/patient_lookup.dart +++ b/lib/lookups/patient_lookup.dart @@ -13,8 +13,16 @@ const PATIENT_TYPE = const [ ]; const LOCATIONS = const [ - {"text": "In Sudia Arabia", "val": "1"}, - {"text": "Out Sudia Arabia", "val": "2"}, + { + "text": "In Saudi Arabia", + "text-ar": "داخل المملكة العربية السعودية", + "val": "1" + }, + { + "text": "Out Saudi Arabia", + "text-ar": "خارج المملكة العربية السعودية", + "val": "2" + }, ]; enum vitalSignDetails { diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index 8ed91b4d..03c52afb 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -8,6 +8,7 @@ import 'package:doctor_app_flutter/providers/auth_provider.dart'; import 'package:doctor_app_flutter/providers/doctor_reply_provider.dart'; import 'package:doctor_app_flutter/providers/hospital_provider.dart'; import 'package:doctor_app_flutter/providers/medicine_provider.dart'; +import 'package:doctor_app_flutter/providers/project_provider.dart'; import 'package:doctor_app_flutter/providers/referral_patient_provider.dart'; import 'package:doctor_app_flutter/providers/referred_patient_provider.dart'; import 'package:doctor_app_flutter/screens/medicine/medicine_search_screen.dart'; @@ -46,11 +47,13 @@ class _DashboardScreenState extends State { HospitalProvider hospitalProvider; AuthProvider authProvider; bool isLoading = false; + ProjectProvider projectsProvider; @override Widget build(BuildContext context) { hospitalProvider = Provider.of(context); authProvider = Provider.of(context); + projectsProvider = Provider.of(context); print(authProvider.doctorsClinicList); FocusScopeNode currentFocus = FocusScope.of(context); if (!currentFocus.hasPrimaryFocus) { @@ -101,7 +104,9 @@ class _DashboardScreenState extends State { TranslationBase.of(context).todayStatistics, fontWeight: FontWeight.bold, ), - alignment: Alignment.centerLeft, + alignment: projectsProvider.isArabic + ? Alignment.topRight + : Alignment.topLeft, ), Expanded( flex: 3, @@ -228,7 +233,9 @@ class _DashboardScreenState extends State { Expanded( flex: 2, child: new DashboardItemIconText( - DoctorApp.in_patient_white, "23", TranslationBase.of(context).outPatients, + DoctorApp.in_patient_white, + "23", + TranslationBase.of(context).outPatients, showBorder: true, backgroundColor: Colors.red[900], iconColor: Colors.white), diff --git a/lib/screens/doctor/doctor_reply_screen.dart b/lib/screens/doctor/doctor_reply_screen.dart index dae9b5a5..48665a27 100644 --- a/lib/screens/doctor/doctor_reply_screen.dart +++ b/lib/screens/doctor/doctor_reply_screen.dart @@ -23,36 +23,38 @@ import 'package:provider/provider.dart'; *@desc: Doctor Reply Screen display data from GtMyPatientsQuestions service */ class DoctorReplyScreen extends StatelessWidget { - DoctorReplyProvider _doctorReplyProvider; @override Widget build(BuildContext context) { _doctorReplyProvider = Provider.of(context); return AppScaffold( - appBarTitle: TranslationBase.of(context).doctorReply, - body:_doctorReplyProvider.isLoading? DrAppCircularProgressIndeicator(): - _doctorReplyProvider.isError? Center( - child: Text( - _doctorReplyProvider.error, - style: TextStyle(color: Theme.of(context).errorColor), - ), - ): - Container( - padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), - child: ListView( - children: [ - Column( - crossAxisAlignment: CrossAxisAlignment.start, - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: _doctorReplyProvider.listDoctorWorkingHoursTable.map((reply) { - return DoctorReplyWidget( reply: reply); - }).toList(), - ) - ], - ), - ), + appBarTitle: TranslationBase.of(context).replay2, + body: _doctorReplyProvider.isLoading + ? DrAppCircularProgressIndeicator() + : _doctorReplyProvider.isError + ? Center( + child: Text( + _doctorReplyProvider.error, + style: TextStyle(color: Theme.of(context).errorColor), + ), + ) + : Container( + padding: EdgeInsetsDirectional.fromSTEB(30, 0, 30, 0), + child: ListView( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: _doctorReplyProvider + .listDoctorWorkingHoursTable + .map((reply) { + return DoctorReplyWidget(reply: reply); + }).toList(), + ) + ], + ), + ), ); } - } diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index 6974eaa4..598c3e08 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -13,6 +13,7 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:maps_launcher/maps_launcher.dart'; import 'package:url_launcher/url_launcher.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); @@ -50,173 +51,185 @@ class _PharmaciesListState extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: "Pharmacies List", + appBarTitle: TranslationBase.of(context).pharmaciesList, body: Container( height: SizeConfig.screenHeight, child: ListView( - shrinkWrap: true, - scrollDirection: Axis.vertical, - physics: const AlwaysScrollableScrollPhysics(), - children: [ - RoundedContainer( - child: !_medicineProvider.isFinished - ? DrAppCircularProgressIndeicator() - : _medicineProvider.hasError - ? Center( - child: Text( - _medicineProvider.errorMsg, - style: - TextStyle(color: Theme.of(context).errorColor), - ), - ) - : StreamBuilder( - stream: null, - builder: (context, snapshot) { - return Row( - children: [ - Expanded( - flex: 1, - child: ClipRRect( - borderRadius: - BorderRadius.all(Radius.circular(7)), - child: Image.memory( - dataFromBase64String(widget.url), - height: SizeConfig.imageSizeMultiplier * 21, - width: SizeConfig.imageSizeMultiplier * 20, - fit: BoxFit.cover, - ), - ), - ), - Expanded( - flex: 3, - child: Column( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: - CrossAxisAlignment.stretch, - children: [ - AppText( - "Description", - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 2, - fontWeight: FontWeight.bold, - ), - AppText( - _data[0]["ItemDescription"], - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 10, - ), - AppText( - "Price", - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 2, - fontWeight: FontWeight.bold, + shrinkWrap: true, + scrollDirection: Axis.vertical, + physics: const AlwaysScrollableScrollPhysics(), + children: [ + RoundedContainer( + child: !_medicineProvider.isFinished + ? DrAppCircularProgressIndeicator() + : _medicineProvider.hasError + ? Center( + child: Text( + _medicineProvider.errorMsg, + style: TextStyle( + color: Theme.of(context).errorColor), + ), + ) + : StreamBuilder( + stream: null, + builder: (context, snapshot) { + return Row( + children: [ + Expanded( + flex: 1, + child: ClipRRect( + borderRadius: BorderRadius.all( + Radius.circular(7)), + child: Image.memory( + dataFromBase64String(widget.url), + height: + SizeConfig.imageSizeMultiplier * + 21, + width: + SizeConfig.imageSizeMultiplier * + 20, + fit: BoxFit.cover, + ), ), - AppText( - _data[0]["SellingPrice"].toString(), - marginLeft: 10, - marginTop: 0, - marginRight: 10, - marginBottom: 10, + ), + Expanded( + flex: 3, + child: Column( + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.stretch, + children: [ + AppText( + TranslationBase.of(context) + .description, + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 2, + fontWeight: FontWeight.bold, + ), + AppText( + _data[0]["ItemDescription"], + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 10, + ), + AppText( + TranslationBase.of(context).price, + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 2, + fontWeight: FontWeight.bold, + ), + AppText( + _data[0]["SellingPrice"] + .toString(), + marginLeft: 10, + marginTop: 0, + marginRight: 10, + marginBottom: 10, + ), + ], ), - ], + ) + ], + ); + })), + Container( + margin: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 2, + bottom: SizeConfig.widthMultiplier * 2, + right: SizeConfig.widthMultiplier * 4, + left: SizeConfig.widthMultiplier * 4, + ), + child: Align( + alignment: Alignment.centerLeft, + child: AppText( + TranslationBase.of(context).youCanFindItIn, + fontWeight: FontWeight.bold, + ))), + Expanded( + child: Container( + width: SizeConfig.screenWidth * 0.99, + child: ListView.builder( + shrinkWrap: true, + physics: const NeverScrollableScrollPhysics(), + itemCount: _data == null ? 0 : _data.length, + itemBuilder: (BuildContext context, int index) { + return RoundedContainer( + child: Row( + children: [ + Expanded( + flex: 1, + child: ClipRRect( + borderRadius: + BorderRadius.all(Radius.circular(7)), + child: Image.network( + _data[index]["ProjectImageURL"], + height: + SizeConfig.imageSizeMultiplier * 15, + width: + SizeConfig.imageSizeMultiplier * 15, + fit: BoxFit.cover, ), - ) - ], - ); - })), - Container( - margin: EdgeInsets.only(top:SizeConfig.widthMultiplier * 2, - bottom: SizeConfig.widthMultiplier * 2, - right: SizeConfig.widthMultiplier * 4, - left: SizeConfig.widthMultiplier * 4,), - child: Align( - alignment: Alignment.centerLeft, - child: AppText( - "You can Find it in", - fontWeight: FontWeight.bold, - ))), - Expanded( - child: Container( - width: SizeConfig.screenWidth * 0.99, - child: ListView.builder( - shrinkWrap: true, - physics: const NeverScrollableScrollPhysics() , - itemCount: _data == null ? 0 : _data.length, - itemBuilder: (BuildContext context, int index) { - return RoundedContainer( - child: Row( - children: [ - Expanded( - flex: 1, - child: ClipRRect( - borderRadius: - BorderRadius.all(Radius.circular(7)), - child: Image.network( - _data[index]["ProjectImageURL"], - height: SizeConfig.imageSizeMultiplier * 15, - width: SizeConfig.imageSizeMultiplier * 15, - fit: BoxFit.cover, + ), ), - ), - ), - Expanded( - flex: 4, - child: AppText( - _data[index]["LocationDescription"], - margin: 10, - ), - ), - Expanded( - flex: 2, - child: Wrap( - direction: Axis.horizontal, - alignment: WrapAlignment.end, - crossAxisAlignment: WrapCrossAlignment.end, - children: [ - Padding( - padding: EdgeInsets.all(5), - child: InkWell( - child: Icon( - Icons.call, - color: Colors.red, - ), - onTap: () => launch( - "tel://" + _data[index]["PhoneNumber"]), - ), + Expanded( + flex: 4, + child: AppText( + _data[index]["LocationDescription"], + margin: 10, ), - Padding( - padding: EdgeInsets.all(5), - child: InkWell( - child: Icon( - Icons.pin_drop, - color: Colors.red, + ), + Expanded( + flex: 2, + child: Wrap( + direction: Axis.horizontal, + alignment: WrapAlignment.end, + crossAxisAlignment: WrapCrossAlignment.end, + children: [ + Padding( + padding: EdgeInsets.all(5), + child: InkWell( + child: Icon( + Icons.call, + color: Colors.red, + ), + onTap: () => launch("tel://" + + _data[index]["PhoneNumber"]), + ), ), - onTap: () { - MapsLauncher.launchCoordinates( - double.parse( - _data[index]["Latitude"]), - double.parse( - _data[index]["Longitude"]), - _data[index]["LocationDescription"]); - }, - ), + Padding( + padding: EdgeInsets.all(5), + child: InkWell( + child: Icon( + Icons.pin_drop, + color: Colors.red, + ), + onTap: () { + MapsLauncher.launchCoordinates( + double.parse( + _data[index]["Latitude"]), + double.parse( + _data[index]["Longitude"]), + _data[index] + ["LocationDescription"]); + }, + ), + ), + ], ), - ], - ), + ), + ], ), - ], - ), - ); - }), - ), - ) - ]), + ); + }), + ), + ) + ]), )); } diff --git a/lib/screens/patients/out_patient_prescription_details_screen.dart b/lib/screens/patients/out_patient_prescription_details_screen.dart index e87704b7..bd3834ab 100644 --- a/lib/screens/patients/out_patient_prescription_details_screen.dart +++ b/lib/screens/patients/out_patient_prescription_details_screen.dart @@ -9,6 +9,7 @@ import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.d import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; class OutPatientPrescriptionDetailsScreen extends StatefulWidget { final PrescriptionResModel prescriptionResModel; @@ -45,7 +46,7 @@ class _OutPatientPrescriptionDetailsScreenState @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: 'Prescription Details', + appBarTitle: TranslationBase.of(context).prescriptionDetails, body: patientsProvider.isLoading ? DrAppCircularProgressIndeicator() : patientsProvider.isError @@ -63,5 +64,3 @@ class _OutPatientPrescriptionDetailsScreenState ); } } - - diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index eec2c9a1..54eaf5ee 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -40,6 +40,7 @@ class _PatientSearchScreenState extends State { String error = ''; ProjectProvider projectsProvider; String itemText = ''; + String itemText2 = ''; final GlobalKey _formKey = GlobalKey(); bool _autoValidate = false; @@ -379,12 +380,19 @@ class _PatientSearchScreenState extends State { return Row( mainAxisSize: MainAxisSize.max, children: [ - AppText( - item['text'], - fontSize: - SizeConfig.textMultiplier * - 2.1, - ), + !projectsProvider.isArabic + ? AppText( + item['text'], + fontSize: SizeConfig + .textMultiplier * + 2.1, + ) + : AppText( + item['text-ar'], + fontSize: SizeConfig + .textMultiplier * + 2.1, + ) ], ); }).toList(); @@ -395,9 +403,12 @@ class _PatientSearchScreenState extends State { }) }, items: LOCATIONS.map((item) { + !projectsProvider.isArabic + ? itemText2 = item['text'] + : itemText2 = item['text-ar']; return DropdownMenuItem( child: Text( - '${item['text']}', + itemText2, textAlign: TextAlign.end, ), value: item['val'], diff --git a/lib/screens/patients/profile/patient_orders_screen.dart b/lib/screens/patients/profile/patient_orders_screen.dart index 30f61bf0..78b3b294 100644 --- a/lib/screens/patients/profile/patient_orders_screen.dart +++ b/lib/screens/patients/profile/patient_orders_screen.dart @@ -14,13 +14,14 @@ import '../../../util/dr_app_shared_pref.dart'; import '../../../widgets/shared/app_scaffold_widget.dart'; import '../../../widgets/shared/app_texts_widget.dart'; import '../../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); -/* - *@author: ibrahim albitar - *@Date:21/5/2020 - *@param: +/* + *@author: ibrahim albitar + *@Date:21/5/2020 + *@param: *@return: *@desc: */ @@ -37,10 +38,10 @@ class _PatientsOrdersState extends State { final _controller = TextEditingController(); var _isInit = true; - /* - *@author: ibrahim al bitar - *@Date:21/5/2020 - *@param: + /* + *@author: ibrahim al bitar + *@Date:21/5/2020 + *@param: *@return: *@desc: */ @@ -75,14 +76,14 @@ class _PatientsOrdersState extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: "Orders", + appBarTitle: TranslationBase.of(context).orders, body: patientsProv.isLoading ? DrAppCircularProgressIndeicator() : patientsProv.isError ? DrAppEmbeddedError(error: patientsProv.error) : notesList == null ? DrAppEmbeddedError( - error: 'You don\'t have any Orders') + error: TranslationBase.of(context).errorNoOrders) : Column( children: [ Container( @@ -93,8 +94,8 @@ class _PatientsOrdersState extends State { onChanged: (String str) { this.searchData(str); }, - decoration: - buildInputDecoration(context, 'Search Orders'), + decoration: buildInputDecoration(context, + TranslationBase.of(context).searchOrders), ), ), Expanded( @@ -116,7 +117,8 @@ class _PatientsOrdersState extends State { ExpansionTile( title: Container( child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ AppText( notesList[index] @@ -138,12 +140,12 @@ class _PatientsOrdersState extends State { ), children: [ Divider( - color: Colors.black, - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), + color: Colors.black, + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, + ), AppText( notesList[index]["Notes"], margin: 5, diff --git a/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart b/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart index 18251d79..5ca818bf 100644 --- a/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart +++ b/lib/screens/patients/profile/prescriptions/in_patient_prescription_details_screen.dart @@ -7,6 +7,7 @@ import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; class InpatientPrescriptionDetailsScreen extends StatefulWidget { @override @@ -40,7 +41,7 @@ class _InpatientPrescriptionDetailsScreenState @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: 'Prescription info', + appBarTitle: TranslationBase.of(context).prescriptionInfo, body: CardWithBgWidgetNew( widget: Container( child: ListView( diff --git a/lib/screens/patients/profile/radiology/radiology_report_screen.dart b/lib/screens/patients/profile/radiology/radiology_report_screen.dart index db0f7544..29544cdf 100644 --- a/lib/screens/patients/profile/radiology/radiology_report_screen.dart +++ b/lib/screens/patients/profile/radiology/radiology_report_screen.dart @@ -3,6 +3,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; class RadiologyReportScreen extends StatelessWidget { final String reportData; @@ -12,26 +13,22 @@ class RadiologyReportScreen extends StatelessWidget { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: "Radiology Report", + appBarTitle: TranslationBase.of(context).radiologyReport, body: Container( padding: EdgeInsets.all(10), margin: EdgeInsets.all(10), decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(10)), + borderRadius: BorderRadius.all(Radius.circular(10)), color: Colors.white, border: Border( - bottom: BorderSide( - color: Colors.grey, width: 0.5), - top: BorderSide( - color: Colors.grey, width: 0.5), - left: BorderSide( - color: Colors.grey, width: 0.5), - right: BorderSide( - color: Colors.grey, width: 0.5), + bottom: BorderSide(color: Colors.grey, width: 0.5), + top: BorderSide(color: Colors.grey, width: 0.5), + left: BorderSide(color: Colors.grey, width: 0.5), + right: BorderSide(color: Colors.grey, width: 0.5), ), ), - child: AppText(reportData, + child: AppText( + reportData, fontSize: 2.5 * SizeConfig.textMultiplier, ), ), diff --git a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart index e8d49c8f..7d00a7ae 100644 --- a/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart +++ b/lib/screens/patients/profile/vital_sign/vital_sign_details_screen.dart @@ -95,7 +95,8 @@ class _VitalSignDetailsScreenState extends State { Navigator.of(context).pushNamed( BODY_MEASUREMENTS, arguments: { - 'title': 'Body Measurements', + 'title': TranslationBase.of(context) + .bodyMeasurements, 'key': vitalSignDetails.bodyMeasurements }); @@ -118,7 +119,8 @@ class _VitalSignDetailsScreenState extends State { Navigator.of(context).pushNamed( BODY_MEASUREMENTS, arguments: { - 'title': 'Temperature', + 'title': TranslationBase.of(context) + .temperature, 'key': vitalSignDetails.temperature, }); }, @@ -144,7 +146,8 @@ class _VitalSignDetailsScreenState extends State { Navigator.of(context).pushNamed( BODY_MEASUREMENTS, arguments: { - 'title': 'pulse', + 'title': + TranslationBase.of(context).pulse, 'key': vitalSignDetails.pulse }); }, @@ -163,7 +166,8 @@ class _VitalSignDetailsScreenState extends State { Navigator.of(context).pushNamed( BODY_MEASUREMENTS, arguments: { - 'title': 'pespiration', + 'title': TranslationBase.of(context) + .respiration, 'key': vitalSignDetails.pespiration }); }, @@ -187,7 +191,8 @@ class _VitalSignDetailsScreenState extends State { Navigator.of(context).pushNamed( BODY_MEASUREMENTS, arguments: { - 'title': 'Blood Pressure', + 'title': TranslationBase.of(context) + .bloodPressure, 'key': vitalSignDetails.bloodPressure }); }, @@ -207,7 +212,8 @@ class _VitalSignDetailsScreenState extends State { Navigator.of(context).pushNamed( BODY_MEASUREMENTS, arguments: { - 'title': 'Oxygenation', + 'title': TranslationBase.of(context) + .oxygenation, 'key': vitalSignDetails.oxygenation }); }, @@ -231,7 +237,8 @@ class _VitalSignDetailsScreenState extends State { Navigator.of(context).pushNamed( BODY_MEASUREMENTS, arguments: { - 'title': 'Pain Scale', + 'title': TranslationBase.of(context) + .painScale, 'key': vitalSignDetails.painScale }); }, diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 64f302b2..33eadefb 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -164,6 +164,7 @@ class TranslationBase { String get fingerprint => localizedValues['fingerprint'][locale.languageCode]; String get faceId => localizedValues['faceId'][locale.languageCode]; String get whatsApp => localizedValues['whatsApp'][locale.languageCode]; + String get whatsAppBy => localizedValues['whatsAppBy'][locale.languageCode]; String get pleaseChoose => localizedValues['pleaseChoose'][locale.languageCode]; String get choose => localizedValues['choose'][locale.languageCode]; @@ -212,6 +213,23 @@ class TranslationBase { String get pleaseFill => localizedValues['pleaseFill'][locale.languageCode]; String get replay2 => localizedValues['replay2'][locale.languageCode]; String get outPatient => localizedValues['outPatient'][locale.languageCode]; + String get logout => localizedValues['logout'][locale.languageCode]; + String get pharmaciesList => + localizedValues['pharmaciesList'][locale.languageCode]; + String get price => localizedValues['price'][locale.languageCode]; + String get youCanFindItIn => + localizedValues['youCanFindItIn'][locale.languageCode]; + String get radiologyReport => + localizedValues['radiologyReport'][locale.languageCode]; + String get orders => localizedValues['orders'][locale.languageCode]; + String get searchOrders => + localizedValues['searchOrders'][locale.languageCode]; + String get prescriptionDetails => + localizedValues['prescriptionDetails'][locale.languageCode]; + String get prescriptionInfo => + localizedValues['prescriptionInfo'][locale.languageCode]; + String get errorNoOrders => + localizedValues['errorNoOrders'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/auth/verfiy_account.dart b/lib/widgets/auth/verfiy_account.dart index af3ed2e2..cd98d4dc 100644 --- a/lib/widgets/auth/verfiy_account.dart +++ b/lib/widgets/auth/verfiy_account.dart @@ -206,7 +206,7 @@ class _VerifyAccountState extends State { height: 50, child: Center( child: Text( - 'Verfiy'.toUpperCase(), + TranslationBase.of(context).verify, style: TextStyle( color: Colors.white, fontSize: @@ -293,7 +293,7 @@ class _VerifyAccountState extends State { medthodName = TranslationBase.of(context).smsBy; break; case 2: - medthodName = TranslationBase.of(context).whatsApp; + medthodName = TranslationBase.of(context).whatsAppBy; break; default: } diff --git a/lib/widgets/dashboard/dashboard_item_texts_widget.dart b/lib/widgets/dashboard/dashboard_item_texts_widget.dart index 4b6af402..cd52e064 100644 --- a/lib/widgets/dashboard/dashboard_item_texts_widget.dart +++ b/lib/widgets/dashboard/dashboard_item_texts_widget.dart @@ -1,3 +1,6 @@ +import 'package:doctor_app_flutter/providers/project_provider.dart'; +import 'package:provider/provider.dart'; + import '../shared/rounded_container_widget.dart'; import '../shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; @@ -17,18 +20,23 @@ class DashboardItemTexts extends StatefulWidget { {this.backgroundColor = Colors.white, this.showBorder = false, this.borderColor = Colors.white}); + @override _DashboardItemTextsState createState() => _DashboardItemTextsState(); } class _DashboardItemTextsState extends State { + ProjectProvider projectsProvider; @override Widget build(BuildContext context) { + projectsProvider = Provider.of(context); return new RoundedContainer( child: Stack( children: [ Align( - alignment: FractionalOffset.topLeft, + alignment: projectsProvider.isArabic + ? FractionalOffset.topRight + : FractionalOffset.topLeft, child: Container( margin: EdgeInsets.all(5), child: AppText( @@ -37,7 +45,9 @@ class _DashboardItemTextsState extends State { ), )), Align( - alignment: FractionalOffset.bottomRight, + alignment: projectsProvider.isArabic + ? FractionalOffset.bottomLeft + : FractionalOffset.bottomRight, child: Container( margin: EdgeInsets.all(10), child: AppText( diff --git a/lib/widgets/patients/profile/profile_medical_info_widget.dart b/lib/widgets/patients/profile/profile_medical_info_widget.dart index a1032862..4e3387a5 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -80,7 +80,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { key: key, patient: patient, route: PATIENT_ORDERS, - name: 'Orders', + name: TranslationBase.of(context).orders, icon: 'radiology-1.png')), ]); } diff --git a/lib/widgets/shared/app_drawer_widget.dart b/lib/widgets/shared/app_drawer_widget.dart index 71cba13b..eb1a2085 100644 --- a/lib/widgets/shared/app_drawer_widget.dart +++ b/lib/widgets/shared/app_drawer_widget.dart @@ -13,6 +13,7 @@ import '../../widgets/shared/drawer_item_widget.dart'; import '../../widgets/shared/rounded_container_widget.dart'; import 'app_texts_widget.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); @@ -100,7 +101,7 @@ class _AppDrawerState extends State { borderRadius: BorderRadius.circular(18.0), side: BorderSide(color: Colors.red)), child: AppText( - 'Logout', + TranslationBase.of(context).logout, color: Colors.white, ), onPressed: () async { @@ -122,14 +123,16 @@ class _AppDrawerState extends State { ), ), InkWell( - child: DrawerItem("Settings", Icons.settings), + child: DrawerItem( + TranslationBase.of(context).settings, Icons.settings), onTap: () { Navigator.pop(context); Navigator.of(context).pushNamed(SETTINGS); }, ), InkWell( - child: DrawerItem("QR Reader", DoctorApp.qr_code), + child: DrawerItem( + TranslationBase.of(context).qrReader, DoctorApp.qr_code), onTap: () { Navigator.pop(context); Navigator.of(context).pushNamed(QR_READER); From 89241460da78f8c9e6792d46f0e83f1d6eeabf2c Mon Sep 17 00:00:00 2001 From: Elham Rababah Date: Mon, 22 Jun 2020 15:28:29 +0300 Subject: [PATCH 4/8] change clinic name --- lib/providers/auth_provider.dart | 116 +++++++++++++++--------------- lib/screens/dashboard_screen.dart | 2 +- 2 files changed, 60 insertions(+), 58 deletions(-) diff --git a/lib/providers/auth_provider.dart b/lib/providers/auth_provider.dart index 11f1667f..22bd80f6 100644 --- a/lib/providers/auth_provider.dart +++ b/lib/providers/auth_provider.dart @@ -20,57 +20,58 @@ const GET_DOC_PROFILES = 'Doctors.svc/REST/GetDocProfiles'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); enum APP_STATUS { LOADING, UNAUTHENTICATED, AUTHENTICATED } - class AuthProvider with ChangeNotifier { - List doctorsClinicList=[]; - bool isLogin= false; + List doctorsClinicList = []; + String selectedClinicName; + bool isLogin = false; bool isLoading = true; - AuthProvider(){ + AuthProvider() { getUserAuthentication(); } - void getUserAuthentication() async{ + void getUserAuthentication() async { Map profile = await sharedPref.getObj(DOCTOR_PROFILE); - if(profile != null) - { - isLoading = false; - isLogin = true; - } else { - isLoading = false; - isLogin = false; + if (profile != null) { + isLoading = false; + isLogin = true; + } else { + isLoading = false; + isLogin = false; } notifyListeners(); } + APP_STATUS get stutas { if (isLoading) { return APP_STATUS.LOADING; - } else{ - if ( this.isLogin) { + } else { + if (this.isLogin) { return APP_STATUS.AUTHENTICATED; - } else { + } else { return APP_STATUS.UNAUTHENTICATED; } } } + Future login(UserModel userInfo) async { try { dynamic localRes; await BaseAppClient.post(LOGIN_URL, onSuccess: (dynamic response, int statusCode) { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: { - "UserID": userInfo.UserID, - "Password": userInfo.Password, - "ProjectID": userInfo.ProjectID, - "LanguageID": userInfo.LanguageID, - "IPAdress": userInfo.IPAdress, - "VersionID": userInfo.VersionID, - "Channel": userInfo.Channel, - "SessionID": userInfo.SessionID - }); + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: { + "UserID": userInfo.UserID, + "Password": userInfo.Password, + "ProjectID": userInfo.ProjectID, + "LanguageID": userInfo.LanguageID, + "IPAdress": userInfo.IPAdress, + "VersionID": userInfo.VersionID, + "Channel": userInfo.Channel, + "SessionID": userInfo.SessionID + }); return Future.value(localRes); } catch (error) { @@ -85,10 +86,10 @@ class AuthProvider with ChangeNotifier { await BaseAppClient.post(INSERT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: imei); + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: imei); return Future.value(localRes); } catch (error) { print(error); @@ -101,10 +102,10 @@ class AuthProvider with ChangeNotifier { dynamic localRes; await BaseAppClient.post(SELECT_DEVICE_IMEI, onSuccess: (dynamic response, int statusCode) { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: imei); + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: imei); return Future.value(localRes); } catch (error) { print(error); @@ -112,16 +113,15 @@ class AuthProvider with ChangeNotifier { } } - Future sendActivationCodeByOtpNotificationType( - activationCodeModel) async { + Future sendActivationCodeByOtpNotificationType(activationCodeModel) async { try { var localRes; await BaseAppClient.post(SEND_ACTIVATION_CODE_BY_OTP_NOTIFICATION_TYPE, onSuccess: (dynamic response, int statusCode) { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: activationCodeModel); + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: activationCodeModel); return Future.value(localRes); } catch (error) { print(error); @@ -134,15 +134,16 @@ class AuthProvider with ChangeNotifier { dynamic localRes; await BaseAppClient.post(MEMBER_CHECK_ACTIVATION_CODE_NEW, onSuccess: (dynamic response, int statusCode) { - localRes = response; - - response['List_DoctorsClinic'].forEach((v) { - doctorsClinicList.add(new ClinicModel.fromJson(v)); - }); - - }, onFailure: (String error, int statusCode) { - throw error; - }, body: activationCodeModel); + localRes = response; + selectedClinicName = + ClinicModel.fromJson(response['List_DoctorsClinic'][0]).clinicName; + notifyListeners(); + response['List_DoctorsClinic'].forEach((v) { + doctorsClinicList.add(new ClinicModel.fromJson(v)); + }); + }, onFailure: (String error, int statusCode) { + throw error; + }, body: activationCodeModel); return Future.value(localRes); } catch (error) { print(error); @@ -162,16 +163,17 @@ class AuthProvider with ChangeNotifier { dynamic localRes; await BaseAppClient.post(GET_DOC_PROFILES, onSuccess: (dynamic response, int statusCode) { - localRes = response; - }, onFailure: (String error, int statusCode) { - throw error; - }, body: docInfo); + localRes = response; + //ClinicDescription + selectedClinicName = response['DoctorProfileList'][0]['ClinicDescription']; + notifyListeners(); + }, onFailure: (String error, int statusCode) { + throw error; + }, body: docInfo); return Future.value(localRes); } catch (error) { print(error); throw error; } } - - } diff --git a/lib/screens/dashboard_screen.dart b/lib/screens/dashboard_screen.dart index b4448d23..fd4d0ffb 100644 --- a/lib/screens/dashboard_screen.dart +++ b/lib/screens/dashboard_screen.dart @@ -74,7 +74,7 @@ class _DashboardScreenState extends State { Container( margin: EdgeInsets.only(left: 10, top: 10), child: AppText( - TranslationBase.of(context).familyMedicine, + authProvider.selectedClinicName != null?authProvider.selectedClinicName:'', fontWeight: FontWeight.bold, fontSize: SizeConfig.textMultiplier * 2.5, ), From ee8d481504563d0b532d27472d0ef2a9f9ee2ab0 Mon Sep 17 00:00:00 2001 From: ibrahim albitar Date: Mon, 22 Jun 2020 15:30:02 +0300 Subject: [PATCH 5/8] live care web service --- lib/config/config.dart | 2 + .../statstics_for_certain_doctor_request.dart | 36 ++++++++++ lib/providers/doctors_provider.dart | 68 +++++++++++++++++++ 3 files changed, 106 insertions(+) create mode 100644 lib/models/doctor/statstics_for_certain_doctor_request.dart create mode 100644 lib/providers/doctors_provider.dart diff --git a/lib/config/config.dart b/lib/config/config.dart index d3f1e95d..4c9fab2c 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -27,6 +27,8 @@ const GET_PATIENT_LAB_OREDERS = const GET_PRESCRIPTION = 'Patients.svc/REST/GetPrescriptionApptList'; const GET_RADIOLOGY = 'DoctorApplication.svc/REST/GetPatientRadResult'; +const LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL = "Lists.svc/REST/DashBoard_GetLiveCareDoctorsStatsticsForCertainDoctor"; + var selectedPatientType = 1; //*********change value to decode json from Dropdown ************ diff --git a/lib/models/doctor/statstics_for_certain_doctor_request.dart b/lib/models/doctor/statstics_for_certain_doctor_request.dart new file mode 100644 index 00000000..08fa03f3 --- /dev/null +++ b/lib/models/doctor/statstics_for_certain_doctor_request.dart @@ -0,0 +1,36 @@ +class StatsticsForCertainDoctorRequest { + bool outSA; + int doctorID; + String tokenID; + int channel; + int projectID; + String generalid; + + StatsticsForCertainDoctorRequest( + {this.outSA, + this.doctorID, + this.tokenID, + this.channel, + this.projectID, + this.generalid}); + + StatsticsForCertainDoctorRequest.fromJson(Map json) { + outSA = json['OutSA']; + doctorID = json['DoctorID']; + tokenID = json['TokenID']; + channel = json['Channel']; + projectID = json['ProjectID']; + generalid = json['generalid']; + } + + Map toJson() { + final Map data = new Map(); + data['OutSA'] = this.outSA; + data['DoctorID'] = this.doctorID; + data['TokenID'] = this.tokenID; + data['Channel'] = this.channel; + data['ProjectID'] = this.projectID; + data['generalid'] = this.generalid; + return data; + } +} diff --git a/lib/providers/doctors_provider.dart b/lib/providers/doctors_provider.dart new file mode 100644 index 00000000..6ef4b7db --- /dev/null +++ b/lib/providers/doctors_provider.dart @@ -0,0 +1,68 @@ +import 'package:doctor_app_flutter/client/base_app_client.dart'; +import 'package:doctor_app_flutter/config/config.dart'; +import 'package:doctor_app_flutter/models/doctor/statstics_for_certain_doctor_request.dart'; +import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; +import 'package:doctor_app_flutter/util/helpers.dart'; +import 'package:flutter/cupertino.dart'; + +Helpers helpers = Helpers(); +DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); + +StatsticsForCertainDoctorRequest _statsticsForCertainDoctorRequest = StatsticsForCertainDoctorRequest(); + + +var certainDoctorsStasticsList = []; + +/*@author: ibrahem albitar + *@Date:22/6/2020 + *@desc: Doctor Provider + */ + +class DoctorsProvider with ChangeNotifier { + + bool isLoading = false; + bool isError = false; + String error = ''; + + resetDefaultValues() { + isLoading = true; + isError = false; + error = ''; + notifyListeners(); + } + + + /*@author: ibrahem albitar + *@Date:22/6/2020 + *@desc: StatsticsForCertainDoctor + */ + getStatsticsForCertainDoctor(String generalId) async { + resetDefaultValues(); + try { + _statsticsForCertainDoctorRequest.generalid = generalId; + await BaseAppClient.post(LIVE_CARE_STATISTICS_FOR_CERTAIN_DOCTOR_URL, + onSuccess: (dynamic response, int statusCode) { + certainDoctorsStasticsList = response['List_LiveCareCertainDoctorsStastics']; + isLoading = false; + isError = false; + this.error = ''; + }, onFailure: (String error, int statusCode) { + isLoading = false; + isError = true; + this.error = error; + }, body: _statsticsForCertainDoctorRequest.toJson()); + notifyListeners(); + } catch (err) { + handelCatchErrorCase(err); + } + } + + handelCatchErrorCase(err) { + isLoading = false; + isError = true; + error = helpers.generateContactAdminMsg(err); + notifyListeners(); + throw err; + } + +} \ No newline at end of file From c07f84ff78202848fa4c83d54004b29032e5ca46 Mon Sep 17 00:00:00 2001 From: ibrahim albitar Date: Tue, 23 Jun 2020 16:10:05 +0300 Subject: [PATCH 6/8] fixing and enhancments --- lib/screens/medicine/medicine_search_screen.dart | 4 ++++ .../patients/profile/insurance_approvals_screen.dart | 5 ++++- lib/screens/patients/profile/patient_orders_screen.dart | 5 ++++- lib/screens/patients/profile/progress_note_screen.dart | 5 ++++- lib/widgets/shared/app_text_form_field.dart | 6 +++++- 5 files changed, 21 insertions(+), 4 deletions(-) diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index 99bb44ca..5c8726d7 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -60,6 +60,10 @@ class _MedicineSearchState extends State { hintText: TranslationBase.of(context).searchMedicineNameHere, controller: myController, onSaved: (value) {}, + onFieldSubmitted: (value){ + searchMedicine(context); + }, + textInputAction: TextInputAction.search, inputFormatter: ONLY_LETTERS), ), Container( diff --git a/lib/screens/patients/profile/insurance_approvals_screen.dart b/lib/screens/patients/profile/insurance_approvals_screen.dart index 99db9a4f..a171a0e9 100644 --- a/lib/screens/patients/profile/insurance_approvals_screen.dart +++ b/lib/screens/patients/profile/insurance_approvals_screen.dart @@ -61,7 +61,9 @@ class _InsuranceApprovalsState extends State { patientTypeID: patient.patientType, languageID: 2); patientsProv - .getPatientInsuranceApprovals(insuranceApprovalsRequest.toJson()); + .getPatientInsuranceApprovals(insuranceApprovalsRequest.toJson()).then((c){ + approvalsList = patientsProv.insuranceApporvalsList; + }); } @override @@ -97,6 +99,7 @@ class _InsuranceApprovalsState extends State { onChanged: (String str) { this.searchData(str); }, + textInputAction: TextInputAction.done, decoration: buildInputDecoration( context, TranslationBase.of(context) diff --git a/lib/screens/patients/profile/patient_orders_screen.dart b/lib/screens/patients/profile/patient_orders_screen.dart index 78b3b294..8effd1f9 100644 --- a/lib/screens/patients/profile/patient_orders_screen.dart +++ b/lib/screens/patients/profile/patient_orders_screen.dart @@ -59,7 +59,9 @@ class _PatientsOrdersState extends State { tokenID: token, patientTypeID: patient.patientType, languageID: 2); - patientsProv.getPatientProgressNote(progressNoteRequest.toJson()); + patientsProv.getPatientProgressNote(progressNoteRequest.toJson()).then((c){ + notesList = patientsProv.patientProgressNoteList; + }); } @override @@ -94,6 +96,7 @@ class _PatientsOrdersState extends State { onChanged: (String str) { this.searchData(str); }, + textInputAction: TextInputAction.done, decoration: buildInputDecoration(context, TranslationBase.of(context).searchOrders), ), diff --git a/lib/screens/patients/profile/progress_note_screen.dart b/lib/screens/patients/profile/progress_note_screen.dart index a2aea154..90640c59 100644 --- a/lib/screens/patients/profile/progress_note_screen.dart +++ b/lib/screens/patients/profile/progress_note_screen.dart @@ -59,7 +59,9 @@ class _ProgressNoteState extends State { tokenID: token, patientTypeID: patient.patientType, languageID: 2); - patientsProv.getPatientProgressNote(progressNoteRequest.toJson()); + patientsProv.getPatientProgressNote(progressNoteRequest.toJson()).then((c){ + notesList = patientsProv.patientProgressNoteList; + }); } @override @@ -94,6 +96,7 @@ class _ProgressNoteState extends State { onChanged: (String str) { this.searchData(str); }, + textInputAction: TextInputAction.done, decoration: buildInputDecoration(context, TranslationBase.of(context).searchNote), ), diff --git a/lib/widgets/shared/app_text_form_field.dart b/lib/widgets/shared/app_text_form_field.dart index 06dfb9e7..b0b9a8ec 100644 --- a/lib/widgets/shared/app_text_form_field.dart +++ b/lib/widgets/shared/app_text_form_field.dart @@ -19,7 +19,9 @@ class AppTextFormField extends FormField { bool autovalidate = true, TextInputType textInputType, String hintText, - FocusNode focusNode + FocusNode focusNode, + TextInputAction textInputAction, + ValueChanged onFieldSubmitted, }) : super( onSaved: onSaved, validator: validator, @@ -34,6 +36,8 @@ class AppTextFormField extends FormField { onChanged: onChanged?? (value){ state.didChange(value); }, + textInputAction: textInputAction, + onFieldSubmitted: onFieldSubmitted, decoration: InputDecoration( hintText: hintText, hintStyle: TextStyle(fontSize: SizeConfig.textMultiplier * 2), From 000315ac0edf71cf3a3a35ea70882548a3b5e5a8 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Tue, 23 Jun 2020 16:50:30 +0300 Subject: [PATCH 7/8] translation 'updates' --- lib/client/base_app_client.dart | 12 ++++- lib/config/config.dart | 9 ++++ lib/config/localized_values.dart | 2 + lib/providers/hospital_provider.dart | 18 +++---- .../medicine/pharmacies_list_screen.dart | 30 +++++++----- lib/screens/patients/patients_screen.dart | 22 +++++++-- lib/screens/profile_screen.dart | 4 +- lib/util/translations_delegate_base.dart | 2 + pubspec.lock | 48 +++++++++---------- 9 files changed, 95 insertions(+), 52 deletions(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index 6e0914f8..e842430a 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -3,12 +3,15 @@ import 'dart:convert'; import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; +import 'package:doctor_app_flutter/providers/project_provider.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:http/http.dart' as http; +import 'package:provider/provider.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Helpers helpers = new Helpers(); +//ProjectProvider projectsProvider = new ProjectProvider(); /* *@author: Mohammad Aljammal @@ -38,6 +41,7 @@ class BaseAppClient { String token = await sharedPref.getString(TOKEN); if (profile != null) { DoctorProfileModel doctorProfile = DoctorProfileModel.fromJson(profile); + body['DoctorID'] = doctorProfile?.doctorID; body['EditedBy'] = doctorProfile?.doctorID; body['ProjectID'] = doctorProfile?.projectID; @@ -45,7 +49,13 @@ class BaseAppClient { body['ClinicID'] = doctorProfile?.clinicID; } body['TokenID'] = token ?? ''; - body['LanguageID'] = LANGUAGE_ID; + + String lang = await sharedPref.getString(APP_Language); + if (lang == 'ar' && lang == null) + body['LanguageID'] = 1; + else + body['LanguageID'] = 2; + body['stamp'] = STAMP; body['IPAdress'] = IP_ADDRESS; body['VersionID'] = VERSION_ID; diff --git a/lib/config/config.dart b/lib/config/config.dart index d3f1e95d..2ebba10f 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -57,6 +57,15 @@ var SERVICES_PATIANT_HEADER = [ "Tomorrow", "Referral" ]; +var SERVICES_PATIANT_HEADER_AR = [ + "المريض الخارجي", + "المريض المنوم", + "المريض المعافى", + "المريض المحول الي", + "المريض المحال المعافى", + "مريض الغد", + "المريض المحول مني" +]; //****************** // Colors ////// by : ibrahim diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 133dbfef..20ad3ca6 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -211,4 +211,6 @@ const Map> localizedValues = { 'en': 'You don\'t have any Orders', 'ar': 'لا يوجد لديك اي طلبات' }, + 'beingBad': {'en': 'being bad', 'ar': 'سيء'}, + 'beingGreat': {'en': 'being great', 'ar': 'راثع'}, }; diff --git a/lib/providers/hospital_provider.dart b/lib/providers/hospital_provider.dart index 547bffe2..a32e9516 100644 --- a/lib/providers/hospital_provider.dart +++ b/lib/providers/hospital_provider.dart @@ -6,7 +6,7 @@ class HospitalProvider with ChangeNotifier { Future getProjectsList() async { const url = GET_PROJECTS; var info = { - "LanguageID": 2, + "LanguageID": 1, "stamp": "2020-02-26T13:51:44.111Z", "IPAdress": "11.11.11.11", "VersionID": 1.2, @@ -15,17 +15,13 @@ class HospitalProvider with ChangeNotifier { "SessionID": "i1UJwCTSqt", "IsLoginForDoctorApp": true }; - dynamic localRes ; + dynamic localRes; - await BaseAppClient.post(url, - onSuccess: ( response, statusCode) async { - localRes= response; - }, - onFailure: (String error, int statusCode) { - throw error; - }, - body: info); + await BaseAppClient.post(url, onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: info); return Future.value(localRes); - } } diff --git a/lib/screens/medicine/pharmacies_list_screen.dart b/lib/screens/medicine/pharmacies_list_screen.dart index 598c3e08..2f42a8ea 100644 --- a/lib/screens/medicine/pharmacies_list_screen.dart +++ b/lib/screens/medicine/pharmacies_list_screen.dart @@ -3,6 +3,7 @@ import 'dart:typed_data'; import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/providers/medicine_provider.dart'; +import 'package:doctor_app_flutter/providers/project_provider.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -34,6 +35,7 @@ class _PharmaciesListState extends State { var _data; Helpers helpers = new Helpers(); MedicineProvider _medicineProvider; + ProjectProvider projectsProvider; bool _isInit = true; //bool _isOutOfStuck = false; @@ -50,6 +52,7 @@ class _PharmaciesListState extends State { @override Widget build(BuildContext context) { + projectsProvider = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).pharmaciesList, body: Container( @@ -139,18 +142,23 @@ class _PharmaciesListState extends State { ); })), Container( - margin: EdgeInsets.only( - top: SizeConfig.widthMultiplier * 2, - bottom: SizeConfig.widthMultiplier * 2, - right: SizeConfig.widthMultiplier * 4, - left: SizeConfig.widthMultiplier * 4, + margin: EdgeInsets.only( + top: SizeConfig.widthMultiplier * 2, + bottom: SizeConfig.widthMultiplier * 2, + right: SizeConfig.widthMultiplier * 4, + left: SizeConfig.widthMultiplier * 4, + ), + child: Align( + alignment: Alignment.centerLeft, + child: AppText( + TranslationBase.of(context).youCanFindItIn, + fontWeight: FontWeight.bold, ), - child: Align( - alignment: Alignment.centerLeft, - child: AppText( - TranslationBase.of(context).youCanFindItIn, - fontWeight: FontWeight.bold, - ))), + ), + alignment: projectsProvider.isArabic + ? Alignment.topRight + : Alignment.topLeft, + ), Expanded( child: Container( width: SizeConfig.screenWidth * 0.99, diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index fef6567a..5e64a805 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -12,6 +12,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; import 'package:doctor_app_flutter/models/patient/topten_users_res_model.dart'; import 'package:doctor_app_flutter/providers/patients_provider.dart'; +import 'package:doctor_app_flutter/providers/project_provider.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget.dart'; @@ -53,7 +54,8 @@ class _PatientsScreenState extends State { final String assetName = 'assets/image.svg'; // List _locations = ['Today', 'Old Date', 'YESTERDAY']; - List _locations = ['All', 'Today', 'Tomorrow', 'Next Week']; + List _locations = []; //['All', 'Today', 'Tomorrow', 'Next Week']; + int _activeLocation = 0; bool _isInit = true; @@ -63,6 +65,7 @@ class _PatientsScreenState extends State { bool _isError = true; String error = ""; + ProjectProvider projectsProvider; final _controller = TextEditingController(); @@ -71,12 +74,18 @@ class _PatientsScreenState extends State { @override void didChangeDependencies() { + projectsProvider = Provider.of(context); + final routeArgs = ModalRoute.of(context).settings.arguments as Map; patient = routeArgs['patientSearchForm']; patientType = routeArgs['selectedType']; - patientTypetitle = SERVICES_PATIANT_HEADER[int.parse(patientType)]; + + if (!projectsProvider.isArabic) + patientTypetitle = SERVICES_PATIANT_HEADER[int.parse(patientType)]; + else + patientTypetitle = SERVICES_PATIANT_HEADER_AR[int.parse(patientType)]; print(patientType); @@ -296,6 +305,12 @@ class _PatientsScreenState extends State { */ @override Widget build(BuildContext context) { + _locations = [ + TranslationBase.of(context).all, + TranslationBase.of(context).today, + TranslationBase.of(context).tomorrow, + TranslationBase.of(context).nextWeek, + ]; PatientsProvider patientsProv = Provider.of(context); return AppScaffold( @@ -539,7 +554,8 @@ class _PatientsScreenState extends State { ], ) : AppText( - item.nationalityName, + item.nationalityName ?? + item.nationalityNameN, fontSize: 2.5 * SizeConfig.textMultiplier, diff --git a/lib/screens/profile_screen.dart b/lib/screens/profile_screen.dart index fa9869ad..283649aa 100644 --- a/lib/screens/profile_screen.dart +++ b/lib/screens/profile_screen.dart @@ -78,8 +78,8 @@ class _ProfileScreenState extends State { Icons.crop_square, color: Colors.black, subTitle: doctorProfile.doctorRate == 0 - ? "being bad" - : "being great", + ? TranslationBase.of(context).beingBad + : TranslationBase.of(context).beingGreat, ), ], ), diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 33eadefb..822e74c7 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -230,6 +230,8 @@ class TranslationBase { localizedValues['prescriptionInfo'][locale.languageCode]; String get errorNoOrders => localizedValues['errorNoOrders'][locale.languageCode]; + String get beingBad => localizedValues['beingBad'][locale.languageCode]; + String get beingGreat => localizedValues['beingGreat'][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/pubspec.lock b/pubspec.lock index cafaf489..71445e35 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -127,13 +127,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "7.1.0" - characters: - dependency: transitive - description: - name: characters - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.0" charcode: dependency: transitive description: @@ -162,13 +155,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.0.2" - clock: - dependency: transitive - description: - name: clock - url: "https://pub.dartlang.org" - source: hosted - version: "1.0.1" code_builder: dependency: transitive description: @@ -260,13 +246,6 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "4.1.4" - fake_async: - dependency: transitive - description: - name: fake_async - url: "https://pub.dartlang.org" - source: hosted - version: "1.1.0" fixnum: dependency: transitive description: @@ -371,6 +350,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "3.1.4" + image: + dependency: transitive + description: + name: image + url: "https://pub.dartlang.org" + source: hosted + version: "2.1.12" imei_plugin: dependency: "direct main" description: @@ -482,7 +468,7 @@ packages: name: path url: "https://pub.dartlang.org" source: hosted - version: "1.7.0" + version: "1.6.4" pedantic: dependency: transitive description: @@ -511,6 +497,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "2.0.0" + petitparser: + dependency: transitive + description: + name: petitparser + url: "https://pub.dartlang.org" + source: hosted + version: "2.4.0" platform: dependency: transitive description: @@ -683,7 +676,7 @@ packages: name: test_api url: "https://pub.dartlang.org" source: hosted - version: "0.2.16" + version: "0.2.15" timing: dependency: transitive description: @@ -747,6 +740,13 @@ packages: url: "https://pub.dartlang.org" source: hosted version: "1.1.0" + xml: + dependency: transitive + description: + name: xml + url: "https://pub.dartlang.org" + source: hosted + version: "3.6.1" yaml: dependency: transitive description: @@ -755,5 +755,5 @@ packages: source: hosted version: "2.2.1" sdks: - dart: ">=2.9.0-14.0.dev <3.0.0" + dart: ">=2.7.0 <3.0.0" flutter: ">=1.12.13+hotfix.5 <2.0.0" From 3ef9ca1a0492151c27e4b6caf84e7bce50bcd655 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Wed, 24 Jun 2020 10:21:00 +0300 Subject: [PATCH 8/8] Json data translation --- lib/client/base_app_client.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/client/base_app_client.dart b/lib/client/base_app_client.dart index e842430a..edd8802f 100644 --- a/lib/client/base_app_client.dart +++ b/lib/client/base_app_client.dart @@ -51,7 +51,7 @@ class BaseAppClient { body['TokenID'] = token ?? ''; String lang = await sharedPref.getString(APP_Language); - if (lang == 'ar' && lang == null) + if (lang != null && lang == 'ar') body['LanguageID'] = 1; else body['LanguageID'] = 2;