From 91ffdabd730fb80ab4de38db394c72de9122a265 Mon Sep 17 00:00:00 2001 From: hussam al-habibeh Date: Sun, 21 Jun 2020 16:38:27 +0300 Subject: [PATCH] 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);