From 3f41ff267acd024daf155f76272af897c28932de Mon Sep 17 00:00:00 2001 From: RoaaGhali98 Date: Sun, 6 Mar 2022 16:05:24 +0300 Subject: [PATCH] Fix some design issue in admission request screens and make new component called two_bottom_sheet_dialog_buttons and use it in admission-request_second-screen.dart and admission-request-third-screen --- .../admission-request-first-screen.dart | 4 +- .../admission-request-third-screen.dart | 91 +++++ .../admission-request_second-screen.dart | 323 +++++++++--------- .../refer-patient-screen-in-patient.dart | 2 +- .../refer_details/refer-patient-screen.dart | 2 +- .../assessment/add_assessment_details.dart | 2 +- .../objective/add_examination_page.dart | 2 +- .../subjective/allergies/add_allergies.dart | 2 +- .../history/add_history_dialog.dart | 2 +- .../subjective/medication/add_medication.dart | 2 +- .../add_drug/add_drug_widget.dart | 2 +- .../procedures/add-favourite-procedure.dart | 2 +- .../bottom_sheet_dialog_button.dart | 2 +- .../two_bottom_sheet_dialog_buttons.dart | 50 +++ 14 files changed, 317 insertions(+), 171 deletions(-) rename lib/{screens/patients/profile/soap_update/shared_soap_widgets => widgets/bottom_sheet}/bottom_sheet_dialog_button.dart (96%) create mode 100644 lib/widgets/bottom_sheet/two_bottom_sheet_dialog_buttons.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 25175ab3..6cbadd09 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 @@ -14,7 +14,6 @@ import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-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/buttons/app_buttons_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'; import 'package:doctor_app_flutter/widgets/shared/text_fields/app-textfield-custom.dart'; @@ -22,9 +21,8 @@ import 'package:flutter/material.dart'; import 'package:flutter/services.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; - import '../../../../routes.dart'; -import '../soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; +import '../../../../widgets/bottom_sheet/bottom_sheet_dialog_button.dart'; class AdmissionRequestFirstScreen extends StatefulWidget { @override 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 47d496d5..b0ecb8de 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 @@ -10,6 +10,7 @@ import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; +import 'package:doctor_app_flutter/widgets/bottom_sheet/two_bottom_sheet_dialog_buttons.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -341,6 +342,96 @@ class _AdmissionRequestThirdScreenState ], ), ), + bottomSheet: TwoBottomSheetDialogButtons( + widget: Row( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.4, + child: AppButton( + title: TranslationBase.of(context).previous, + color: HexColor("#EAEAEA"), + fontColor: Colors.black, + onPressed: () { + Navigator.pop(context); + }, + ), + ), + SizedBox(width: 10,), + Container( + width: MediaQuery.of(context).size.width * 0.4, + child: AppButton( + title: TranslationBase.of(context).submit, + color: HexColor("#359846"), + onPressed: () async { + await locator().logEvent( + eventCategory: "Admission Request Third Screen", + eventAction: "Submit Admission Request", + ); + if (_selectedDiagnosis != null && + _selectedIcd != null && + _selectedDiagnosisType != null) { + model.admissionRequestData = admissionRequest; + + dynamic admissionRequestDiagnoses = [ + { + 'diagnosisDescription': + _selectedDiagnosis['nameEn'], + 'diagnosisType': _selectedDiagnosis['id'], + 'icdCode': _selectedIcd['code'], + 'icdCodeDescription': + _selectedIcd['description'], + 'type': _selectedDiagnosisType['code'], + 'remarks': "", + 'isActive': true, + } + ]; + model.admissionRequestData + .admissionRequestDiagnoses = + admissionRequestDiagnoses; + + await model.makeAdmissionRequest(); + if (model.state == ViewState.ErrorLocal) { + DrAppToastMsg.showErrorToast(model.error); + } else { + DrAppToastMsg.showSuccesToast( + TranslationBase.of(context) + .admissionRequestSuccessMsg); + Navigator.popUntil(context, + ModalRoute.withName(PATIENTS_PROFILE)); + } + } else { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context).pleaseFill); + + setState(() { + if (_selectedDiagnosis == null) { + diagnosisError = + TranslationBase.of(context).fieldRequired; + } else { + diagnosisError = null; + } + + if (_selectedIcd == null) { + icdError = + TranslationBase.of(context).fieldRequired; + } else { + icdError = null; + } + + if (_selectedDiagnosisType == null) { + diagnosisTypeError = + TranslationBase.of(context).fieldRequired; + } else { + diagnosisTypeError = null; + } + }); + } + }, + ), + ), + ], + ) + ), ), ); } 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 b00a76d6..275c0d2c 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 @@ -13,6 +13,7 @@ import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; +import 'package:doctor_app_flutter/widgets/bottom_sheet/two_bottom_sheet_dialog_buttons.dart'; import 'package:doctor_app_flutter/widgets/patients/patient_service_title.dart'; import 'package:doctor_app_flutter/widgets/patients/profile/app_bar/patient-profile-app-bar.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; @@ -456,6 +457,9 @@ class _AdmissionRequestSecondScreenState } }, ), + SizedBox( + height: 100, + ), ], ), ), @@ -463,184 +467,187 @@ class _AdmissionRequestSecondScreenState ), ), ), + ], + ), + ), + bottomSheet: TwoBottomSheetDialogButtons( + widget: Row( + children: [ Container( - margin: EdgeInsets.symmetric(horizontal: 16, vertical: 8), - child: Row( - children: [ - Expanded( - child: AppButton( - title: TranslationBase.of(context).previous, - color: Color(0xffEAEAEA), - fontColor: Colors.black, - onPressed: () { - Navigator.pop(context); - }, - ), - ), - SizedBox( - width: 10, - ), - Expanded( - child: AppButton( - title: TranslationBase.of(context).next, - color: HexColor("#D02127"), - onPressed: () async { - await locator().logEvent( - eventCategory: "Admission Request Second Screen", - eventAction: "Go To Admission Request Three", - ); - if (_estimatedCostController.text != "" && - _postPlansEstimatedCostController.text != "" && - _expectedDaysController.text != "" && - _expectedAdmissionDate != null && - _otherDepartmentsInterventionsController.text != - "" && - _selectedFloor != null && - _selectedRoomCategory != - null /*_selectedWard is not required*/ && - _treatmentLineController.text != "" && - _complicationsController.text != "" && - _otherProceduresController.text != "" && - _selectedAdmissionType != null) { - model.admissionRequestData = admissionRequest; + width: MediaQuery.of(context).size.width * 0.4, + child: AppButton( + title: TranslationBase.of(context).previous, + color: HexColor('#EFEFEF'), + fontColor: Colors.black, + onPressed: () { + Navigator.pop(context); + }, + ), + ), + SizedBox( + width: 10, + ), + Container( + width: MediaQuery.of(context).size.width * 0.4, + child: AppButton( + title: TranslationBase.of(context).next, + color: AppGlobal.appRedColor, + fontColor: Colors.white, + onPressed: () async { + await locator().logEvent( + eventCategory: "Admission Request Second Screen", + eventAction: "Go To Admission Request Three", + ); + if (_estimatedCostController.text != "" && + _postPlansEstimatedCostController.text != "" && + _expectedDaysController.text != "" && + _expectedAdmissionDate != null && + _otherDepartmentsInterventionsController.text != + "" && + _selectedFloor != null && + _selectedRoomCategory != + null /*_selectedWard is not required*/ && + _treatmentLineController.text != "" && + _complicationsController.text != "" && + _otherProceduresController.text != "" && + _selectedAdmissionType != null) { + model.admissionRequestData = admissionRequest; - model.admissionRequestData.estimatedCost = - int.parse(_estimatedCostController.text); - model.admissionRequestData - .elementsForImprovement = - _postPlansEstimatedCostController.text; + model.admissionRequestData.estimatedCost = + int.parse(_estimatedCostController.text); + model.admissionRequestData + .elementsForImprovement = + _postPlansEstimatedCostController.text; - model.admissionRequestData.expectedDays = - int.parse(_expectedDaysController.text); - model.admissionRequestData.admissionDate = - _expectedAdmissionDate.toIso8601String(); - model.admissionRequestData - .otherDepartmentInterventions = - _otherDepartmentsInterventionsController.text; - model.admissionRequestData.admissionLocationID = - _selectedFloor['floorID']; - model.admissionRequestData.wardID = - _selectedWard != null - ? _selectedWard['nursingStationID'] - : 0; - model.admissionRequestData.roomCategoryID = - _selectedRoomCategory['categoryID']; + model.admissionRequestData.expectedDays = + int.parse(_expectedDaysController.text); + model.admissionRequestData.admissionDate = + _expectedAdmissionDate.toIso8601String(); + model.admissionRequestData + .otherDepartmentInterventions = + _otherDepartmentsInterventionsController.text; + model.admissionRequestData.admissionLocationID = + _selectedFloor['floorID']; + model.admissionRequestData.wardID = + _selectedWard != null + ? _selectedWard['nursingStationID'] + : 0; + model.admissionRequestData.roomCategoryID = + _selectedRoomCategory['categoryID']; - model.admissionRequestData - .admissionRequestProcedures = []; + model.admissionRequestData + .admissionRequestProcedures = []; - model.admissionRequestData.mainLineOfTreatment = - _treatmentLineController.text; - model.admissionRequestData.complications = - _complicationsController.text; - model.admissionRequestData.otherProcedures = - _otherProceduresController.text; - model.admissionRequestData.admissionType = - _selectedAdmissionType['id']; + model.admissionRequestData.mainLineOfTreatment = + _treatmentLineController.text; + model.admissionRequestData.complications = + _complicationsController.text; + model.admissionRequestData.otherProcedures = + _otherProceduresController.text; + model.admissionRequestData.admissionType = + _selectedAdmissionType['id']; - Navigator.of(context).pushNamed( - PATIENT_ADMISSION_REQUEST_3, - arguments: { - 'patient': patient, - 'patientType': patientType, - 'arrivalType': arrivalType, - 'admission-data': model.admissionRequestData - }); - } else { - DrAppToastMsg.showErrorToast( - TranslationBase.of(context).pleaseFill); + Navigator.of(context).pushNamed( + PATIENT_ADMISSION_REQUEST_3, + arguments: { + 'patient': patient, + 'patientType': patientType, + 'arrivalType': arrivalType, + 'admission-data': model.admissionRequestData + }); + } else { + DrAppToastMsg.showErrorToast( + TranslationBase.of(context).pleaseFill); - setState(() { - if (_estimatedCostController.text == "") { - costError = - TranslationBase.of(context).fieldRequired; - } else { - costError = null; - } + setState(() { + if (_estimatedCostController.text == "") { + costError = + TranslationBase.of(context).fieldRequired; + } else { + costError = null; + } - if (_postPlansEstimatedCostController.text == - "") { - plansError = - TranslationBase.of(context).fieldRequired; - } else { - plansError = null; - } + if (_postPlansEstimatedCostController.text == + "") { + plansError = + TranslationBase.of(context).fieldRequired; + } else { + plansError = null; + } - if (_expectedDaysController.text == "") { - expectedDaysError = - TranslationBase.of(context).fieldRequired; - } else { - expectedDaysError = null; - } + if (_expectedDaysController.text == "") { + expectedDaysError = + TranslationBase.of(context).fieldRequired; + } else { + expectedDaysError = null; + } - if (_expectedAdmissionDate == null) { - expectedDatesError = - TranslationBase.of(context).fieldRequired; - } else { - expectedDatesError = null; - } + if (_expectedAdmissionDate == null) { + expectedDatesError = + TranslationBase.of(context).fieldRequired; + } else { + expectedDatesError = null; + } - if (_otherDepartmentsInterventionsController - .text == - "") { - otherInterventionsError = - TranslationBase.of(context).fieldRequired; - } else { - otherInterventionsError = null; - } + if (_otherDepartmentsInterventionsController + .text == + "") { + otherInterventionsError = + TranslationBase.of(context).fieldRequired; + } else { + otherInterventionsError = null; + } - if (_selectedFloor == null) { - floorError = - TranslationBase.of(context).fieldRequired; - } else { - floorError = null; - } + if (_selectedFloor == null) { + floorError = + TranslationBase.of(context).fieldRequired; + } else { + floorError = null; + } - if (_selectedRoomCategory == null) { - roomError = - TranslationBase.of(context).fieldRequired; - } else { - roomError = null; - } + if (_selectedRoomCategory == null) { + roomError = + TranslationBase.of(context).fieldRequired; + } else { + roomError = null; + } - if (_treatmentLineController.text == "") { - treatmentsError = - TranslationBase.of(context).fieldRequired; - } else { - treatmentsError = null; - } + if (_treatmentLineController.text == "") { + treatmentsError = + TranslationBase.of(context).fieldRequired; + } else { + treatmentsError = null; + } - if (_complicationsController.text == "") { - complicationsError = - TranslationBase.of(context).fieldRequired; - } else { - complicationsError = null; - } + if (_complicationsController.text == "") { + complicationsError = + TranslationBase.of(context).fieldRequired; + } else { + complicationsError = null; + } - if (_otherProceduresController.text == "") { - proceduresError = - TranslationBase.of(context).fieldRequired; - } else { - proceduresError = null; - } + if (_otherProceduresController.text == "") { + proceduresError = + TranslationBase.of(context).fieldRequired; + } else { + proceduresError = null; + } - if (_selectedAdmissionType == null) { - admissionTypeError = - TranslationBase.of(context).fieldRequired; - } else { - admissionTypeError = null; - } - }); - } - }, - ), - ), - ], + if (_selectedAdmissionType == null) { + admissionTypeError = + TranslationBase.of(context).fieldRequired; + } else { + admissionTypeError = null; + } + }); + } + }, ), ), ], - ), - )), + ) + ), + ), ); } diff --git a/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart b/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart index dfdb6f3d..3a69d0b3 100644 --- a/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart +++ b/lib/screens/patients/profile/referral/refer_details/refer-patient-screen-in-patient.dart @@ -6,7 +6,7 @@ import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dar import 'package:doctor_app_flutter/icons_app/doctor_app_icons.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; +import 'package:doctor_app_flutter/widgets/bottom_sheet/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; diff --git a/lib/screens/patients/profile/referral/refer_details/refer-patient-screen.dart b/lib/screens/patients/profile/referral/refer_details/refer-patient-screen.dart index fb336b42..bf9af33e 100644 --- a/lib/screens/patients/profile/referral/refer_details/refer-patient-screen.dart +++ b/lib/screens/patients/profile/referral/refer_details/refer-patient-screen.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/core/viewModel/patient-referral-viewmodel.dar import 'package:doctor_app_flutter/locator.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; +import 'package:doctor_app_flutter/widgets/bottom_sheet/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/utils/date-utils.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/utils.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 44a4fa73..0d98ff81 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 @@ -11,7 +11,7 @@ import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_as import 'package:doctor_app_flutter/core/model/doctor/doctor_profile_model.dart'; import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; +import 'package:doctor_app_flutter/widgets/bottom_sheet/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.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 79d77f4f..bd1801ac 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 @@ -4,7 +4,7 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_examination.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; +import 'package:doctor_app_flutter/widgets/bottom_sheet/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.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 1f3978fa..226ec2f3 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 @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_allergy.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; +import 'package:doctor_app_flutter/widgets/bottom_sheet/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.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 b9cd5213..277dd23a 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/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/selected_items/my_selected_history.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; +import 'package:doctor_app_flutter/widgets/bottom_sheet/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/soap_utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.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 dcca17a8..c9a07bb5 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 @@ -7,7 +7,7 @@ import 'package:doctor_app_flutter/core/viewModel/SOAP_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/project_view_model.dart'; import 'package:doctor_app_flutter/core/model/SOAP/master_key_model.dart'; import 'package:doctor_app_flutter/screens/base/base_view.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; +import 'package:doctor_app_flutter/widgets/bottom_sheet/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; import 'package:doctor_app_flutter/utils/translations_delegate_base_utils.dart'; import 'package:doctor_app_flutter/widgets/shared/app_scaffold_widget.dart'; diff --git a/lib/screens/prescription/add_prescription/add_drug/add_drug_widget.dart b/lib/screens/prescription/add_prescription/add_drug/add_drug_widget.dart index aa7d3c57..6f593a82 100644 --- a/lib/screens/prescription/add_prescription/add_drug/add_drug_widget.dart +++ b/lib/screens/prescription/add_prescription/add_drug/add_drug_widget.dart @@ -5,7 +5,7 @@ import 'package:doctor_app_flutter/core/model/patient/patiant_info_model.dart'; import 'package:doctor_app_flutter/core/model/search_drug/get_medication_response_model.dart'; import 'package:doctor_app_flutter/core/viewModel/medicine_view_model.dart'; import 'package:doctor_app_flutter/core/viewModel/prescription/prescription_view_model.dart'; -import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; +import 'package:doctor_app_flutter/widgets/bottom_sheet/bottom_sheet_dialog_button.dart'; import 'package:doctor_app_flutter/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_title.dart'; import 'package:doctor_app_flutter/utils/dr_app_toast_msg.dart'; import 'package:doctor_app_flutter/utils/utils.dart'; diff --git a/lib/screens/procedures/add-favourite-procedure.dart b/lib/screens/procedures/add-favourite-procedure.dart index 298dde1b..a004fc15 100644 --- a/lib/screens/procedures/add-favourite-procedure.dart +++ b/lib/screens/procedures/add-favourite-procedure.dart @@ -14,7 +14,7 @@ import 'package:doctor_app_flutter/widgets/shared/app_texts_widget.dart'; import 'package:doctor_app_flutter/widgets/shared/errors/error_message.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import '../patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart'; +import '../../widgets/bottom_sheet/bottom_sheet_dialog_button.dart'; import 'ProcedureType.dart'; class AddFavouriteProcedure extends StatefulWidget { diff --git a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart b/lib/widgets/bottom_sheet/bottom_sheet_dialog_button.dart similarity index 96% rename from lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart rename to lib/widgets/bottom_sheet/bottom_sheet_dialog_button.dart index 440e1e3e..13354f22 100644 --- a/lib/screens/patients/profile/soap_update/shared_soap_widgets/bottom_sheet_dialog_button.dart +++ b/lib/widgets/bottom_sheet/bottom_sheet_dialog_button.dart @@ -3,7 +3,7 @@ import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dar import 'package:flutter/material.dart'; import 'package:hexcolor/hexcolor.dart'; -import '../../../../../config/config.dart'; +import '../../config/config.dart'; class BottomSheetDialogButton extends StatelessWidget { final Function onTap; diff --git a/lib/widgets/bottom_sheet/two_bottom_sheet_dialog_buttons.dart b/lib/widgets/bottom_sheet/two_bottom_sheet_dialog_buttons.dart new file mode 100644 index 00000000..20eb6525 --- /dev/null +++ b/lib/widgets/bottom_sheet/two_bottom_sheet_dialog_buttons.dart @@ -0,0 +1,50 @@ +import 'package:doctor_app_flutter/config/size_config.dart'; +import 'package:doctor_app_flutter/widgets/shared/buttons/app_buttons_widget.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +import '../../config/config.dart'; + +class TwoBottomSheetDialogButtons extends StatelessWidget { + final Function onTap; + final String label; + final Widget widget; + + double headerHeight = SizeConfig.heightMultiplier * 12; + + TwoBottomSheetDialogButtons({Key key, this.onTap, this.label, this.widget}) : super(key: key); + + @override + Widget build(BuildContext context) { + return Container( + decoration: BoxDecoration( + color: Colors.white, + borderRadius: BorderRadius.all( + Radius.circular(0.0), + ), + border: Border.all(color: HexColor('#EFEFEF'), width: 1), + ), + height: headerHeight, + width: double.infinity, + child: Column( + children: [ + Container( + margin: EdgeInsets.only( + top: headerHeight * (SizeConfig.isWidthLarge ? 0.3 : 0.2), left: SizeConfig.heightMultiplier*4.5 + ), + child: Center( + child: Row( + children: [ + widget, + ], + ) + ), + ), + SizedBox( + height: 5, + ), + ], + ), + ); + } +}