From b8f6c35e75602784e46911515811b386310e35ae Mon Sep 17 00:00:00 2001 From: mosazaid Date: Tue, 20 Apr 2021 13:28:16 +0300 Subject: [PATCH] working on buttons widgets --- lib/UpdatePage.dart | 2 +- lib/screens/QR_reader_screen.dart | 9 +- .../medicine/medicine_search_screen.dart | 2 +- .../patients/patient_search_screen.dart | 2 +- lib/screens/patients/patients_screen.dart | 3 - .../profile/UCAF/UCAF-detail-screen.dart | 43 +-- .../profile/UCAF/UCAF-input-screen.dart | 2 +- .../admission-request-detail-screen.dart | 2 +- .../admission-request-first-screen.dart | 2 +- .../admission-request-third-screen.dart | 2 +- .../admission-request_second-screen.dart | 2 +- .../profile/lab_result/LineChartCurved.dart | 9 +- .../profile/patient_profile_screen.dart | 51 ++-- .../radiology/radiology_details_page.dart | 7 +- .../radiology/radiology_report_screen.dart | 2 +- .../profile/refer_patient_screen.dart | 2 +- .../referral/my-referral-detail-screen.dart | 247 ++++++++++-------- .../referral/refer-patient-screen.dart | 2 +- .../assessment/add_assessment_details.dart | 2 +- .../assessment/update_assessment_page.dart | 2 +- .../objective/add_examination_page.dart | 14 +- .../objective/update_objective_page.dart | 2 +- .../soap_update/plan/update_plan_page.dart | 2 +- .../subjective/allergies/add_allergies.dart | 2 +- .../history/add_history_dialog.dart | 2 +- .../subjective/medication/add_medication.dart | 2 +- .../subjective/update_subjective_page.dart | 2 +- .../prescription/add_prescription_form.dart | 2 +- .../prescription/prescription_warnings.dart | 2 +- .../update_prescription_form.dart | 2 +- .../procedures/add-procedure-form.dart | 2 +- lib/screens/procedures/add_lab_orders.dart | 2 +- .../procedures/add_radiology_order.dart | 2 +- .../entity_list_checkbox_search_widget.dart | 2 +- .../entity_list_procedure_widget.dart | 2 +- lib/screens/procedures/update-procedure.dart | 2 +- .../reschedule-leaves/reschedule_leave.dart | 2 +- lib/screens/sick-leave/sick_leave.dart | 2 +- lib/widgets/auth/login_form.dart | 22 +- lib/widgets/auth/verification_methods.dart | 15 +- .../doctor/my_referral_patient_widget.dart | 17 +- lib/widgets/shared/app_button.dart | 150 ----------- lib/widgets/shared/app_buttons_widget.dart | 92 ------- lib/widgets/shared/borderedButton.dart | 87 ------ .../shared/buttons/app_buttons_widget.dart | 117 +++++++++ .../shared/buttons/button_bottom_sheet.dart | 16 ++ .../{ => buttons}/secondary_button.dart | 2 +- ..._key_checkbox_search_allergies_widget.dart | 2 +- .../master_key_checkbox_search_widget.dart | 2 +- 49 files changed, 408 insertions(+), 557 deletions(-) delete mode 100644 lib/widgets/shared/app_button.dart delete mode 100644 lib/widgets/shared/app_buttons_widget.dart delete mode 100644 lib/widgets/shared/borderedButton.dart create mode 100644 lib/widgets/shared/buttons/app_buttons_widget.dart create mode 100644 lib/widgets/shared/buttons/button_bottom_sheet.dart rename lib/widgets/shared/{ => buttons}/secondary_button.dart (99%) diff --git a/lib/UpdatePage.dart b/lib/UpdatePage.dart index dc94b6e6..e3a689a0 100644 --- a/lib/UpdatePage.dart +++ b/lib/UpdatePage.dart @@ -1,7 +1,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/secondary_button.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/widgets/shared/buttons/secondary_button.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; diff --git a/lib/screens/QR_reader_screen.dart b/lib/screens/QR_reader_screen.dart index 2ddb4049..36b10200 100644 --- a/lib/screens/QR_reader_screen.dart +++ b/lib/screens/QR_reader_screen.dart @@ -9,9 +9,10 @@ import 'package:doctor_app_flutter/util/dr_app_shared_pref.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -93,11 +94,11 @@ class _QrReaderScreenState extends State { SizedBox( height: 35, ), - Button( - onTap: () { + AppButton( + title : TranslationBase.of(context).scanQr, + onPressed: () { _scanQrAndGetPatient(context, model); }, - title: TranslationBase.of(context).scanQr, loading: isLoading, icon: Image.asset('assets/images/qr_code_white.png'), ), diff --git a/lib/screens/medicine/medicine_search_screen.dart b/lib/screens/medicine/medicine_search_screen.dart index 9dea3448..c092ea10 100644 --- a/lib/screens/medicine/medicine_search_screen.dart +++ b/lib/screens/medicine/medicine_search_screen.dart @@ -12,7 +12,7 @@ import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; diff --git a/lib/screens/patients/patient_search_screen.dart b/lib/screens/patients/patient_search_screen.dart index 51750e38..6ec6a272 100644 --- a/lib/screens/patients/patient_search_screen.dart +++ b/lib/screens/patients/patient_search_screen.dart @@ -15,7 +15,7 @@ import '../../config/config.dart'; import '../../config/size_config.dart'; import '../../lookups/patient_lookup.dart'; import '../../widgets/patients/dynamic_elements.dart'; -import '../../widgets/shared/app_buttons_widget.dart'; +import '../../widgets/shared/buttons/app_buttons_widget.dart'; import '../../widgets/shared/app_scaffold_widget.dart'; import '../../widgets/shared/app_text_form_field.dart'; import '../../widgets/shared/app_texts_widget.dart'; diff --git a/lib/screens/patients/patients_screen.dart b/lib/screens/patients/patients_screen.dart index 0209991b..4440a6b6 100644 --- a/lib/screens/patients/patients_screen.dart +++ b/lib/screens/patients/patients_screen.dart @@ -17,9 +17,6 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/PatientCard.dart'; import 'package:doctor_app_flutter/widgets/patients/clinic_list_dropdwon.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dr_app_circular_progress_Indeicator.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; diff --git a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart index ec7a7355..d714603c 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-detail-screen.dart @@ -16,7 +16,8 @@ import 'package:doctor_app_flutter/widgets/patients/profile/PatientHeaderWidgetN import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; + import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -47,9 +48,9 @@ class _UcafDetailScreenState extends State { }, builder: (_, model, w) => AppScaffold( baseViewModel: model, - isShowAppBar: true, - appBar: PatientProfileHeaderNewDesignAppBar( - patient, patientType, arrivalType), + isShowAppBar: true, + appBar: PatientProfileHeaderNewDesignAppBar( + patient, patientType, arrivalType), appBarTitle: TranslationBase.of(context).ucaf, body: Column( children: [ @@ -114,18 +115,19 @@ class _UcafDetailScreenState extends State { children: [ Expanded( child: Container( - child: BorderedButton( - TranslationBase.of(context).cancel, + child: AppButton( + title: TranslationBase.of(context).cancel, hasBorder: true, vPadding: 8, hPadding: 8, borderColor: Colors.white, - backgroundColor: Colors.white, - textColor: HexColor("#B8382B"), - fontSize: SizeConfig.textMultiplier * 2.2, - handler: () { + color: Colors.white, + fontColor: HexColor("#B8382B"), + fontSize: 2.2, + onPressed: () { Navigator.of(context).popUntil((route) { - return route.settings.name == PATIENTS_PROFILE; + return route.settings.name == + PATIENTS_PROFILE; }); }, ), @@ -136,22 +138,24 @@ class _UcafDetailScreenState extends State { ), Expanded( child: Container( - child: BorderedButton( - TranslationBase.of(context).save, + child: AppButton( + title: TranslationBase.of(context).save, hasBorder: true, vPadding: 8, hPadding: 8, borderColor: HexColor("#B8382B"), - backgroundColor: HexColor("#B8382B"), - textColor: Colors.white, - fontSize: SizeConfig.textMultiplier * 2.0, - handler: () async { + color: HexColor("#B8382B"), + fontColor: Colors.white, + fontSize: 2.0, + onPressed: () async { await model.postUCAF(patient); if (model.state == ViewState.Idle) { DrAppToastMsg.showSuccesToast( - TranslationBase.of(context).postUcafSuccessMsg); + TranslationBase.of(context) + .postUcafSuccessMsg); Navigator.of(context).popUntil((route) { - return route.settings.name == PATIENTS_PROFILE; + return route.settings.name == + PATIENTS_PROFILE; }); } else { DrAppToastMsg.showErrorToast(model.error); @@ -163,7 +167,6 @@ class _UcafDetailScreenState extends State { ], ), ), - ], ), )); diff --git a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart index fa94d3fa..131c24d8 100644 --- a/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart +++ b/lib/screens/patients/profile/UCAF/UCAF-input-screen.dart @@ -10,7 +10,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/PatientHeaderWidgetNoAvatar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; 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/material.dart'; diff --git a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart index 23e33db3..51ce2873 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-detail-screen.dart @@ -7,7 +7,7 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; diff --git a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart index 876066ce..4c4617c2 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-first-screen.dart @@ -12,7 +12,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header- import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; diff --git a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart index bf896145..04c83fca 100644 --- a/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request-third-screen.dart @@ -14,7 +14,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header- import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; diff --git a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart index a4aebc9f..96aaaac6 100644 --- a/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart +++ b/lib/screens/patients/profile/admission-request/admission-request_second-screen.dart @@ -15,7 +15,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header- import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; diff --git a/lib/screens/patients/profile/lab_result/LineChartCurved.dart b/lib/screens/patients/profile/lab_result/LineChartCurved.dart index fe4677ae..9d7b4db8 100644 --- a/lib/screens/patients/profile/lab_result/LineChartCurved.dart +++ b/lib/screens/patients/profile/lab_result/LineChartCurved.dart @@ -65,7 +65,7 @@ class LineChartCurvedState extends State { ), Expanded( child: Padding( - padding: const EdgeInsets.only(right: 16.0, left: 6.0), + padding: const EdgeInsets.only(right: 16.0, left: 8.0), child: LineChart( sampleData1(), swapAnimationDuration: const Duration(milliseconds: 250), @@ -99,9 +99,9 @@ class LineChartCurvedState extends State { showTitles: true, getTextStyles: (value) => const TextStyle( color: Colors.black, - fontSize: 12, + fontSize: 11, ), - margin: 22, + margin: 28, rotateAngle:-65, getTitles: (value) { print(value); @@ -213,8 +213,9 @@ class LineChartCurvedState extends State { spots: spots, isCurved: true, colors: [Colors.red], - barWidth: 5, + barWidth: 3, isStrokeCapRound: true, + curveSmoothness: 0.12, dotData: FlDotData( show: false, ), diff --git a/lib/screens/patients/profile/patient_profile_screen.dart b/lib/screens/patients/profile/patient_profile_screen.dart index 63a1247b..da4c6c52 100644 --- a/lib/screens/patients/profile/patient_profile_screen.dart +++ b/lib/screens/patients/profile/patient_profile_screen.dart @@ -10,7 +10,8 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-head import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget_search.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; + import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -103,24 +104,24 @@ class PatientProfileScreen extends StatelessWidget { children: [ Expanded(child: Container()), if (patient.episodeNo == 0) - BorderedButton( - "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", - backgroundColor: patient.patientStatusType == 43 + AppButton( + title: + "${TranslationBase.of(context).createNew}\n${TranslationBase.of(context).episode}", + color: patient.patientStatusType == 43 ? Colors.red.shade700 : Colors.grey.shade700, - textColor: Colors.white, + fontColor: Colors.white, vPadding: 8, radius: 30, hPadding: 20, fontWeight: FontWeight.normal, - fontSize: 12, - fontFamily: 'Poppins', + fontSize: 1.6, icon: Image.asset( "assets/images/create-episod.png", color: Colors.white, height: 30, ), - handler: () async { + onPressed: () async { if (patient.patientStatusType == 43) { PostEpisodeReqModel postEpisodeReqModel = PostEpisodeReqModel( @@ -139,32 +140,30 @@ class PatientProfileScreen extends StatelessWidget { }, ), if (patient.episodeNo != 0) - BorderedButton( - "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", - backgroundColor: - patient.patientStatusType == 43 - ? Colors.red.shade700 - : Colors.grey.shade700, - textColor: Colors.white, + AppButton( + title: + "${TranslationBase.of(context).update}\n${TranslationBase.of(context).episode}", + color: patient.patientStatusType == 43 + ? Colors.red.shade700 + : Colors.grey.shade700, + fontColor: Colors.white, vPadding: 8, radius: 30, hPadding: 20, fontWeight: FontWeight.normal, - fontSize: 12, - fontFamily: 'Poppins', + fontSize: 1.6, icon: Image.asset( "assets/images/modilfy-episode.png", color: Colors.white, height: 30, - ), - handler: () { - if (patient.patientStatusType == 43) { - Navigator.of(context).pushNamed( - UPDATE_EPISODE, - arguments: {'patient': patient}); - } - } - ), + ), + onPressed: () { + if (patient.patientStatusType == 43) { + Navigator.of(context).pushNamed( + UPDATE_EPISODE, + arguments: {'patient': patient}); + } + }), ], ), ), diff --git a/lib/screens/patients/profile/radiology/radiology_details_page.dart b/lib/screens/patients/profile/radiology/radiology_details_page.dart index fc98fefb..556832aa 100644 --- a/lib/screens/patients/profile/radiology/radiology_details_page.dart +++ b/lib/screens/patients/profile/radiology/radiology_details_page.dart @@ -1,17 +1,12 @@ -import 'package:doctor_app_flutter/core/enum/viewstate.dart'; import 'package:doctor_app_flutter/core/model/radiology/final_radiology.dart'; -import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/radiology_view_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient_profile_header_with_appointment_card_app_bar.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/secondary_button.dart'; +import 'file:///C:/Users/admin/AndroidStudioProjects/doctor_app_flutter/lib/widgets/shared/buttons/secondary_button.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:url_launcher/url_launcher.dart'; diff --git a/lib/screens/patients/profile/radiology/radiology_report_screen.dart b/lib/screens/patients/profile/radiology/radiology_report_screen.dart index 75be23e8..d5b4fd5d 100644 --- a/lib/screens/patients/profile/radiology/radiology_report_screen.dart +++ b/lib/screens/patients/profile/radiology/radiology_report_screen.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/size_config.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; 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'; diff --git a/lib/screens/patients/profile/refer_patient_screen.dart b/lib/screens/patients/profile/refer_patient_screen.dart index ffa1608a..b6946a88 100644 --- a/lib/screens/patients/profile/refer_patient_screen.dart +++ b/lib/screens/patients/profile/refer_patient_screen.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/dr_app_embedded_error.dart'; diff --git a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart index dcba8fba..583f92a2 100644 --- a/lib/screens/patients/profile/referral/my-referral-detail-screen.dart +++ b/lib/screens/patients/profile/referral/my-referral-detail-screen.dart @@ -9,11 +9,11 @@ import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/patients/patient-referral-item-widget.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/profile_medical_info_widget_search.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; + import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -113,107 +113,148 @@ class MyReferralDetailScreen extends StatelessWidget { child: Column( children: [ Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ AppText( - pendingReferral.referralStatus != null ? pendingReferral.referralStatus : "", + pendingReferral.referralStatus != null + ? pendingReferral.referralStatus + : "", fontFamily: 'Poppins', - fontSize: 1.9 * SizeConfig.textMultiplier, + fontSize: + 1.9 * SizeConfig.textMultiplier, fontWeight: FontWeight.w700, - color: pendingReferral.referralStatus != null - ? pendingReferral.referralStatus == 'Pending' - ? Color(0xffc4aa54) - : pendingReferral.referralStatus == 'Accepted' - ? Colors.green[700] - : Colors.red[700] + color: pendingReferral + .referralStatus != + null + ? pendingReferral + .referralStatus == + 'Pending' + ? Color(0xffc4aa54) + : pendingReferral + .referralStatus == + 'Accepted' + ? Colors.green[700] + : Colors.red[700] : Colors.grey[500], ), AppText( - pendingReferral.referredOn.split(" ")[0], + pendingReferral.referredOn + .split(" ")[0], fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 2.0 * SizeConfig.textMultiplier, + fontSize: + 2.0 * SizeConfig.textMultiplier, color: Color(0XFF28353E), ) ], ), Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, children: [ Row( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).fileNumber, + TranslationBase.of(context) + .fileNumber, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * + SizeConfig.textMultiplier, color: Color(0XFF575757), ), AppText( "${pendingReferral.patientID}", fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * + SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], ), AppText( - pendingReferral.referredOn.split(" ")[1], + pendingReferral.referredOn + .split(" ")[1], fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: + 1.8 * SizeConfig.textMultiplier, color: Color(0XFF575757), ) ], ), Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - crossAxisAlignment: CrossAxisAlignment.center, + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + crossAxisAlignment: + CrossAxisAlignment.center, children: [ Expanded( child: Column( children: [ Row( - mainAxisAlignment: MainAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).referredFrom, + TranslationBase.of(context) + .referredFrom, fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * + SizeConfig + .textMultiplier, color: Color(0XFF575757), ), AppText( - pendingReferral.isReferralDoctorSameBranch - ? TranslationBase.of(context).sameBranch - : TranslationBase.of(context) - .otherBranch, + pendingReferral + .isReferralDoctorSameBranch + ? TranslationBase.of( + context) + .sameBranch + : TranslationBase.of( + context) + .otherBranch, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontSize: 1.8 * + SizeConfig + .textMultiplier, color: Color(0XFF2E303A), ), ], ), Row( - mainAxisAlignment: MainAxisAlignment.start, - crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: + MainAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ AppText( - TranslationBase.of(context).remarks + " : ", + TranslationBase.of(context) + .remarks + + " : ", fontFamily: 'Poppins', fontWeight: FontWeight.w600, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * + SizeConfig + .textMultiplier, color: Color(0XFF575757), ), Expanded( child: AppText( - pendingReferral.remarksFromSource, + pendingReferral + .remarksFromSource, fontFamily: 'Poppins', - fontWeight: FontWeight.w700, - fontSize: 1.8 * SizeConfig.textMultiplier, + fontWeight: + FontWeight.w700, + fontSize: 1.8 * + SizeConfig + .textMultiplier, color: Color(0XFF2E303A), ), ), @@ -225,52 +266,74 @@ class MyReferralDetailScreen extends StatelessWidget { Row( children: [ AppText( - pendingReferral - .patientDetails.nationalityName != null ? pendingReferral - .patientDetails.nationalityName : "", + pendingReferral.patientDetails + .nationalityName != + null + ? pendingReferral + .patientDetails + .nationalityName + : "", fontWeight: FontWeight.bold, color: Color(0xFF2E303A), - fontSize: 1.4 * SizeConfig.textMultiplier, + fontSize: 1.4 * + SizeConfig.textMultiplier, ), - pendingReferral.nationalityFlagUrl != null + pendingReferral + .nationalityFlagUrl != + null ? ClipRRect( - borderRadius: BorderRadius.circular(20.0), - child: Image.network( - pendingReferral.nationalityFlagUrl, - height: 25, - width: 30, - errorBuilder: (BuildContext context, - Object exception, - StackTrace stackTrace) { - return Text('No Image'); - }, - )) + borderRadius: + BorderRadius.circular( + 20.0), + child: Image.network( + pendingReferral + .nationalityFlagUrl, + height: 25, + width: 30, + errorBuilder: + (BuildContext context, + Object exception, + StackTrace + stackTrace) { + return Text('No Image'); + }, + )) : SizedBox() ], ) ], ), Row( - crossAxisAlignment: CrossAxisAlignment.start, + crossAxisAlignment: + CrossAxisAlignment.start, children: [ Container( - margin: EdgeInsets.only(left: 10, right: 0), - child: Image.asset('assets/images/patient/ic_ref_arrow_up.png', + margin: EdgeInsets.only( + left: 10, right: 0), + child: Image.asset( + 'assets/images/patient/ic_ref_arrow_up.png', height: 50, width: 30, ), ), Container( margin: EdgeInsets.only( - left: 0, top: 25, right: 0, bottom: 0), - padding: EdgeInsets.only(left: 4.0, right: 4.0), + left: 0, + top: 25, + right: 0, + bottom: 0), + padding: EdgeInsets.only( + left: 4.0, right: 4.0), child: Container( width: 40, height: 40, child: CircleAvatar( radius: 25.0, - backgroundImage: NetworkImage(pendingReferral.doctorImageUrl), - backgroundColor: Colors.transparent, + backgroundImage: NetworkImage( + pendingReferral + .doctorImageUrl), + backgroundColor: + Colors.transparent, ), ), ), @@ -278,14 +341,19 @@ class MyReferralDetailScreen extends StatelessWidget { flex: 4, child: Container( margin: EdgeInsets.only( - left: 10, top: 25, right: 10, bottom: 0), + left: 10, + top: 25, + right: 10, + bottom: 0), child: Column( children: [ AppText( - pendingReferral.referredByDoctorInfo, + pendingReferral + .referredByDoctorInfo, fontFamily: 'Poppins', fontWeight: FontWeight.w700, - fontSize: 1.7 * SizeConfig.textMultiplier, + fontSize: 1.7 * + SizeConfig.textMultiplier, color: Color(0XFF2E303A), ), ], @@ -312,39 +380,6 @@ class MyReferralDetailScreen extends StatelessWidget { SizedBox( height: 16, ), - /*Padding( - padding: - const EdgeInsets.symmetric(horizontal: 16.0), - child: AppText( - TranslationBase.of(context).myReferralPatient, - color: Colors.black, - fontWeight: FontWeight.bold, - fontSize: 16, - ), - ),*/ - /*PatientReferralItemWidget( - referralStatus: pendingReferral.referralStatus, - patientName: pendingReferral.patientName, - patientGender: - pendingReferral.patientDetails.gender, - referredDate: - pendingReferral.referredOn.split(" ")[0], - referredTime: - pendingReferral.referredOn.split(" ")[1], - patientID: "${pendingReferral.patientID}", - isSameBranch: - pendingReferral.isReferralDoctorSameBranch, - isReferral: true, - remark: pendingReferral.remarksFromSource, - nationality: pendingReferral - .patientDetails.nationalityName, - nationalityFlag: - pendingReferral.nationalityFlagUrl, - doctorAvatar: pendingReferral.doctorImageUrl, - referralDoctorName: - pendingReferral.referredByDoctorInfo, - clinicDescription: null, - ),*/ Padding( padding: const EdgeInsets.symmetric(horizontal: 16), @@ -367,14 +402,14 @@ class MyReferralDetailScreen extends StatelessWidget { child: Row( children: [ Expanded( - child: BorderedButton( - TranslationBase.of(context).accept, - backgroundColor: Color(0xFF4BA821), - textColor: Colors.white, + child: AppButton( + title: TranslationBase.of(context).accept, + color: Color(0xFF4BA821), + fontColor: Colors.white, fontSize: 16, hPadding: 8, vPadding: 12, - handler: () async { + onPressed: () async { await model.responseReferral( pendingReferral, true); if (model.state == ViewState.ErrorLocal) { @@ -393,14 +428,14 @@ class MyReferralDetailScreen extends StatelessWidget { height: 8, ), Expanded( - child: BorderedButton( - TranslationBase.of(context).reject, - backgroundColor: Color(0xFFB9382C), - textColor: Colors.white, + child: AppButton( + title: TranslationBase.of(context).reject, + color: Color(0xFFB9382C), + fontColor: Colors.white, fontSize: 16, hPadding: 8, vPadding: 12, - handler: () async { + onPressed: () async { await model.responseReferral( pendingReferral, true); if (model.state == ViewState.ErrorLocal) { diff --git a/lib/screens/patients/profile/referral/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer-patient-screen.dart index c27a5c46..22bdb343 100644 --- a/lib/screens/patients/profile/referral/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer-patient-screen.dart @@ -13,7 +13,7 @@ import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header- import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design-app-bar.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-profile-header-new-design.dart'; import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; diff --git a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart index a2083bd9..bafe322f 100644 --- a/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart +++ b/lib/screens/patients/profile/soap_update/assessment/add_assessment_details.dart @@ -17,7 +17,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; import 'package:flutter/material.dart'; diff --git a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart index 7a42fe79..65042e5c 100644 --- a/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart +++ b/lib/screens/patients/profile/soap_update/assessment/update_assessment_page.dart @@ -11,7 +11,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/date-utils.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; 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/material.dart'; diff --git a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart index b9f1bd63..c2bde367 100644 --- a/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/add_examination_page.dart @@ -7,7 +7,8 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; -import 'package:doctor_app_flutter/widgets/shared/borderedButton.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; + import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; @@ -115,16 +116,15 @@ class _AddExaminationPageState extends State { Container( padding: EdgeInsets.all(16), color: Colors.white, - child: BorderedButton( - "${TranslationBase.of(context).addExamination}", - backgroundColor: HexColor("#359846"), - textColor: Colors.white, + child: AppButton( + title:"${TranslationBase.of(context).addExamination}", + color: HexColor("#359846"), + fontColor: Colors.white, vPadding: 12, radius: 12, fontWeight: FontWeight.w600, fontSize: SizeConfig.textMultiplier * 2.5, - fontFamily: 'Poppins', - handler: () { + onPressed: () { widget.addSelectedExamination(); }, ), diff --git a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart index abb62808..42ca6db2 100644 --- a/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart +++ b/lib/screens/patients/profile/soap_update/objective/update_objective_page.dart @@ -12,7 +12,7 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; diff --git a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart index 6f57ceb8..b6ec5ac1 100644 --- a/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart +++ b/lib/screens/patients/profile/soap_update/plan/update_plan_page.dart @@ -14,7 +14,7 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart index c1cbcd28..b69c7096 100644 --- a/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart +++ b/lib/screens/patients/profile/soap_update/subjective/allergies/add_allergies.dart @@ -6,7 +6,7 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_allergy.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_allergies_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart index 6f610a8e..bdb37985 100644 --- a/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart +++ b/lib/screens/patients/profile/soap_update/subjective/history/add_history_dialog.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/models/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/models/SOAP/my_selected_history.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/master_key_checkbox_search_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart index 3b96cd65..51e7b49f 100644 --- a/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart +++ b/lib/screens/patients/profile/soap_update/subjective/medication/add_medication.dart @@ -9,7 +9,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/app-textfield-custom.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/master_key_dailog.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; diff --git a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart index d78c8c45..9b40a085 100644 --- a/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart +++ b/lib/screens/patients/profile/soap_update/subjective/update_subjective_page.dart @@ -16,7 +16,7 @@ import 'package:doctor_app_flutter/models/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/models/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; diff --git a/lib/screens/prescription/add_prescription_form.dart b/lib/screens/prescription/add_prescription_form.dart index 67c483a8..bfcb8c8c 100644 --- a/lib/screens/prescription/add_prescription_form.dart +++ b/lib/screens/prescription/add_prescription_form.dart @@ -19,7 +19,7 @@ import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/medicine/medicine_item_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; diff --git a/lib/screens/prescription/prescription_warnings.dart b/lib/screens/prescription/prescription_warnings.dart index 44bcab0c..f6f040c2 100644 --- a/lib/screens/prescription/prescription_warnings.dart +++ b/lib/screens/prescription/prescription_warnings.dart @@ -1,6 +1,6 @@ import 'package:doctor_app_flutter/config/config.dart'; import 'package:doctor_app_flutter/config/size_config.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:flutter/material.dart'; diff --git a/lib/screens/prescription/update_prescription_form.dart b/lib/screens/prescription/update_prescription_form.dart index 7c1bc88e..c520c5f2 100644 --- a/lib/screens/prescription/update_prescription_form.dart +++ b/lib/screens/prescription/update_prescription_form.dart @@ -14,7 +14,7 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; diff --git a/lib/screens/procedures/add-procedure-form.dart b/lib/screens/procedures/add-procedure-form.dart index 8fe7deea..bf62faf7 100644 --- a/lib/screens/procedures/add-procedure-form.dart +++ b/lib/screens/procedures/add-procedure-form.dart @@ -11,7 +11,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; diff --git a/lib/screens/procedures/add_lab_orders.dart b/lib/screens/procedures/add_lab_orders.dart index 29f01858..294cac72 100644 --- a/lib/screens/procedures/add_lab_orders.dart +++ b/lib/screens/procedures/add_lab_orders.dart @@ -11,7 +11,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; diff --git a/lib/screens/procedures/add_radiology_order.dart b/lib/screens/procedures/add_radiology_order.dart index 9e614d44..1807aee6 100644 --- a/lib/screens/procedures/add_radiology_order.dart +++ b/lib/screens/procedures/add_radiology_order.dart @@ -11,7 +11,7 @@ import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; diff --git a/lib/screens/procedures/entity_list_checkbox_search_widget.dart b/lib/screens/procedures/entity_list_checkbox_search_widget.dart index 0ca2e360..708aa49d 100644 --- a/lib/screens/procedures/entity_list_checkbox_search_widget.dart +++ b/lib/screens/procedures/entity_list_checkbox_search_widget.dart @@ -6,7 +6,7 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; diff --git a/lib/screens/procedures/entity_list_procedure_widget.dart b/lib/screens/procedures/entity_list_procedure_widget.dart index 2f5c6ea2..14108811 100644 --- a/lib/screens/procedures/entity_list_procedure_widget.dart +++ b/lib/screens/procedures/entity_list_procedure_widget.dart @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/procedure_View_model.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/divider_with_spaces_around.dart'; import 'package:doctor_app_flutter/widgets/shared/network_base_view.dart'; diff --git a/lib/screens/procedures/update-procedure.dart b/lib/screens/procedures/update-procedure.dart index d9c6a20a..696dc1ad 100644 --- a/lib/screens/procedures/update-procedure.dart +++ b/lib/screens/procedures/update-procedure.dart @@ -12,7 +12,7 @@ import 'package:doctor_app_flutter/screens/procedures/entity_list_procedure_widg import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/dialogs/dailog-list-select.dart'; import 'package:doctor_app_flutter/widgets/shared/loader/gif_loader_dialog_utils.dart'; diff --git a/lib/screens/reschedule-leaves/reschedule_leave.dart b/lib/screens/reschedule-leaves/reschedule_leave.dart index e2959c75..ae29cee6 100644 --- a/lib/screens/reschedule-leaves/reschedule_leave.dart +++ b/lib/screens/reschedule-leaves/reschedule_leave.dart @@ -14,7 +14,7 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/text_validator.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; diff --git a/lib/screens/sick-leave/sick_leave.dart b/lib/screens/sick-leave/sick_leave.dart index 0e1a8491..9b19e6cd 100644 --- a/lib/screens/sick-leave/sick_leave.dart +++ b/lib/screens/sick-leave/sick_leave.dart @@ -14,7 +14,7 @@ import 'package:doctor_app_flutter/util/text_validator.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/patient-page-header-widget.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_buttons_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; diff --git a/lib/widgets/auth/login_form.dart b/lib/widgets/auth/login_form.dart index 9fc50008..c9e13fd6 100644 --- a/lib/widgets/auth/login_form.dart +++ b/lib/widgets/auth/login_form.dart @@ -1,9 +1,8 @@ -import 'package:doctor_app_flutter/lookups/hospital_lookup.dart'; import 'package:doctor_app_flutter/screens/auth/verification_methods_screen.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_loader_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/app_text_form_field.dart'; import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; + import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter/rendering.dart'; @@ -17,7 +16,6 @@ import '../../config/size_config.dart'; import '../../models/doctor/user_model.dart'; import '../../core/viewModel/auth_view_model.dart'; import '../../core/viewModel/hospital_view_model.dart'; -import '../../routes.dart'; import '../../util/dr_app_shared_pref.dart'; import '../../util/dr_app_toast_msg.dart'; import '../../util/helpers.dart'; @@ -35,6 +33,7 @@ class LoginForm extends StatefulWidget with DrAppToastMsg { @override _LoginFormState createState() => _LoginFormState(); } + //TODO recreate the all page and apply the MVVM here class _LoginFormState extends State { final loginFormKey = GlobalKey(); @@ -57,6 +56,7 @@ class _LoginFormState extends State { sessionID: "i1UJwCTSqt"); AuthViewModel authProv; + @override void initState() { super.initState(); @@ -264,10 +264,11 @@ class _LoginFormState extends State { mainAxisAlignment: MainAxisAlignment.end, children: [ Expanded( - child: Button( + child: AppButton( title: TranslationBase.of(context).login, color: HexColor('#D02127'), - onTap: () { + fontWeight: FontWeight.bold, + onPressed: () { login(context, authProv, widget.changeLoadingStata); }, )), @@ -361,10 +362,11 @@ class _LoginFormState extends State { } }).catchError((err) { //TODO change the logic here - if(!err.contains('eservices.hmg@drsulaimanalhabib.com') ){ - hideLoading(); - changeLoadingStata(false); - helpers.showErrorToast(err);} + if (!err.contains('eservices.hmg@drsulaimanalhabib.com')) { + hideLoading(); + changeLoadingStata(false); + helpers.showErrorToast(err); + } }); } else { changeLoadingStata(false); diff --git a/lib/widgets/auth/verification_methods.dart b/lib/widgets/auth/verification_methods.dart index b4d39894..51867456 100644 --- a/lib/widgets/auth/verification_methods.dart +++ b/lib/widgets/auth/verification_methods.dart @@ -12,8 +12,10 @@ import 'package:doctor_app_flutter/models/doctor/profile_req_Model.dart'; import 'package:doctor_app_flutter/util/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/otp/sms-popup.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; + import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; + import 'package:doctor_app_flutter/widgets/shared/rounded_container_widget.dart'; import 'package:doctor_app_flutter/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; @@ -341,11 +343,11 @@ class _VerificationMethodsState extends State { ? Row( children: [ Expanded( - child: Button( + child: AppButton( title: TranslationBase.of(context) .useAnotherAccount, color: Colors.red[700], - onTap: () { + onPressed: () { Navigator.of(context).pushNamed(LOGIN); }, )), @@ -860,7 +862,12 @@ class _VerificationMethodsState extends State { sharedPref.setObj(DOCTOR_PROFILE, profile); projectsProvider.isLogin = true; - Navigator.pushAndRemoveUntil(context, FadePage(page: LandingPage(),), (r) => false); + Navigator.pushAndRemoveUntil( + context, + FadePage( + page: LandingPage(), + ), + (r) => false); } getDocProfiles(ClinicModel clinicInfo, authProv) { diff --git a/lib/widgets/doctor/my_referral_patient_widget.dart b/lib/widgets/doctor/my_referral_patient_widget.dart index 98371a9f..29f62d1d 100644 --- a/lib/widgets/doctor/my_referral_patient_widget.dart +++ b/lib/widgets/doctor/my_referral_patient_widget.dart @@ -7,8 +7,10 @@ import 'package:doctor_app_flutter/util/helpers.dart'; import 'package:doctor_app_flutter/util/translations_delegate_base.dart'; import 'package:doctor_app_flutter/widgets/shared/Text.dart'; import 'package:doctor_app_flutter/widgets/shared/TextFields.dart'; -import 'package:doctor_app_flutter/widgets/shared/app_button.dart'; + import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; + import 'package:doctor_app_flutter/widgets/shared/card_with_bgNew_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/expandable-widget-header-body.dart'; import 'package:flutter/cupertino.dart'; @@ -21,7 +23,12 @@ class MyReferralPatientWidget extends StatefulWidget { final bool isExpand; final Function expandClick; - MyReferralPatientWidget({Key key, this.myReferralPatientModel, this.model, this.isExpand, this.expandClick}); + MyReferralPatientWidget( + {Key key, + this.myReferralPatientModel, + this.model, + this.isExpand, + this.expandClick}); @override _MyReferralPatientWidgetState createState() => @@ -428,8 +435,9 @@ class _MyReferralPatientWidgetState extends State { Container( width: double.infinity, margin: EdgeInsets.only(left: 10, right: 10), - child: Button( - onTap: () async { + child: AppButton( + title : TranslationBase.of(context).replay, + onPressed: () async { final form = _formKey.currentState; if (form.validate()) { try { @@ -443,7 +451,6 @@ class _MyReferralPatientWidgetState extends State { } } }, - title: TranslationBase.of(context).replay, loading: widget.model.state == ViewState.BusyLocal, ), ) diff --git a/lib/widgets/shared/app_button.dart b/lib/widgets/shared/app_button.dart deleted file mode 100644 index 3f9c4549..00000000 --- a/lib/widgets/shared/app_button.dart +++ /dev/null @@ -1,150 +0,0 @@ -import 'package:flutter/material.dart'; -import 'package:hexcolor/hexcolor.dart'; - -class Button extends StatefulWidget { - final String title; - final Widget icon; - final VoidCallback onTap; - final bool loading; - final Color color; - - Button({ - Key key, - this.title = "", - this.icon, - this.onTap, - this.loading= false, - this.color, - }) : super(key: key); - - - - @override - _ButtonState createState() => _ButtonState(); -} - -class _ButtonState extends State