diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 33f184d2..6577d31e 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -56,4 +56,44 @@ const Map> localizedValues = { 'en': 'Only Arrived Patient', 'ar': 'المريض الذي حضر للموعد' }, + 'searchMedicineNameHere': { + 'en': 'Search Medicine Name Here', + 'ar': 'ابحث عن الدواء هنا' + }, + 'youCanFind': {'en': 'You Can Find', 'ar': 'تستطيع ان تجد '}, + 'itemsInSearch': {'en': 'items in search', 'ar': 'عناصر في البحث'}, + 'qrReader': {'en': 'QR Reader', 'ar': 'قارىء رمز الQR'}, + 'startScanning': {'en': 'Start Scanning', 'ar': 'بدء المسح'}, + 'scanQrCode': { + 'en': 'scan Qr code to retrieve patient profile', + 'ar': 'مسح رمزاال QR لاسترداد ملف تعريف المريض ' + }, + 'scanQr': {'en': 'Scan Qr', 'ar': 'اقراء ال QR'}, + 'profile': {'en': 'Profile', 'ar': 'ملفي الشخصي'}, + 'gender': {'en': 'Gender', 'ar': 'الجنس'}, + 'clinic': {'en': 'Clinic', 'ar': 'العيادة'}, + 'hospital': {'en': 'Hospital', 'ar': 'المستشفى'}, + 'speciality': {'en': 'Speciality', 'ar': 'التخصص'}, + 'errorMessage': {'en': 'Something went wrong', 'ar': 'حدث خطأ ما'}, + 'patientProfile': {'en': 'Patient Profile', 'ar': 'ملف المريض'}, + 'vitalSign': {'en': 'Vital Sign', 'ar': 'المؤشرات الحيوية'}, + 'labOrder': {'en': 'Lab Order', 'ar': 'نتائج التحاليل'}, + 'prescription': {'en': 'Prescription', 'ar': 'الوصفات'}, + 'insuranceApprovals': {'en': 'Insurance Approvals', 'ar': 'موافقات التأمين'}, + 'bodyMeasurements': {'en': 'Body Measurements', 'ar': 'قياسات الجسم'}, + 'temperature': {'en': 'Temperature', 'ar': 'درجة الحرارة'}, + 'pulse': {'en': 'Pulse', 'ar': 'النبض'}, + 'respiration': {'en': 'Respiration', 'ar': 'التنفس'}, + 'bloodPressure': {'en': 'Blood Pressure', 'ar': 'ضغط الدم'}, + 'oxygenation': {'en': 'Oxygenation', 'ar': 'الأوكسجين'}, + 'painScale': {'en': 'Pain Scale', 'ar': 'مقياس الألم'}, + 'errorNoVitalSign': { + 'en': 'You don\'t have any Vital Sign', + 'ar': 'ليس لديك اي اعراض حيوية' + }, + 'labOrders': {'en': 'Lab Orders', 'ar': 'الفحوصات الطبية'}, + 'errorNoLabOrders': { + 'en': 'You don\'t have any lab orders', + 'ar': 'ليس لديك اي فحوصات طبية' + }, }; diff --git a/lib/lookups/patient_lookup.dart b/lib/lookups/patient_lookup.dart index 0d58a407..5db5fd96 100644 --- a/lib/lookups/patient_lookup.dart +++ b/lib/lookups/patient_lookup.dart @@ -1,11 +1,15 @@ const PATIENT_TYPE = const [ - {"text": "outPatiant", "val": "0"}, - {"text": "InPatiant", "val": "1"}, - {"text": "Discharge", "val": "2"}, - {"text": "Referrd", "val": "3"}, - {"text": "Referral Discharge", "val": "4"}, - {"text": "Tomorrow Patient", "val": "5"}, - {"text": "Referral", "val": "6"}, + {"text": "outPatiant", "text_ar": "المريض الخارجي", "val": "0"}, + {"text": "InPatiant", "text_ar": "المريض المنوم", "val": "1"}, + {"text": "Discharge", "text_ar": "المريض المعافى", "val": "2"}, + {"text": "Referrd", "text_ar": "المريض المحول الي", "val": "3"}, + { + "text": "Referral Discharge", + "text_ar": "المريض المحال المعافى", + "val": "4" + }, + {"text": "Tomorrow Patient", "text_ar": "مريض الغد", "val": "5"}, + {"text": "Referral", "text_ar": "المريض المحول مني", "val": "6"}, ]; const LOCATIONS = const [ diff --git a/lib/screens/QR_reader_screen.dart b/lib/screens/QR_reader_screen.dart index 27afd2ee..d89000ef 100644 --- a/lib/screens/QR_reader_screen.dart +++ b/lib/screens/QR_reader_screen.dart @@ -15,6 +15,7 @@ import 'package:doctor_app_flutter/widgets/shared/card_with_bg_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'; import '../routes.dart'; @@ -55,7 +56,7 @@ class _QrReaderScreenState extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: "QR Reader", + appBarTitle: TranslationBase.of(context).qrReader, body: Center( child: Container( margin: EdgeInsets.only(top: SizeConfig.realScreenHeight / 7), @@ -64,7 +65,7 @@ class _QrReaderScreenState extends State { child: ListView( children: [ AppText( - 'Start Scanning', + TranslationBase.of(context).startScanning, fontSize: 18, fontWeight: FontWeight.bold, textAlign: TextAlign.center, @@ -72,12 +73,10 @@ class _QrReaderScreenState extends State { SizedBox( height: 7, ), - AppText( - 'scan Qr code to retrieve patient profile', + AppText(TranslationBase.of(context).scanQrCode, fontSize: 14, fontWeight: FontWeight.w400, - textAlign: TextAlign.center - ), + textAlign: TextAlign.center), SizedBox( height: 15, ), @@ -92,24 +91,31 @@ class _QrReaderScreenState extends State { onTap: () { _scanQrAndGetPatient(context); }, - title: 'Scan Qr', + title: TranslationBase.of(context).scanQr, loading: isLoading, icon: Image.asset('assets/images/qr_code_white.png'), ), - isError ? Container( - margin: EdgeInsets.only(top: 8), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(6.0), - color: Theme.of(context).errorColor.withOpacity(0.06), - ), - padding: EdgeInsets.symmetric(vertical: 8.0, horizontal: 12.0), - child: Row( - children: [ - Expanded(child: AppText(error ?? "Something went wrong.", color: Theme.of(context).errorColor)), - ], - ), - ):Container(), - + isError + ? Container( + margin: EdgeInsets.only(top: 8), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(6.0), + color: Theme.of(context).errorColor.withOpacity(0.06), + ), + padding: EdgeInsets.symmetric( + vertical: 8.0, horizontal: 12.0), + child: Row( + children: [ + Expanded( + child: AppText( + error ?? + TranslationBase.of(context) + .errorMessage, + color: Theme.of(context).errorColor)), + ], + ), + ) + : Container(), ], ), ), @@ -118,7 +124,6 @@ class _QrReaderScreenState extends State { ); } - _scanQrAndGetPatient(BuildContext context) async { /// When give qr we will change this method to get data /// var result = await BarcodeScanner.scan(); @@ -151,7 +156,8 @@ class _QrReaderScreenState extends State { case "0": if (response['List_MyOutPatient'] != null) { setState(() { - patientList = ModelResponse.fromJson(response['List_MyOutPatient']).list; + patientList = + ModelResponse.fromJson(response['List_MyOutPatient']).list; isLoading = false; }); Navigator.of(context).pushNamed(PATIENTS_PROFILE, arguments: { @@ -168,7 +174,8 @@ class _QrReaderScreenState extends State { case "1": if (response['List_MyInPatient'] != null) { setState(() { - patientList = ModelResponse.fromJson(response['List_MyInPatient']).list; + patientList = + ModelResponse.fromJson(response['List_MyInPatient']).list; isLoading = false; error = ""; }); @@ -189,10 +196,10 @@ class _QrReaderScreenState extends State { isLoading = false; isError = true; }); - DrAppToastMsg.showErrorToast(response['ErrorEndUserMessage'] ?? response['ErrorMessage']); - + DrAppToastMsg.showErrorToast( + response['ErrorEndUserMessage'] ?? response['ErrorMessage']); } - }).catchError((error){ + }).catchError((error) { setState(() { isLoading = false; }); diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index 368a4bd1..99bb44ca 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -14,6 +14,7 @@ import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indei import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import '../../util/extenstions.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; DrAppSharedPreferances sharedPref = DrAppSharedPreferances(); @@ -46,22 +47,21 @@ class _MedicineSearchState extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: "Search Medicine", + appBarTitle: TranslationBase.of(context).searchMedicine, body: Column( children: [ - Padding( - padding: EdgeInsets.only( - bottom: SizeConfig.heightMultiplier * 1, - right: SizeConfig.heightMultiplier * 2, - left: SizeConfig.heightMultiplier * 2, - top: SizeConfig.heightMultiplier * 3), - child: AppTextFormField( - hintText: 'Search Medicine Name Here..', - controller: myController, - onSaved: (value) {}, - inputFormatter: ONLY_LETTERS), - ), - + Padding( + padding: EdgeInsets.only( + bottom: SizeConfig.heightMultiplier * 1, + right: SizeConfig.heightMultiplier * 2, + left: SizeConfig.heightMultiplier * 2, + top: SizeConfig.heightMultiplier * 3), + child: AppTextFormField( + hintText: TranslationBase.of(context).searchMedicineNameHere, + controller: myController, + onSaved: (value) {}, + inputFormatter: ONLY_LETTERS), + ), Container( margin: EdgeInsets.only( bottom: SizeConfig.heightMultiplier * 1, @@ -72,7 +72,7 @@ class _MedicineSearchState extends State { alignment: WrapAlignment.center, children: [ AppButton( - title: "Search", + title: TranslationBase.of(context).search, color: Color(PRIMARY_COLOR), onPressed: () { searchMedicine(context); @@ -87,9 +87,9 @@ class _MedicineSearchState extends State { crossAxisAlignment: CrossAxisAlignment.start, children: [ AppText( - "You find " + + TranslationBase.of(context).youCanFind + (data == null ? "0" : data.length.toString()) + - " items in search", + TranslationBase.of(context).itemsInSearch, fontWeight: FontWeight.bold, margin: 5, ), @@ -127,7 +127,9 @@ class _MedicineSearchState extends State { ChangeNotifierProvider( create: (_) => MedicineProvider(), child: PharmaciesListScreen( - itemID: data[index]["ItemID"], url: data[index]["ProductImageBase64"]), + itemID: data[index]["ItemID"], + url: data[index] + ["ProductImageBase64"]), ), ), ); diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index f020ca2e..dbb937a2 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -1,5 +1,6 @@ import 'package:doctor_app_flutter/config/shared_pref_kay.dart'; import 'package:doctor_app_flutter/models/patient/patient_model.dart'; +import 'package:doctor_app_flutter/providers/project_provider.dart'; import 'package:doctor_app_flutter/routes.dart'; import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; @@ -19,6 +20,7 @@ import '../../widgets/patients/dynamic_elements.dart'; import '../../config/config.dart'; import '../../models/doctor_profile_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; +import 'package:provider/provider.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); Helpers helpers = Helpers(); @@ -36,6 +38,8 @@ class _PatientSearchScreenState extends State { String _selectedType = '1'; String _selectedLocation = '1'; String error = ''; + ProjectProvider projectsProvider; + String itemText = ''; final GlobalKey _formKey = GlobalKey(); bool _autoValidate = false; @@ -112,6 +116,7 @@ class _PatientSearchScreenState extends State { @override Widget build(BuildContext context) { + projectsProvider = Provider.of(context); return AppScaffold( appBarTitle: TranslationBase.of(context).searchPatient, body: ListView( @@ -174,12 +179,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(); @@ -192,9 +204,12 @@ class _PatientSearchScreenState extends State { }) }, items: PATIENT_TYPE.map((item) { + !projectsProvider.isArabic + ? itemText = item['text'] + : itemText = item['text_ar']; return DropdownMenuItem( child: Text( - '${item['text']}', + itemText, textAlign: TextAlign.end, ), value: item['val'], diff --git a/lib/screens/patients/profile/insurance_approvals_screen.dart b/lib/screens/patients/profile/insurance_approvals_screen.dart index 2bb59318..c4dba964 100644 --- a/lib/screens/patients/profile/insurance_approvals_screen.dart +++ b/lib/screens/patients/profile/insurance_approvals_screen.dart @@ -15,6 +15,7 @@ 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(); @@ -77,7 +78,7 @@ class _InsuranceApprovalsState extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: "Insurance Approvals", + appBarTitle: TranslationBase.of(context).insuranceApprovals, body: patientsProv.isLoading ? DrAppCircularProgressIndeicator() : patientsProv.isError @@ -128,9 +129,12 @@ class _InsuranceApprovalsState extends State { : approvalsList[index][ "ApprovalStatusDescption"] .toString() - .contains("Cancelled") - ? DoctorApp.reject_icon - : DoctorApp.pending_icon, + .contains( + "Cancelled") + ? DoctorApp + .reject_icon + : DoctorApp + .pending_icon, color: approvalsList[index][ "ApprovalStatusDescption"] .toString() @@ -139,13 +143,18 @@ class _InsuranceApprovalsState extends State { : approvalsList[index][ "ApprovalStatusDescption"] .toString() - .contains("Cancelled") + .contains( + "Cancelled") ? Colors.red : Colors.yellow, ), - AppText(approvalsList[index]["ApprovalStatusDescption"], - fontSize: SizeConfig.textMultiplier * 1.5, - color: approvalsList[index][ + AppText( + approvalsList[index][ + "ApprovalStatusDescption"], + fontSize: SizeConfig + .textMultiplier * + 1.5, + color: approvalsList[index][ "ApprovalStatusDescption"] .toString() .contains("Approved") @@ -153,9 +162,11 @@ class _InsuranceApprovalsState extends State { : approvalsList[index][ "ApprovalStatusDescption"] .toString() - .contains("Cancelled") + .contains( + "Cancelled") ? Colors.red - : Colors.yellow,) + : Colors.yellow, + ) ], ), Expanded( @@ -204,31 +215,30 @@ class _InsuranceApprovalsState extends State { backgroundColor: Color(PRIMARY_COLOR), child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ - AppText( - approvalsList[index] - ["ApprovalNo"] - .toString(), - color: Colors.white, - fontSize: 19, - fontWeight: - FontWeight.bold, - marginTop: 10, - marginLeft: 10, - marginRight: 10, - marginBottom: 2, - ), - - AppText( - "Approval No:", - color: Colors.white, - fontSize: 16, - marginTop: 2, - marginLeft: 10, - marginBottom: 15, - marginRight: 10, - ), + AppText( + approvalsList[index] + ["ApprovalNo"] + .toString(), + color: Colors.white, + fontSize: 19, + fontWeight: FontWeight.bold, + marginTop: 10, + marginLeft: 10, + marginRight: 10, + marginBottom: 2, + ), + AppText( + "Approval No:", + color: Colors.white, + fontSize: 16, + marginTop: 2, + marginLeft: 10, + marginBottom: 15, + marginRight: 10, + ), Row( children: [ Expanded( @@ -241,24 +251,34 @@ class _InsuranceApprovalsState extends State { AppText( "PRODUCER NAME", fontSize: 10, - color: Colors.white, + color: + Colors.white, marginLeft: SizeConfig .widthMultiplier * 3, ), - AppText(checkList(approvalsList[index]["ApporvalDetails"])? - approvalsList[index] + AppText( + checkList(approvalsList[ + index] [ - "ApporvalDetails"][0] - [ - "ProcedureName"] : "", + "ApporvalDetails"]) + ? approvalsList[ + index] + [ + "ApporvalDetails"][0] + [ + "ProcedureName"] + : "", fontSize: 12, - fontWeight: FontWeight.bold, + fontWeight: + FontWeight + .bold, marginLeft: SizeConfig .widthMultiplier * 3, marginTop: 3, - color: Colors.white, + color: + Colors.white, ), ], ), @@ -273,22 +293,26 @@ class _InsuranceApprovalsState extends State { AppText( "STATUS", fontSize: 10, - color: Colors.white, + color: + Colors.white, marginLeft: SizeConfig .widthMultiplier * 9, ), AppText( - approvalsList[index] - [ + approvalsList[ + index][ "ApprovalStatusDescption"], fontSize: 12, - fontWeight: FontWeight.bold, + fontWeight: + FontWeight + .bold, marginLeft: SizeConfig .widthMultiplier * 9, marginTop: 3, - color: Colors.white, + color: + Colors.white, ), ], ), @@ -307,7 +331,8 @@ class _InsuranceApprovalsState extends State { AppText( "RECEIPT ON", fontSize: 10, - color: Colors.white, + color: + Colors.white, marginLeft: SizeConfig .widthMultiplier * 3, @@ -316,16 +341,25 @@ class _InsuranceApprovalsState extends State { 1.5, ), AppText( - convertDateFormat( approvalsList[index] - ["ReceiptOn"]), + convertDateFormat( + approvalsList[ + index] + [ + "ReceiptOn"]), fontSize: 12, - fontWeight: FontWeight.bold, + fontWeight: + FontWeight + .bold, marginLeft: SizeConfig .widthMultiplier * 3, marginTop: 3, - marginBottom: SizeConfig.heightMultiplier*2, - color: Colors.white, + marginBottom: + SizeConfig + .heightMultiplier * + 2, + color: + Colors.white, ), ], ), @@ -340,7 +374,8 @@ class _InsuranceApprovalsState extends State { AppText( "EXPIRY DATE", fontSize: 10, - color: Colors.white, + color: + Colors.white, marginTop: SizeConfig .heightMultiplier * 1.5, @@ -351,16 +386,23 @@ class _InsuranceApprovalsState extends State { AppText( convertDateFormat( approvalsList[ - index][ + index] + [ "ExpiryDate"]), fontSize: 12, - fontWeight: FontWeight.bold, + fontWeight: + FontWeight + .bold, marginLeft: SizeConfig .widthMultiplier * 9, marginTop: 3, - marginBottom: SizeConfig.heightMultiplier*2, - color: Colors.white, + marginBottom: + SizeConfig + .heightMultiplier * + 2, + color: + Colors.white, ), ], ), @@ -434,7 +476,8 @@ class _InsuranceApprovalsState extends State { return newDate.toString(); } - bool checkList(List list){ + + bool checkList(List list) { return list.length > 0 ? true : false; } } diff --git a/lib/screens/patients/profile/lab_result/lab_orders_screen.dart b/lib/screens/patients/profile/lab_result/lab_orders_screen.dart index b0a4a13d..ce50504c 100644 --- a/lib/screens/patients/profile/lab_result/lab_orders_screen.dart +++ b/lib/screens/patients/profile/lab_result/lab_orders_screen.dart @@ -18,6 +18,7 @@ import '../../../../widgets/shared/card_with_bg_widget.dart'; import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; import '../../../../widgets/shared/profile_image_widget.dart'; import 'lab_result_secreen.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); @@ -72,13 +73,14 @@ class _LabOrdersScreenState extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: "Lab Orders", + appBarTitle: TranslationBase.of(context).labOrders, body: patientsProv.isLoading ? DrAppCircularProgressIndeicator() : patientsProv.isError ? DrAppEmbeddedError(error: patientsProv.error) : patientsProv.patientLabResultOrdersList.length == 0 - ? DrAppEmbeddedError(error: 'You don\'t have any Orders') + ? DrAppEmbeddedError( + error: TranslationBase.of(context).errorNoLabOrders) : Container( margin: EdgeInsets.fromLTRB( SizeConfig.realScreenWidth * 0.05, diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 2ee3d939..d95eb766 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import '../../../widgets/patients/profile/patient_profile_widget.dart'; import '../../../widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; class PatientProfileScreen extends StatelessWidget { const PatientProfileScreen({Key key}) : super(key: key); @@ -9,7 +10,7 @@ class PatientProfileScreen extends StatelessWidget { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: 'Patient Profile', + appBarTitle: TranslationBase.of(context).patientProfile, body: PatientProfileWidget(), ); } diff --git a/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart b/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart index b2ee2f48..39e809e3 100644 --- a/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart +++ b/lib/screens/patients/profile/prescriptions/prescriptions_screen.dart @@ -17,6 +17,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 '../../../../widgets/shared/errors/dr_app_embedded_error.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); @@ -83,7 +84,7 @@ class _PrescriptionScreenState extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: "Prescriptions", + appBarTitle: TranslationBase.of(context).prescription, body: patientsProv.isLoading ? DrAppCircularProgressIndeicator() : patientsProv.isError diff --git a/lib/screens/patients/profile/radiology/radiology_screen.dart b/lib/screens/patients/profile/radiology/radiology_screen.dart index 4b47956c..19962c43 100644 --- a/lib/screens/patients/profile/radiology/radiology_screen.dart +++ b/lib/screens/patients/profile/radiology/radiology_screen.dart @@ -15,6 +15,7 @@ import '../../../../widgets/shared/app_texts_widget.dart'; import '../../../../widgets/shared/card_with_bg_widget.dart'; import '../../../../widgets/shared/dr_app_circular_progress_Indeicator.dart'; import '../../../../widgets/shared/profile_image_widget.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); @@ -75,116 +76,124 @@ class _RadiologyScreenState extends State { @override Widget build(BuildContext context) { return AppScaffold( - appBarTitle: "Radiology", + appBarTitle: TranslationBase.of(context).radiology, body: patientsProv.isLoading ? DrAppCircularProgressIndeicator() : patientsProv.isError - ? DrAppEmbeddedError(error: patientsProv.error) - : patientsProv.patientRadiologyList.length == 0 - ? DrAppEmbeddedError(error: 'You don\'t have any Vital Sign') - : Container( - margin: EdgeInsets.fromLTRB( - SizeConfig.realScreenWidth * 0.05, - 0, - SizeConfig.realScreenWidth * 0.05, - 0), - child: Container( - margin: EdgeInsets.symmetric(vertical: 10), - decoration: BoxDecoration( - color: Colors.white, - borderRadius: BorderRadius.all( - Radius.circular(20.0), - ), - ), - child: ListView.builder( - itemCount: patientsProv.patientRadiologyList.length, - itemBuilder: (BuildContext context, int index) { - return InkWell( - onTap: () { - Navigator.push( - context, - MaterialPageRoute(builder: (context) => RadiologyReportScreen(reportData: patientsProv.patientRadiologyList[index].reportData,)),); - }, - child: Container( - padding: EdgeInsets.all(10), - margin: EdgeInsets.all(10), - decoration: BoxDecoration( - borderRadius: - BorderRadius.all(Radius.circular(10)), - 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), - ), - ), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - Row( - children: [ - LargeAvatar( - url: patientsProv - .patientRadiologyList[index] - .doctorImageURL, - ), - Expanded( - child: Padding( - padding: - const EdgeInsets.fromLTRB( - 8, 0, 0, 0), - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - AppText( - '${patientsProv.patientRadiologyList[index].doctorName}', - fontSize: 2.5 * - SizeConfig - .textMultiplier, - fontWeight: - FontWeight.bold), - SizedBox( - height: 8, - ), - AppText( - 'Invoice No:${patientsProv.patientRadiologyList[index].invoiceNo}', - fontSize: 2 * - SizeConfig - .textMultiplier, - ), - SizedBox( - height: 8, - ), - AppText( - ' ${patientsProv.patientRadiologyList[index].clinicName}', - fontSize: 2 * - SizeConfig - .textMultiplier, - color: Theme.of(context) - .primaryColor, - ), - SizedBox( - height: 8, + ? DrAppEmbeddedError(error: patientsProv.error) + : patientsProv.patientRadiologyList.length == 0 + ? DrAppEmbeddedError( + error: TranslationBase.of(context).errorNoVitalSign) + : Container( + margin: EdgeInsets.fromLTRB( + SizeConfig.realScreenWidth * 0.05, + 0, + SizeConfig.realScreenWidth * 0.05, + 0), + child: Container( + margin: EdgeInsets.symmetric(vertical: 10), + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(20.0), + ), + ), + child: ListView.builder( + itemCount: patientsProv.patientRadiologyList.length, + itemBuilder: (BuildContext context, int index) { + return InkWell( + onTap: () { + Navigator.push( + context, + MaterialPageRoute( + builder: (context) => + RadiologyReportScreen( + reportData: patientsProv + .patientRadiologyList[index] + .reportData, + )), + ); + }, + child: Container( + padding: EdgeInsets.all(10), + margin: EdgeInsets.all(10), + decoration: BoxDecoration( + borderRadius: + BorderRadius.all(Radius.circular(10)), + 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), ), - ], + ), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + LargeAvatar( + url: patientsProv + .patientRadiologyList[index] + .doctorImageURL, + ), + Expanded( + child: Padding( + padding: + const EdgeInsets.fromLTRB( + 8, 0, 0, 0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + AppText( + '${patientsProv.patientRadiologyList[index].doctorName}', + fontSize: 2.5 * + SizeConfig + .textMultiplier, + fontWeight: + FontWeight.bold), + SizedBox( + height: 8, + ), + AppText( + 'Invoice No:${patientsProv.patientRadiologyList[index].invoiceNo}', + fontSize: 2 * + SizeConfig + .textMultiplier, + ), + SizedBox( + height: 8, + ), + AppText( + ' ${patientsProv.patientRadiologyList[index].clinicName}', + fontSize: 2 * + SizeConfig + .textMultiplier, + color: Theme.of(context) + .primaryColor, + ), + SizedBox( + height: 8, + ), + ], + ), + ), + ) + ], + ), + ], + ), ), - ), - ) - ], - ), - ], + ); + }), + ), ), - ), - ); - }), - ), - ), ); } } 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 68966553..8317cb2a 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 @@ -14,6 +14,7 @@ import '../../../../routes.dart'; import '../../../../screens/patients/profile/vital_sign/vital_sign_item.dart'; import '../../../../util/dr_app_shared_pref.dart'; import '../../../../widgets/shared/app_scaffold_widget.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; DrAppSharedPreferances sharedPref = new DrAppSharedPreferances(); @@ -30,9 +31,9 @@ class _VitalSignDetailsScreenState extends State { PatientsProvider patientsProv; var _isInit = true; - /* - *@author: Elham Rababah - *@Date:28/4/2020 + /* + *@author: Elham Rababah + *@Date:28/4/2020 *@param: context *@return: *@desc: getVitalSignList Function @@ -76,7 +77,7 @@ class _VitalSignDetailsScreenState extends State { final routeArgs = ModalRoute.of(context).settings.arguments as Map; vitalSing = routeArgs['vitalSing']; return AppScaffold( - appBarTitle: "vital Sing", + appBarTitle: TranslationBase.of(context).vitalSign, body: patientsProv.isLoading ? DrAppCircularProgressIndeicator() : patientsProv.isError @@ -101,9 +102,13 @@ class _VitalSignDetailsScreenState extends State { }, child: Container( child: VitalSignItem( - des: 'Body Measurements', + des: TranslationBase.of(context) + .bodyMeasurements, url: url + 'heartbeat.png', - lastVal: patientsProv.patientVitalSignOrderdSubList[0].heightCm.toString(), + lastVal: patientsProv + .patientVitalSignOrderdSubList[0] + .heightCm + .toString(), unit: 'Cm', ), ), @@ -115,16 +120,18 @@ class _VitalSignDetailsScreenState extends State { arguments: { 'title': 'Temperature', 'key': vitalSignDetails.temperature, - }); }, child: Container( child: VitalSignItem( - des: 'Temperature', + des: TranslationBase.of(context) + .temperature, url: url + 'heartbeat.png', - lastVal: patientsProv.patientVitalSignOrderdSubList[0].temperatureCelcius.toString(), + lastVal: patientsProv + .patientVitalSignOrderdSubList[0] + .temperatureCelcius + .toString(), unit: 'C', - ), ), ), @@ -142,10 +149,13 @@ class _VitalSignDetailsScreenState extends State { }); }, child: VitalSignItem( - des: 'Pulse', + des: TranslationBase.of(context).pulse, url: url + 'heartbeat.png', - lastVal: patientsProv.patientVitalSignOrderdSubList[0].pulseBeatPerMinute.toString(), - unit: 'M', + lastVal: patientsProv + .patientVitalSignOrderdSubList[0] + .pulseBeatPerMinute + .toString(), + unit: 'M', ), ), InkWell( @@ -158,11 +168,14 @@ class _VitalSignDetailsScreenState extends State { }); }, child: VitalSignItem( - des: 'Respiration', + des: + TranslationBase.of(context).respiration, url: url + 'heartbeat.png', - - lastVal: patientsProv.patientVitalSignOrderdSubList[0].respirationBeatPerMinute.toString(), - unit: 'M', + lastVal: patientsProv + .patientVitalSignOrderdSubList[0] + .respirationBeatPerMinute + .toString(), + unit: 'M', ), ), ], @@ -179,10 +192,14 @@ class _VitalSignDetailsScreenState extends State { }); }, child: VitalSignItem( - des: 'Blood Pressure', + des: TranslationBase.of(context) + .bloodPressure, url: url + 'heartbeat.png', - lastVal: patientsProv.patientVitalSignOrderdSubList[0].bloodPressure.toString(), - unit: '', + lastVal: patientsProv + .patientVitalSignOrderdSubList[0] + .bloodPressure + .toString(), + unit: '', ), ), InkWell( @@ -195,10 +212,13 @@ class _VitalSignDetailsScreenState extends State { }); }, child: VitalSignItem( - des: 'Oxygenation', + des: + TranslationBase.of(context).oxygenation, url: url + 'heartbeat.png', - lastVal: patientsProv.patientVitalSignOrderdSubList[0].fIO2.toString(), - unit: '', + lastVal: patientsProv + .patientVitalSignOrderdSubList[0].fIO2 + .toString(), + unit: '', ), ), ], @@ -216,7 +236,7 @@ class _VitalSignDetailsScreenState extends State { }); }, child: VitalSignItem( - des: 'Pain Scale', + des: TranslationBase.of(context).painScale, url: url + 'heartbeat.png', ), ), diff --git a/lib/screens/profile_screen.dart b/lib/screens/profile_screen.dart index 88f9565a..61ac08c3 100644 --- a/lib/screens/profile_screen.dart +++ b/lib/screens/profile_screen.dart @@ -1,4 +1,3 @@ - import 'package:doctor_app_flutter/models/doctor_profile_model.dart'; import 'package:doctor_app_flutter/widgets/shared/app_drawer_widget.dart'; ////////////// @@ -9,12 +8,13 @@ import '../widgets/shared/app_scaffold_widget.dart'; import '../widgets/shared/drawer_item_widget.dart'; import '../widgets/shared/profile_image_widget.dart'; import '../widgets/shared/rounded_container_widget.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; class ProfileScreen extends StatefulWidget { - ProfileScreen({Key key, this.title,this.doctorProfileall}) : super(key: key); + ProfileScreen({Key key, this.title, this.doctorProfileall}) : super(key: key); final String title; - DoctorProfileModel doctorProfileall ; + DoctorProfileModel doctorProfileall; @override _ProfileScreenState createState() => _ProfileScreenState(); @@ -22,59 +22,60 @@ class ProfileScreen extends StatefulWidget { class _ProfileScreenState extends State { //************************** - DoctorProfileModel doctorProfile ; - //AppDrawer dr; + DoctorProfileModel doctorProfile; + //AppDrawer dr; //****************** @override Widget build(BuildContext context) { - - Map arg=ModalRoute.of(context).settings.arguments as Map;//ModalRoute.of(context).settings.arguments; - doctorProfile = arg['doctorProfileall']; - print("******************"); - //print(doctorProfile.doctorName); - print("******************"); + Map arg = ModalRoute.of(context).settings.arguments + as Map; //ModalRoute.of(context).settings.arguments; + doctorProfile = arg['doctorProfileall']; + print("******************"); + //print(doctorProfile.doctorName); + print("******************"); return AppScaffold( - appBarTitle: 'Profile', + appBarTitle: TranslationBase.of(context).profile, body: ListView(padding: EdgeInsets.zero, children: [ Container( height: SizeConfig.heightMultiplier * 30, child: DrawerHeader( child: ProfileImageWidget( - url:doctorProfile.doctorImageURL, - //"https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png", - name: doctorProfile.doctorName,//"Dr. Chris evans", - des: doctorProfile.clinicDescription//"Director of medical records", - ), + url: doctorProfile.doctorImageURL, + //"https://p.kindpng.com/picc/s/404-4042774_profile-photo-circle-circle-profile-picture-png-transparent.png", + name: doctorProfile.doctorName, //"Dr. Chris evans", + des: doctorProfile + .clinicDescription //"Director of medical records", + ), ), ), RoundedContainer( child: ListView( children: [ DrawerItem( - "Gender" - , + TranslationBase.of(context).gender, Icons.person_pin, color: Colors.black, - subTitle: doctorProfile.genderDescription//"Male" + subTitle: doctorProfile.genderDescription //"Male" , ), + DrawerItem(TranslationBase.of(context).clinic, Icons.build, + color: Colors.black, + subTitle: + doctorProfile.clinicDescription //"Neurology Clinic", + ), DrawerItem( - "Clinic", - Icons.build, - color: Colors.black, - subTitle: doctorProfile.clinicDescription//"Neurology Clinic", - ), - DrawerItem( - "Hospital", + TranslationBase.of(context).hospital, Icons.local_hospital, color: Colors.black, - subTitle: doctorProfile.projectName,//"Al-Takkassussi", + subTitle: doctorProfile.projectName, //"Al-Takkassussi", ), DrawerItem( - "Speciality", + TranslationBase.of(context).speciality, Icons.crop_square, color: Colors.black, - subTitle: doctorProfile.doctorRate==0 ?"being bad":"being great", + subTitle: doctorProfile.doctorRate == 0 + ? "being bad" + : "being great", ), ], ), @@ -84,4 +85,3 @@ class _ProfileScreenState extends State { ])); } } - diff --git a/lib/util/translations_delegate_base.dart b/lib/util/translations_delegate_base.dart index 41a923f5..b9e63bf4 100644 --- a/lib/util/translations_delegate_base.dart +++ b/lib/util/translations_delegate_base.dart @@ -86,6 +86,45 @@ class TranslationBase { String get search => localizedValues['search'][locale.languageCode]; String get onlyArrivedPatient => localizedValues['onlyArrivedPatient'][locale.languageCode]; + String get searchMedicineNameHere => + localizedValues['searchMedicineNameHere'][locale.languageCode]; + String get youCanFind => localizedValues['youCanFind'][locale.languageCode]; + String get itemsInSearch => + localizedValues['itemsInSearch'][locale.languageCode]; + String get qrReader => localizedValues['qrReader'][locale.languageCode]; + String get startScanning => + localizedValues['startScanning'][locale.languageCode]; + String get scanQrCode => localizedValues['scanQrCode'][locale.languageCode]; + String get scanQr => localizedValues['scanQr'][locale.languageCode]; + String get profile => localizedValues['profile'][locale.languageCode]; + String get gender => localizedValues['gender'][locale.languageCode]; + String get clinic => localizedValues['clinic'][locale.languageCode]; + String get hospital => localizedValues['hospital'][locale.languageCode]; + String get speciality => localizedValues['speciality'][locale.languageCode]; + String get errorMessage => + localizedValues['errorMessage'][locale.languageCode]; + String get patientProfile => + localizedValues['patientProfile'][locale.languageCode]; + String get vitalSign => localizedValues['vitalSign'][locale.languageCode]; + String get labOrder => localizedValues['labOrder'][locale.languageCode]; + String get prescription => + localizedValues['prescription'][locale.languageCode]; + String get insuranceApprovals => + localizedValues['insuranceApprovals'][locale.languageCode]; + String get bodyMeasurements => + localizedValues['bodyMeasurements'][locale.languageCode]; + String get temperature => localizedValues['temperature'][locale.languageCode]; + String get pulse => localizedValues['pulse'][locale.languageCode]; + String get respiration => localizedValues['respiration'][locale.languageCode]; + String get bloodPressure => + localizedValues['bloodPressure'][locale.languageCode]; + String get oxygenation => localizedValues['oxygenation'][locale.languageCode]; + String get painScale => localizedValues['painScale'][locale.languageCode]; + String get errorNoVitalSign => + localizedValues['errorNoVitalSign'][locale.languageCode]; + String get labOrders => localizedValues['labOrders'][locale.languageCode]; + String get errorNoLabOrders => + localizedValues['errorNoLabOrders'][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 16c9a0bd..8cad6daf 100644 --- a/lib/widgets/patients/profile/profile_medical_info_widget.dart +++ b/lib/widgets/patients/profile/profile_medical_info_widget.dart @@ -8,6 +8,7 @@ import 'package:hexcolor/hexcolor.dart'; import '../../../config/size_config.dart'; import '../../shared/app_texts_widget.dart'; import '../../shared/rounded_container_widget.dart'; +import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; /* *@author: Elham Rababah @@ -32,26 +33,26 @@ class ProfileMedicalInfoWidget extends StatelessWidget { PatientProfileButton( key: key, patient: patient, - name: 'Vital Sign', + name: TranslationBase.of(context).vitalSign, route: VITAL_SIGN_DETAILS, icon: 'heartbeat.png'), PatientProfileButton( key: key, patient: patient, route: LAB_ORDERS, - name: 'Lab Order', + name: TranslationBase.of(context).labOrder, icon: 'lab.png'), PatientProfileButton( key: key, patient: patient, route: PRESCRIPTIONS, - name: 'Prescription', + name: TranslationBase.of(context).prescription, icon: 'note.png'), PatientProfileButton( key: key, patient: patient, route: RADIOLOGY, - name: 'Radiology', + name: TranslationBase.of(context).radiology, icon: 'radiology-1.png'), Visibility( visible: selectedPatientType != 0 && selectedPatientType != 5, @@ -65,7 +66,7 @@ class ProfileMedicalInfoWidget extends StatelessWidget { key: key, patient: patient, route: PATIENT_INSURANCE_APPROVALS, - name: 'Insurance Aprovals', + name: TranslationBase.of(context).insuranceApprovals, icon: 'lab.png'), Visibility( visible: selectedPatientType != 0 && @@ -304,13 +305,13 @@ class PatientProfileButton extends StatelessWidget { ), Container( child: Row( - mainAxisAlignment: MainAxisAlignment.end, - children: [ - Container( - padding: EdgeInsets.all(10), - child: new Image.asset(url + icon)) - ], - )) + mainAxisAlignment: MainAxisAlignment.end, + children: [ + Container( + padding: EdgeInsets.all(10), + child: new Image.asset(url + icon)) + ], + )) ]), ), decoration: BoxDecoration(