diff --git a/lib/screens/medical-file/health_summary_page.dart b/lib/screens/medical-file/health_summary_page.dart index b1ee901b..5aa6b8d6 100644 --- a/lib/screens/medical-file/health_summary_page.dart +++ b/lib/screens/medical-file/health_summary_page.dart @@ -13,6 +13,8 @@ import 'package:doctor_app_flutter/widgets/shared/doctor_card.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; import 'package:flutter/material.dart'; +import '../../widgets/shared/errors/error_message.dart'; + class HealthSummaryPage extends StatefulWidget { @override _HealthSummaryPageState createState() => _HealthSummaryPageState(); @@ -141,19 +143,7 @@ class _HealthSummaryPageState extends State { ); }) : Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context).noMedicalFileFound), - ) - ], - ), + child: ErrorMessage(error: TranslationBase.of(context).noMedicalFileFound,) ) ], ), diff --git a/lib/screens/medical-file/medical_file_details.dart b/lib/screens/medical-file/medical_file_details.dart index b53284a9..12ce738b 100644 --- a/lib/screens/medical-file/medical_file_details.dart +++ b/lib/screens/medical-file/medical_file_details.dart @@ -13,6 +13,8 @@ import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../widgets/shared/errors/error_message.dart'; + class MedicalFileDetails extends StatefulWidget { String age; String firstName; @@ -928,22 +930,7 @@ class _MedicalFileDetailsState extends State { ), ) : Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText('No Data For This Visit '), - ), - SizedBox( - height: 100, - ), - ], - ), + child: ErrorMessage(error: TranslationBase.of(context).noDataAvailable,) ) ], ), diff --git a/lib/screens/patients/DischargedPatientPage.dart b/lib/screens/patients/DischargedPatientPage.dart index 6791785a..749e93d7 100644 --- a/lib/screens/patients/DischargedPatientPage.dart +++ b/lib/screens/patients/DischargedPatientPage.dart @@ -13,6 +13,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import '../../routes.dart'; +import '../../widgets/shared/errors/error_message.dart'; class DischargedPatient extends StatefulWidget { @override @@ -34,25 +35,10 @@ class _DischargedPatientState extends State { baseViewModel: model, body: model.myDischargedPatient.isEmpty ? Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - height: MediaQuery.of(context).size.height * 0.070, - ), - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - 'No Discharged Patient', - color: Theme.of(context).errorColor, - ), - ) - ], - ), + child: Container( + child: ErrorMessage(error: TranslationBase.of(context).referralEmptyMsg, + ), + ) ) : Padding( padding: const EdgeInsets.all(8.0), diff --git a/lib/screens/patients/ReferralDischargedPatientPage.dart b/lib/screens/patients/ReferralDischargedPatientPage.dart index 92f92f87..f6aa4cf9 100644 --- a/lib/screens/patients/ReferralDischargedPatientPage.dart +++ b/lib/screens/patients/ReferralDischargedPatientPage.dart @@ -9,6 +9,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import '../../util/translations_delegate_base.dart'; +import '../../widgets/shared/errors/error_message.dart'; import 'ReferralDischargedPatientDetails.dart'; class ReferralDischargedPatientPage extends StatefulWidget { @@ -28,22 +30,10 @@ class _ReferralDischargedPatientPageState extends State { : model.patientChiefComplaintList != null || model.patientVitalSignsHistory != null ? Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - model.patientVitalSignsHistory == null || model.patientVitalSignsHistory.length == 0 - ? TranslationBase.of(context).vitalSignEmptyMsg - : TranslationBase.of(context) - .chiefComplaintEmptyMsg, - fontWeight: FontWeight.normal, - textAlign: TextAlign.center, - color: HexColor("#B8382B"), - fontSize: SizeConfig.textMultiplier * 2.5, - ), - ) - ], - ), + child: ErrorMessage(error: model.patientVitalSignsHistory == null || model.patientVitalSignsHistory.length == 0 + ? TranslationBase.of(context).vitalSignEmptyMsg + : TranslationBase.of(context) + ) ) : Container(), ), diff --git a/lib/screens/patients/profile/lab_result/FlowChartPage.dart b/lib/screens/patients/profile/lab_result/FlowChartPage.dart index be863b87..01bf7ae4 100644 --- a/lib/screens/patients/profile/lab_result/FlowChartPage.dart +++ b/lib/screens/patients/profile/lab_result/FlowChartPage.dart @@ -10,6 +10,7 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; +import '../../../../widgets/shared/errors/error_message.dart'; import 'lab_result_history_chart_and_detials.dart'; import 'lab_result_chart_and_detials.dart'; @@ -52,22 +53,7 @@ class FlowChartPage extends StatelessWidget { ) : Container( child: Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - mainAxisSize: MainAxisSize.min, - children: [ - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - TranslationBase.of(context).noDataAvailable, - fontWeight: FontWeight.normal, - color: HexColor("#B8382B"), - fontSize: SizeConfig.textMultiplier * 2.5, - ), - ) - ], - ), + child: ErrorMessage(error: TranslationBase.of(context).noDataAvailable,) ), ), ), diff --git a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart index 545b4378..0a809abd 100644 --- a/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart +++ b/lib/screens/patients/profile/lab_result/all_lab_special_result_page.dart @@ -13,6 +13,8 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../../../widgets/shared/errors/error_message.dart'; + class AllLabSpecialResult extends StatefulWidget { const AllLabSpecialResult({Key key}) : super(key: key); @@ -189,19 +191,7 @@ class _AllLabSpecialResultState extends State { if (model.allSpecialLabList.isEmpty && patient.patientStatusType != 43) Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText('No Lab Result Found'), - ) - ], - ), + child: ErrorMessage(error: TranslationBase.of(context).noDataAvailable,) ) ], ), diff --git a/lib/screens/patients/profile/lab_result/labs_home_page.dart b/lib/screens/patients/profile/lab_result/labs_home_page.dart index 67303256..6073cab0 100644 --- a/lib/screens/patients/profile/lab_result/labs_home_page.dart +++ b/lib/screens/patients/profile/lab_result/labs_home_page.dart @@ -18,6 +18,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../../../widgets/shared/errors/error_message.dart'; + class LabsHomePage extends StatefulWidget { @override _LabsHomePageState createState() => _LabsHomePageState(); @@ -220,19 +222,7 @@ class _LabsHomePageState extends State { if (model.patientLabOrdersList.isEmpty && patient.patientStatusType != 43) Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText('No Lab Result Found'), - ) - ], - ), + child: ErrorMessage(error: TranslationBase.of(context).noDataAvailable,) ) ], ), diff --git a/lib/screens/patients/profile/radiology/radiology_home_page.dart b/lib/screens/patients/profile/radiology/radiology_home_page.dart index 958301fd..450e94de 100644 --- a/lib/screens/patients/profile/radiology/radiology_home_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_home_page.dart @@ -17,6 +17,8 @@ import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; +import '../../../../widgets/shared/errors/error_message.dart'; + class RadiologyHomePage extends StatefulWidget { @override _RadiologyHomePageState createState() => _RadiologyHomePageState(); @@ -192,19 +194,7 @@ class _RadiologyHomePageState extends State { )), if (model.radiologyList.isEmpty && patient.patientStatusType != 43) Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText('No Radiology Found'), - ) - ], - ), + child: ErrorMessage(error: TranslationBase.of(context).noDataAvailable,) ) ], ), diff --git a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart index b2242ff7..17bd1287 100644 --- a/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-inpatient-screen.dart @@ -14,6 +14,7 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import '../../../../widgets/shared/errors/error_message.dart'; import 'my-referral-patient-screen.dart'; class MyReferralInPatientScreen extends StatefulWidget { @@ -56,22 +57,7 @@ class _MyReferralInPatientScreenState extends State { ), model.myReferralPatients.isEmpty ? Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - TranslationBase.of(context).referralEmptyMsg, - color: Theme.of(context).errorColor, - ), - ) - ], - ), + child: ErrorMessage(error: TranslationBase.of(context).referralEmptyMsg,) ) : Expanded( child: SingleChildScrollView( diff --git a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart index 2eefeb43..cce603bf 100644 --- a/lib/screens/patients/profile/referral/my-referral-patient-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-patient-screen.dart @@ -8,6 +8,7 @@ import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import '../../../../routes.dart'; +import '../../../../widgets/shared/errors/error_message.dart'; class MyReferralPatientScreen extends StatelessWidget { @override @@ -20,22 +21,9 @@ class MyReferralPatientScreen extends StatelessWidget { appBarTitle: TranslationBase.of(context).referPatient, body: model.pendingReferral == null || model.pendingReferral.length == 0 ? Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - TranslationBase.of(context).referralEmptyMsg, - color: Theme.of(context).errorColor, - ), - ) - ], - ), + child: Container( + child: ErrorMessage(error: TranslationBase.of(context).referralEmptyMsg, + )) ) : SingleChildScrollView( child: Container( diff --git a/lib/screens/patients/profile/referral/referred-patient-screen.dart b/lib/screens/patients/profile/referral/referred-patient-screen.dart index 354ee04f..545625fa 100644 --- a/lib/screens/patients/profile/referral/referred-patient-screen.dart +++ b/lib/screens/patients/profile/referral/referred-patient-screen.dart @@ -12,6 +12,8 @@ import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; +import '../../../../widgets/shared/errors/error_message.dart'; + class ReferredPatientScreen extends StatefulWidget { @override _ReferredPatientScreenState createState() => _ReferredPatientScreenState(); @@ -50,22 +52,7 @@ class _ReferredPatientScreenState extends State { model.listMyReferredPatientModel == null || model.listMyReferredPatientModel.length == 0 ? Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - Container( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText( - TranslationBase.of(context).referralEmptyMsg, - color: Theme.of(context).errorColor, - ), - ) - ], - ), + child: ErrorMessage(error: TranslationBase.of(context).referralEmptyMsg,) ) : Expanded( child: SingleChildScrollView( diff --git a/lib/screens/prescription/prescriptions_page.dart b/lib/screens/prescription/prescriptions_page.dart index d61ac08d..ecad2aed 100644 --- a/lib/screens/prescription/prescriptions_page.dart +++ b/lib/screens/prescription/prescriptions_page.dart @@ -20,6 +20,8 @@ import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; +import '../../widgets/shared/errors/error_message.dart'; + class PrescriptionsPage extends StatelessWidget { @override Widget build(BuildContext context) { @@ -133,20 +135,7 @@ class PrescriptionsPage extends StatelessWidget { if (model.prescriptionsList.isEmpty && patient.patientStatusType != 43) Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context) - .noPrescriptionsFound), - ) - ], - ), + child: ErrorMessage(error: TranslationBase.of(context).noPrescriptionsFound,) ) ], ), @@ -216,20 +205,7 @@ class PrescriptionsPage extends StatelessWidget { }), if (model.medicationForInPatient.length == 0) Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(8.0), - child: AppText(TranslationBase.of(context) - .noPrescriptionsFound), - ) - ], - ), + child: ErrorMessage(error: TranslationBase.of(context).noPrescriptionsFound,) ) ], ), diff --git a/lib/screens/procedures/procedure_screen.dart b/lib/screens/procedures/procedure_screen.dart index 79fb961c..e0c8909e 100644 --- a/lib/screens/procedures/procedure_screen.dart +++ b/lib/screens/procedures/procedure_screen.dart @@ -14,6 +14,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/transitions/slide_up_page.dart'; import 'package:flutter/material.dart'; +import '../../widgets/shared/errors/error_message.dart'; import 'ProcedureCard.dart'; import 'ProcedureType.dart'; import 'base_add_procedure_tab_page.dart'; @@ -180,19 +181,7 @@ class ProcedureScreen extends StatelessWidget { if (model.state == ViewState.ErrorLocal || (model.procedureList.isNotEmpty && model.procedureList[0].entityList.isEmpty)) Center( - child: Column( - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SizedBox( - height: 100, - ), - Image.asset('assets/images/no-data.png'), - Padding( - padding: const EdgeInsets.all(22.0), - child: AppText(model.procedureList.isEmpty ? model.error : 'No Procedure Found '), - ) - ], - ), + child: ErrorMessage(error: TranslationBase.of(context).noDataAvailable,) ), ], ),