diff --git a/lib/config/config.dart b/lib/config/config.dart index 40cd68bb..7152cbbe 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -13,8 +13,8 @@ const PACKAGES_CUSTOMER = '/api/customers'; const PACKAGES_SHOPPING_CART = '/api/shopping_cart_items'; const PACKAGES_ORDERS = '/api/orders'; -// const BASE_URL = 'https://uat.hmgwebservices.com/'; -const BASE_URL = 'https://hmgwebservices.com/'; +const BASE_URL = 'https://uat.hmgwebservices.com/'; +// const BASE_URL = 'https://hmgwebservices.com/'; // Pharmacy UAT URLs const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; @@ -338,6 +338,9 @@ const GET_PATIENT_HEALTH_STATS = const SEND_CHECK_IN_NFC_REQUEST = 'Services/Patients.svc/REST/Patient_CheckAppointmentValidation_ForNFC'; +const HAS_DENTAL_PLAN = + 'Services/Doctors.svc/REST/Dental_IsPatientHasOnGoingEstimation'; + //URL to get medicine and pharmacies list const CHANNEL = 3; const GENERAL_ID = 'Cs2020@2016\$2958'; @@ -505,7 +508,8 @@ const GET_DOCTOR_LIST_BY_TIME = "Services/Doctors.svc/REST/SearchDoctorsByTime"; const PHARMACY_AUTORZIE_CUSTOMER = "AutorizeCustomer"; const PHARMACY_VERIFY_CUSTOMER = "VerifyCustomer"; const PHARMACY_GET_COUNTRY = "countries"; -const PHARMACY_CREATE_CUSTOMER = "epharmacy/api/CreateCustomer"; +// const PHARMACY_CREATE_CUSTOMER = "epharmacy/api/CreateCustomer"; +const PHARMACY_CREATE_CUSTOMER = "epharmacy/api/getorcreateCustomer"; const GET_PHARMACY_BANNER = "promotionbanners"; const GET_PHARMACY_TOP_MANUFACTURER = "topmanufacturer"; const GET_PHARMACY_BEST_SELLER_PRODUCT = "bestsellerproducts"; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 682c73d9..f445c8b3 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -224,7 +224,7 @@ const Map localizedValues = { "companyName": {"en": "Company Name ", "ar": "اسم الشركة: "}, "receiptOn": {"en": "Receipt on: ", "ar": "تاريخ الفاتورة: "}, "expiryDate": {"en": "Expiry Date: ", "ar": "تاريخ الانتهاء: "}, - "procedureName": {"en": "Procedure Name", "ar": "اسم الاجراء"}, + "procedureName": {"en": "Procedure Name:", "ar": "اسم الاجراء:"}, "procedureStatus": {"en": "Procedure Status: ", "ar": "حالة الاجراء"}, "usageStatus": {"en": "Usage Status", "ar": "جالة الاستخدام"}, "unusedCount": {"en": "Unused Count: ", "ar": "غير مستخدم: "}, @@ -423,10 +423,7 @@ const Map localizedValues = { "en": "Please select treatment start day and time to be notified when it\'s time to take the medicine", "ar": " يرجى تحديد يوم بدء العلاج والوقت ليتم ارسال تنبيه عندما يحين الوقت لتناول الدواء" }, - "pleaseSelectAllQuestionToContinue": { - "en": "Please answer all questions to continue...", - "ar": "يرجى الإجابة على جميع الأسئلة للمتابعة..." - }, + "pleaseSelectAllQuestionToContinue": {"en": "Please answer all questions to continue...", "ar": "يرجى الإجابة على جميع الأسئلة للمتابعة..."}, "StartDay": {"en": "Start Day", "ar": "يوم البداية"}, "EndDay": {"en": "End Day", "ar": "يوم الانتهاء"}, "Days": {"en": "Days ", "ar": "أيام"}, @@ -1354,4 +1351,8 @@ const Map localizedValues = { "passport-number": {"en": "Passport Number", "ar": "رقم جواز السفر"}, "enter-passport-number": {"en": "Please confirm or update your passport number:", "ar": "الرجاء تأكيد أو تحديث رقم جواز السفر الخاص بك:"}, "valid-passport-number": {"en": "Please enter valid passport number", "ar": "الرجاء إدخال رقم جواز سفر صالح"}, + "continue-plan": {"en": "Continue with the treatment plan?", "ar": "إكمال الخطة العلاجية؟"}, + "dental-procedure-list": {"en": "Dental Procedures for this Appointment: ", "ar": "إجراءات الأسنان لهذا الموعد:"}, + "time-needed": {"en": "Time Needed:", "ar": "الوقت اللازم:"}, + "total-time-needed": {"en": "Total Appointment Time:", "ar": "وقت المواعيد الكلي:"}, }; diff --git a/lib/core/service/parmacyModule/parmacy_module_service.dart b/lib/core/service/parmacyModule/parmacy_module_service.dart index 7fa095ca..72bc56c7 100644 --- a/lib/core/service/parmacyModule/parmacy_module_service.dart +++ b/lib/core/service/parmacyModule/parmacy_module_service.dart @@ -10,7 +10,6 @@ import 'package:diplomaticquarterapp/uitl/utils.dart'; class PharmacyModuleService extends BaseService { final AppSharedPreferences sharedPref = AppSharedPreferences(); bool isFinished = true; - bool hasError = false; String errorMsg = ''; String url = ""; @@ -114,6 +113,7 @@ class PharmacyModuleService extends BaseService { } Future getTopManufacturerList() async { + hasError = false; Map queryParams = {'page': '1', 'limit': '8'}; try { await baseAppClient.getPharmacy(GET_PHARMACY_TOP_MANUFACTURER, diff --git a/lib/core/service/parmacyModule/prescription_service.dart b/lib/core/service/parmacyModule/prescription_service.dart index c2312890..d81c125d 100644 --- a/lib/core/service/parmacyModule/prescription_service.dart +++ b/lib/core/service/parmacyModule/prescription_service.dart @@ -45,8 +45,6 @@ class PrescriptionService extends BaseService { _prescriptionsList.add(Prescriptions.fromJson(prescriptions)); }); print(_prescriptionsList.length); - print("response is -------------"+response); - print(response); }, onFailure: (String error, int statusCode) { hasError = true; super.error = error; diff --git a/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart b/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart index 79f4bad8..e63bb166 100644 --- a/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart +++ b/lib/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart @@ -74,6 +74,7 @@ class PharmacyModuleViewModel extends BaseViewModel { setState(ViewState.Idle); } } + Future generatePharmacyToken() async { setState(ViewState.Busy); await _pharmacyService.generatePharmacyToken(); diff --git a/lib/models/Appointments/DentalProceduresModel.dart b/lib/models/Appointments/DentalProceduresModel.dart new file mode 100644 index 00000000..a66be8d1 --- /dev/null +++ b/lib/models/Appointments/DentalProceduresModel.dart @@ -0,0 +1,76 @@ +class DentalProceduresModel { + List listIsPatientHasOnGoingEstimation; + + DentalProceduresModel({this.listIsPatientHasOnGoingEstimation}); + + DentalProceduresModel.fromJson(Map json) { + if (json['List_IsPatientHasOnGoingEstimation'] != null) { + listIsPatientHasOnGoingEstimation = + new List(); + json['List_IsPatientHasOnGoingEstimation'].forEach((v) { + listIsPatientHasOnGoingEstimation + .add(new ListIsPatientHasOnGoingEstimation.fromJson(v)); + }); + } + } + + Map toJson() { + final Map data = new Map(); + if (this.listIsPatientHasOnGoingEstimation != null) { + data['List_IsPatientHasOnGoingEstimation'] = this + .listIsPatientHasOnGoingEstimation + .map((v) => v.toJson()) + .toList(); + } + return data; + } +} + +class ListIsPatientHasOnGoingEstimation { + dynamic setupID; + dynamic estimationNo; + int projectID; + String procedureId; + int patientID; + int sequenceNo; + int neededTime; + String procedureName; + dynamic procedureNameN; + + ListIsPatientHasOnGoingEstimation( + {this.setupID, + this.estimationNo, + this.projectID, + this.procedureId, + this.patientID, + this.sequenceNo, + this.neededTime, + this.procedureName, + this.procedureNameN}); + + ListIsPatientHasOnGoingEstimation.fromJson(Map json) { + setupID = json['SetupID']; + estimationNo = json['EstimationNo']; + projectID = json['ProjectID']; + procedureId = json['ProcedureId']; + patientID = json['PatientID']; + sequenceNo = json['sequenceNo']; + neededTime = json['NeededTime']; + procedureName = json['ProcedureName']; + procedureNameN = json['ProcedureNameN']; + } + + Map toJson() { + final Map data = new Map(); + data['SetupID'] = this.setupID; + data['EstimationNo'] = this.estimationNo; + data['ProjectID'] = this.projectID; + data['ProcedureId'] = this.procedureId; + data['PatientID'] = this.patientID; + data['sequenceNo'] = this.sequenceNo; + data['NeededTime'] = this.neededTime; + data['ProcedureName'] = this.procedureName; + data['ProcedureNameN'] = this.procedureNameN; + return data; + } +} diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart index fb41e39a..c07b8345 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_one_page.dart @@ -40,7 +40,6 @@ class _NewCMCStepOnePageState extends State { return AppScaffold( isShowAppBar: false, - isShowBottomNavBar: false, baseViewModel: widget.model, body: SingleChildScrollView( physics: ScrollPhysics(), diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart index a5dcf998..75699a5c 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_three_page.dart @@ -65,7 +65,6 @@ class _NewCMCStepThreePageState extends State { return AppScaffold( isShowDecPage: false, baseViewModel: widget.model, - isShowBottomNavBar: false, body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart index 3a0f35ff..3d969d9e 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/NewCMC/new_cmc_step_tow_page.dart @@ -71,7 +71,6 @@ class _NewCMCStepTowPageState extends State { ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( isShowDecPage: false, - isShowBottomNavBar: false, body: Stack( children: [ PlacePicker( diff --git a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart index c6a09c3c..ec686e70 100644 --- a/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/orders_log_details_page.dart @@ -51,7 +51,6 @@ class OrdersLogDetailsPage extends StatelessWidget { return AppScaffold( isShowAppBar: false, baseViewModel: model, - isShowBottomNavBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart index 2bf6427e..5a3271f2 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_one_page.dart @@ -93,7 +93,6 @@ class _NewEReferralStepOnePageState extends State { onModelReady: (model) => model.getRelationTypes(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, - isShowBottomNavBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart index c377148f..a823c154 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_three_page.dart @@ -52,7 +52,6 @@ class _NewEReferralStepThreePageState extends State { return BaseView( builder: (_, model, widget) => AppScaffold( isShowAppBar: false, - isShowBottomNavBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart index 2b27cc7a..5f85fe12 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/New_E_Referral/new_e_referral_step_two_page.dart @@ -60,7 +60,6 @@ class _NewEReferralStepTowPageState extends State { onModelReady: (model) => model.getAllCities(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, - isShowBottomNavBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart index ddb374fb..9007229a 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart @@ -38,7 +38,6 @@ class _EReferralPageState extends State return BaseView( builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - appBarTitle: TranslationBase.of(context).ereferral, description: TranslationBase.of(context).eReferralInfo, imagesInfo: [ diff --git a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart index 0d77ff24..0b75705d 100644 --- a/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart +++ b/lib/pages/AlHabibMedicalService/E-Referral/search_for_referrals_page.dart @@ -47,7 +47,6 @@ class _SearchForReferralsPageState extends State { onModelReady: (model) => model.getAllCities(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, - isShowBottomNavBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart index 5503895a..86ee791b 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_one_page.dart @@ -52,7 +52,6 @@ class _NewHomeHealthCareStepOnePageState return AppScaffold( isShowAppBar: false, baseViewModel: widget.model, - isShowBottomNavBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart index 210345cb..5e9bd04d 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_three_page.dart @@ -71,7 +71,6 @@ class _NewHomeHealthCareStepThreePageState return AppScaffold( isShowDecPage: false, baseViewModel: widget.model, - isShowBottomNavBar: false, body: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart index 4dfffa82..e9ddd2d1 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/new_Home_health_care_step_tow_page.dart @@ -74,7 +74,6 @@ class _NewHomeHealthCareStepTowPageState ProjectViewModel projectViewModel = Provider.of(context); return AppScaffold( isShowDecPage: false, - isShowBottomNavBar: false, body: Stack( children: [ PlacePicker( diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart new file mode 100644 index 00000000..fa0799f9 --- /dev/null +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart @@ -0,0 +1,69 @@ +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; +import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; +import 'package:flutter/material.dart'; +import 'package:hexcolor/hexcolor.dart'; + +import 'home_health_care_page.dart'; + +class HomeHealthCareIndexPage extends StatelessWidget { + @override + Widget build(BuildContext context) { + return AppScaffold( + isShowAppBar: true, + appBarTitle: TranslationBase.of(context).serviceInformation, + body: SingleChildScrollView( + padding: EdgeInsets.all(12), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Texts( + TranslationBase.of(context).homeHealthCare, + fontWeight: FontWeight.normal, + fontSize: 25, + color: Color(0xff60686b), + ), + SizedBox( + height: 12, + ), + Texts( + TranslationBase.of(context).homeHealthCareText, + fontWeight: FontWeight.normal, + fontSize: 17, + ), + SizedBox( + height: 22, + ), + Center( + child: Image.asset( + 'assets/images/AlHabibMedicalService/Wifi-AR.png')), + SizedBox( + height: 77, + ), + ], + )), + bottomSheet: Container( + height: MediaQuery.of(context).size.height * 0.10, + width: double.infinity, + child: Column( + children: [ + Container( + width: MediaQuery.of(context).size.width * 0.9, + child: SecondaryButton( + onTap: () => Navigator.push( + context, + FadePage( + page: HomeHealthCarePage(), + ), + ), + label: TranslationBase.of(context).loginRegister, + textColor: Theme.of(context).backgroundColor), + ), + ], + ), + )); + } +} diff --git a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart index 79d037f5..f0ca5fe4 100644 --- a/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart +++ b/lib/pages/AlHabibMedicalService/HomeHealthCare/orders_log_details_page.dart @@ -51,7 +51,6 @@ class OrdersLogDetailsPage extends StatelessWidget { return AppScaffold( isShowAppBar: false, baseViewModel: model, - isShowBottomNavBar: false, body: SingleChildScrollView( physics: ScrollPhysics(), child: Container( diff --git a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart index 43eeedfa..d6a60e3d 100644 --- a/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart +++ b/lib/pages/AlHabibMedicalService/all_habib_medical_service_page.dart @@ -169,7 +169,7 @@ class _AllHabibMedicalServiceState extends State { Navigator.push( context, FadePage( - page: MedicalProfilePage(isFromAllServicePage: true), + page: MedicalProfilePage(), ), ); }, diff --git a/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart b/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart index 09dbc4e3..e6e05ee6 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h2o_index_page.dart @@ -13,7 +13,6 @@ class H2OPageIndexPage extends StatelessWidget { Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - //isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).serviceInformation, body: SingleChildScrollView( padding: EdgeInsets.all(12), diff --git a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart index 49e5c8db..b847190f 100644 --- a/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/h2o_page.dart @@ -48,7 +48,6 @@ class _H2OPageState extends State with SingleTickerProviderStateMixin { onModelReady: (model) => model.getUserDetail(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).waterTracker, showHomeAppBarIcon: false, baseViewModel: model, diff --git a/lib/pages/AlHabibMedicalService/h2o/month_page.dart b/lib/pages/AlHabibMedicalService/h2o/month_page.dart index e65bef82..8867fb77 100644 --- a/lib/pages/AlHabibMedicalService/h2o/month_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/month_page.dart @@ -19,8 +19,6 @@ class MonthPage extends StatelessWidget { onModelReady: (model) => model.getUserProgressForMonthData(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, - isShowBottomNavBar: false, - appBarTitle: TranslationBase.of(context).h2o, baseViewModel: model, body: Padding( diff --git a/lib/pages/AlHabibMedicalService/h2o/today_page.dart b/lib/pages/AlHabibMedicalService/h2o/today_page.dart index e8e15a83..03d11f50 100644 --- a/lib/pages/AlHabibMedicalService/h2o/today_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/today_page.dart @@ -22,7 +22,6 @@ class TodayPage extends StatelessWidget { onModelReady: (model) => model.getUserProgressForTodayData(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, - isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).h2o, baseViewModel: model, body: SingleChildScrollView( diff --git a/lib/pages/AlHabibMedicalService/h2o/week_page.dart b/lib/pages/AlHabibMedicalService/h2o/week_page.dart index 0c9691c4..6f4423b2 100644 --- a/lib/pages/AlHabibMedicalService/h2o/week_page.dart +++ b/lib/pages/AlHabibMedicalService/h2o/week_page.dart @@ -19,7 +19,6 @@ class WeekPage extends StatelessWidget { onModelReady: (model) => model.getUserProgressForWeekData(), builder: (_, model, widget) => AppScaffold( isShowAppBar: false, - isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).h2o, baseViewModel: model, body: Padding( diff --git a/lib/pages/BookAppointment/BookingOptions.dart b/lib/pages/BookAppointment/BookingOptions.dart index 91d90da6..83af454f 100644 --- a/lib/pages/BookAppointment/BookingOptions.dart +++ b/lib/pages/BookAppointment/BookingOptions.dart @@ -32,8 +32,6 @@ class _BookingOptionsState extends State { return AppScaffold( isShowAppBar: widget.isAppbar, isShowDecPage: false, - isShowBottomNavBar: false, - appBarTitle: TranslationBase.of(context).bookAppo, body: Container( margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0), diff --git a/lib/pages/BookAppointment/DentalComplaints.dart b/lib/pages/BookAppointment/DentalComplaints.dart index 614189e0..0fbfa624 100644 --- a/lib/pages/BookAppointment/DentalComplaints.dart +++ b/lib/pages/BookAppointment/DentalComplaints.dart @@ -1,11 +1,18 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DentalProceduresModel.dart'; +import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DentalComplaintCard.dart'; -import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_card.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; +import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; +import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; +import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; @@ -22,12 +29,18 @@ class _DentalComplaintsState extends State { List complaintsList = []; AppSharedPreferences sharedPref = AppSharedPreferences(); bool isDataLoaded = false; + bool hasDentalPlan = false; var languageID; + int totalAppointmentTime = 0; + + List doctorsList = []; + + DentalProceduresModel dentalProceduresModel; + List patientDoctorAppointmentListHospital = List(); @override void initState() { - WidgetsBinding.instance - .addPostFrameCallback((_) => getChiefComplaintsList()); + WidgetsBinding.instance.addPostFrameCallback((_) => checkIfHasDentalPlan()); super.initState(); } @@ -38,37 +51,206 @@ class _DentalComplaintsState extends State { appBarTitle: "Symptoms", body: Container( margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), - child: ListView.builder( - itemCount: complaintsList.length, - itemBuilder: (BuildContext context, int index) { - return Container( - margin: EdgeInsets.only(bottom: 10.0), - child: DentalComplaintCard( - listDentalChiefComplain: complaintsList[index], - languageID: languageID, + child: !hasDentalPlan + ? ListView.builder( + itemCount: complaintsList.length, + itemBuilder: (BuildContext context, int index) { + return Container( + margin: EdgeInsets.only(bottom: 10.0), + child: DentalComplaintCard( + listDentalChiefComplain: complaintsList[index], + languageID: languageID, + ), + ); + }, + ) + : Container( + child: SingleChildScrollView( + child: Column( + children: [ + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text(TranslationBase.of(context).dentalProcedureList, textAlign: TextAlign.center, style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold, letterSpacing: 0.5)), + ), + Container( + margin: EdgeInsets.only(top: 20.0), + child: Table( + children: getProceduresData(), + ), + ), + ...List.generate( + patientDoctorAppointmentListHospital.length, + (index) => AppExpandableNotifier( + isExpand: true, + title: patientDoctorAppointmentListHospital[index].filterName + " - " + patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km, + bodyWidget: Column( + crossAxisAlignment: CrossAxisAlignment.start, + mainAxisAlignment: MainAxisAlignment.spaceBetween, + children: patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.map((doctor) { + return DoctorView( + doctor: doctor, + isLiveCareAppointment: false, + ); + }).toList(), + )), + ) + ], + ), ), - ); - }, + ), + ), + ); + } + + List getProceduresData() { + List tableRow = []; + + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + child: Center( + child: Text(TranslationBase.of(context).procedureName, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold, fontSize: 14.0)), + ), + ), + ), + Container( + child: Container( + margin: EdgeInsets.only(bottom: 10.0), + child: Center( + child: Text(TranslationBase.of(context).timeNeeded, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold, fontSize: 14.0)), + ), + ), + ), + ], + ), + ); + dentalProceduresModel.listIsPatientHasOnGoingEstimation.forEach((procedure) { + tableRow.add(TableRow(children: [ + Container( + child: Container( + child: Center( + child: Text(procedure.procedureName, textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontSize: 14.0)), + ), + ), ), + Container( + child: Container( + child: Center( + child: Text(procedure.neededTime.toString() + " mins", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontSize: 14.0)), + ), + ), + ), + ])); + }); + tableRow.add( + TableRow( + children: [ + Container( + child: Container( + child: Center( + child: Text(TranslationBase.of(context).totalTimeNeeded, textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold, fontSize: 14.0)), + ), + ), + ), + Container( + child: Container( + margin: EdgeInsets.only(bottom: 10.0), + child: Center( + child: Text(totalAppointmentTime.toString() + " mins", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold, fontSize: 14.0)), + ), + ), + ), + ], ), ); + return tableRow; } getLanguageID() async { languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); } + checkIfHasDentalPlan() { + DoctorsListService service = new DoctorsListService(); + GifLoaderDialogUtils.showMyDialog(context); + service.checkIfHasDentalPlan(widget.searchInfo.ProjectID, context).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + if (res['List_IsPatientHasOnGoingEstimation'].length != 0) { + ConfirmDialog dialog = new ConfirmDialog( + context: context, + confirmMessage: TranslationBase.of(context).continuePlan, + okText: TranslationBase.of(context).yes, + cancelText: TranslationBase.of(context).no, + okFunction: () => {Navigator.of(context).pop(), continueDentalPlan()}, + cancelFunction: () => {getChiefComplaintsList()}); + dialog.showAlertDialog(context); + } else { + getChiefComplaintsList(); + } + } + }).catchError((err) { + print(err); + }); + } + + continueDentalPlan() { + DoctorsListService service = new DoctorsListService(); + + GifLoaderDialogUtils.showMyDialog(context); + int appoTime = 0; + service.getDoctorsList(int.parse("17"), widget.searchInfo.ProjectID, false, context, isContinueDentalPlan: true).then((res) { + GifLoaderDialogUtils.hideDialog(context); + if (res['MessageStatus'] == 1) { + print(res['List_IsPatientHasOnGoingEstimation']); + dentalProceduresModel = DentalProceduresModel.fromJson(res); + dentalProceduresModel.listIsPatientHasOnGoingEstimation.forEach((procedure) { + appoTime += procedure.neededTime; + }); + setState(() { + hasDentalPlan = true; + totalAppointmentTime = appoTime; + }); + + if (res['DoctorList'].length != 0) { + doctorsList.clear(); + res['DoctorList'].forEach((v) { + doctorsList.add(new DoctorList.fromJson(v)); + }); + doctorsList.forEach((element) { + List doctorByHospital = patientDoctorAppointmentListHospital + .where( + (elementClinic) => elementClinic.filterName == element.projectName, + ) + .toList(); + + if (doctorByHospital.length != 0) { + patientDoctorAppointmentListHospital[patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element); + } else { + patientDoctorAppointmentListHospital + .add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element)); + } + }); + } else {} + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + print(err); + AppToast.showErrorToast(message: err); + }); + } + getChiefComplaintsList() { GifLoaderDialogUtils.showMyDialog(context); getLanguageID(); ClinicListService service = new ClinicListService(); - service - .getChiefComplaintsList( - widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, context) - .then((res) { + service.getChiefComplaintsList(widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { - print(res['List_DentalChiefComplain']); setState(() { res['List_DentalChiefComplain'].forEach((v) { complaintsList.add(new ListDentalChiefComplain.fromJson(v)); diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 6929755b..9c52adef 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -68,7 +68,6 @@ class _DoctorProfileState extends State return AppScaffold( appBarTitle: TranslationBase.of(context).bookAppo, isShowAppBar: true, - isShowBottomNavBar: false, isShowDecPage: false, bottomSheet: showFooterButton ? Container( diff --git a/lib/pages/BookAppointment/doctor_post_pre_images_page.dart b/lib/pages/BookAppointment/doctor_post_pre_images_page.dart index b97d58ac..85e37308 100644 --- a/lib/pages/BookAppointment/doctor_post_pre_images_page.dart +++ b/lib/pages/BookAppointment/doctor_post_pre_images_page.dart @@ -1,67 +1,10 @@ -import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; import 'package:diplomaticquarterapp/models/Appointments/doctor_pre_post_image.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -class DoctorPostPreImagesPage extends StatefulWidget{ - final DoctorPrePostImages doctorPrePostImages; - - const DoctorPostPreImagesPage({this.doctorPrePostImages}); - - @override - State createState() => DoctorPostPreImagesPageState(); -} - -class DoctorPostPreImagesPageState extends State{ - - @override - Widget build(BuildContext context) { - var images = widget.doctorPrePostImages; - return AppScaffold( - appBarTitle: TranslationBase.of(context).beforeAfterImages, - isShowAppBar: true, - isShowDecPage: false, - body: Padding( - padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 10), - child: Row( - children: [ - Expanded( - child: Column( - children: [ - Text("Before Image", style: TextStyle(color: Colors.black, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),), - Image.memory(images.getPreBytes(), errorBuilder: (ctx,err, trace){ - return Container( - color: Colors.grey.withOpacity(0.25), - ); - },) - ], - ) - ), - Divider(color: Colors.grey.withOpacity(0.5)), - Expanded( - child: Column( - children: [ - Text("After Image", style: TextStyle(color: Colors.black, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),), - Image.memory(images.getPostBytes(),errorBuilder: (ctx,err, trace){ - return Container( - color: Colors.grey.withOpacity(0.25), - ); - },) - ], - ) - ) - ], - ), - ) - ); - } - -} - - -class DoctorPostPreImagesContent extends StatefulWidget{ +class DoctorPostPreImagesContent extends StatefulWidget { final DoctorPrePostImages doctorPrePostImages; const DoctorPostPreImagesContent({this.doctorPrePostImages}); @@ -70,14 +13,13 @@ class DoctorPostPreImagesContent extends StatefulWidget{ DoctorPostPreImagesContentState createState() => DoctorPostPreImagesContentState(); } -class DoctorPostPreImagesContentState extends State{ - +class DoctorPostPreImagesContentState extends State { @override Widget build(BuildContext context) { var images = widget.doctorPrePostImages; - return Material( - color: Colors.transparent, - child: Center( + return Center( + child: Material( + color: Colors.transparent, child: Column( mainAxisSize: MainAxisSize.min, children: [ @@ -85,31 +27,45 @@ class DoctorPostPreImagesContentState extends State{ children: [ Expanded( child: Column( - children: [ - Text("Before", style: TextStyle(color: Colors.white, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),), - SizedBox(height: 10,), - Image.memory(images.getPreBytes(), errorBuilder: (ctx,err, trace){ - return Container( - color: Colors.grey.withOpacity(0.25), - ); - },) - ], + children: [ + Text( + "Before", + style: TextStyle(color: Colors.white, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1), + ), + SizedBox( + height: 10, + ), + Image.memory( + images.getPreBytes(), + errorBuilder: (ctx, err, trace) { + return Container( + color: Colors.grey.withOpacity(0.25), + ); + }, ) - ), + ], + )), Divider(color: Colors.grey.withOpacity(0.5)), Expanded( child: Column( - children: [ - Text("After", style: TextStyle(color: Colors.white, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),), - SizedBox(height: 10,), - Image.memory(images.getPostBytes(),errorBuilder: (ctx,err, trace){ - return Container( - color: Colors.grey.withOpacity(0.25), - ); - },) - ], + children: [ + Text( + "After", + style: TextStyle(color: Colors.white, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1), + ), + SizedBox( + height: 10, + ), + Image.memory( + images.getPostBytes(), + errorBuilder: (ctx, err, trace) { + return Container( + color: Colors.grey.withOpacity(0.25), + ); + }, ) - ) + ], + )) ], ), ], @@ -117,5 +73,4 @@ class DoctorPostPreImagesContentState extends State{ ), ); } - -} \ No newline at end of file +} diff --git a/lib/pages/ContactUs/LiveChat/livechat_page.dart b/lib/pages/ContactUs/LiveChat/livechat_page.dart index f2485cb6..a747db3d 100644 --- a/lib/pages/ContactUs/LiveChat/livechat_page.dart +++ b/lib/pages/ContactUs/LiveChat/livechat_page.dart @@ -41,7 +41,6 @@ class _LiveChatPageState extends State Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - isShowBottomNavBar: false, imagesInfo: imagesInfo, title: TranslationBase.of(context).liveChat, description: TranslationBase.of(context).infoChat, diff --git a/lib/pages/ContactUs/findus/findus_page.dart b/lib/pages/ContactUs/findus/findus_page.dart index a01e2fd5..80648292 100644 --- a/lib/pages/ContactUs/findus/findus_page.dart +++ b/lib/pages/ContactUs/findus/findus_page.dart @@ -39,7 +39,6 @@ class _FindUsPageState extends State builder: (_, model, w) => AppScaffold( isShowAppBar: true, isShowDecPage: false, - isShowBottomNavBar: false, appBarTitle: 'Locations', baseViewModel: model, body: Scaffold( diff --git a/lib/pages/DrawerPages/family/my-family.dart b/lib/pages/DrawerPages/family/my-family.dart index 0dfbd429..7493dfc1 100644 --- a/lib/pages/DrawerPages/family/my-family.dart +++ b/lib/pages/DrawerPages/family/my-family.dart @@ -38,10 +38,7 @@ import 'package:provider/provider.dart'; class MyFamily extends StatefulWidget { final bool isAppbarVisible; - - final bool isFromAllServicePage; - - MyFamily({this.isAppbarVisible = true, this.isFromAllServicePage = false}); + MyFamily({this.isAppbarVisible = true}); @override _MyFamily createState() => _MyFamily(); } @@ -95,8 +92,6 @@ class _MyFamily extends State with TickerProviderStateMixin { isShowAppBar: widget.isAppbarVisible, imagesInfo: imagesInfo, description: TranslationBase.of(context).familyInfo, - isShowBottomNavBar: widget.isFromAllServicePage, - body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( diff --git a/lib/pages/ErService/AmbulanceReq.dart b/lib/pages/ErService/AmbulanceReq.dart index 72e775e3..1d4e78ee 100644 --- a/lib/pages/ErService/AmbulanceReq.dart +++ b/lib/pages/ErService/AmbulanceReq.dart @@ -51,7 +51,6 @@ class _AmbulanceReqState extends State onModelReady: (model) => model.getAmRequestOrders(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).transportationService, description: TranslationBase.of(context).infoAmbulance, imagesInfo: imagesInfo, diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 1de71291..877192e6 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -57,7 +57,6 @@ class _AppointmentDetailsState extends State return AppScaffold( appBarTitle: widget.appo.doctorNameObj, isShowAppBar: true, - isShowBottomNavBar: false, bottomSheet: AppointmentDetails.showFooterButton ? Container( width: MediaQuery.of(context).size.width, diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 6ef794c8..febbdf0f 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -81,8 +81,6 @@ class _ToDoState extends State { isShowAppBar: widget.isShowAppBar, isShowDecPage: true, description: TranslationBase.of(context).infoTodo, - isShowBottomNavBar: false, - body: SingleChildScrollView( child: Column( children: [ diff --git a/lib/pages/feedback/feedback_home_page.dart b/lib/pages/feedback/feedback_home_page.dart index f19eeedf..15f348f9 100644 --- a/lib/pages/feedback/feedback_home_page.dart +++ b/lib/pages/feedback/feedback_home_page.dart @@ -42,7 +42,6 @@ class _FeedbackHomePageState extends State isShowAppBar: true, isBottomBar: false, isShowDecPage: false, - isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).feedbackTitle, body: Scaffold( extendBodyBehindAppBar: true, diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index b639af78..b64d2330 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -50,7 +50,6 @@ class _HomePageState extends State { builder: (_, model, wi) => AppScaffold( isShowDecPage: false, isHelp: true, - isShowBottomNavBar: false, body: Container( width: double.infinity, child: SingleChildScrollView( diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 21863766..b8607a89 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -32,7 +32,6 @@ import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:firebase_analytics/observer.dart'; import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:flutter/cupertino.dart'; @@ -50,11 +49,8 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; class LandingPage extends StatefulWidget { static LandingPage shared; - int currentTab = 0; _LandingPageState state; - - LandingPage({currentTabLocal}) { - currentTab = currentTabLocal ?? 0; + LandingPage() { LandingPage.shared = this; } @@ -73,6 +69,7 @@ class LandingPage extends StatefulWidget { class _LandingPageState extends State with WidgetsBindingObserver { var authProvider = new AuthProvider(); + int currentTab = 0; PageController pageController; ProjectViewModel projectViewModel; ToDoCountProviderModel model; @@ -105,7 +102,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { changeCurrentTab(int tab) { setState(() { - if (widget.currentTab > 0 && tab == 2) + if (currentTab > 0 && tab == 2) pageController.jumpToPage(0); else if (tab != 0) { if (tab == 4 && model.count == 0) { @@ -119,7 +116,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { pageController.jumpToPage(tab); } - widget.currentTab = tab; + currentTab = tab; }); } @@ -178,8 +175,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { AppGlobal.context = context; _requestIOSPermissions(); - pageController = - PageController(keepPage: true, initialPage: widget.currentTab); + pageController = PageController(keepPage: true); _firebaseMessaging.setAutoInitEnabled(true); locationUtils = @@ -488,84 +484,94 @@ class _LandingPageState extends State with WidgetsBindingObserver { projectViewModel = Provider.of(context); model = Provider.of(context); - return AppScaffold( - isShowAppBar: true, - showHomeAppBarIcon: false, - appBarTitle: getText(widget.currentTab).toUpperCase(), - leading: Builder( - builder: (BuildContext context) { - return new Stack( - children: [ - widget.currentTab == 0 - ? IconButton( - icon: Icon(Icons.menu), - color: Theme.of(context).textTheme.headline1.color, - onPressed: () => Scaffold.of(context).openDrawer(), - ) - : IconButton( - icon: Icon(Icons.arrow_back), - color: Theme.of(context).textTheme.headline1.color, - onPressed: () { - setState(() { - widget.currentTab = 0; - }); - - pageController.jumpToPage(0); - }, - ), - notificationCount != '' - ? new Positioned( - right: projectViewModel.isArabic ? 35 : 0, - top: 5, - child: new Container( - padding: EdgeInsets.all(4), - decoration: new BoxDecoration( - color: Colors.red, - borderRadius: BorderRadius.circular(20), - ), - constraints: BoxConstraints( - minWidth: 20, - minHeight: 20, - ), - child: new Text( - notificationCount, - style: new TextStyle( - color: Colors.white, - fontSize: projectViewModel.isArabic ? 8 : 9, + return Scaffold( + appBar: AppBar( + elevation: 0, + textTheme: TextTheme( + headline6: TextStyle( + color: Theme.of(context).textTheme.headline1.color, + fontWeight: FontWeight.bold), + ), + title: Text( + getText(currentTab).toUpperCase(), + style: TextStyle( + fontWeight: FontWeight.bold, + color: Theme.of(context).textTheme.headline1.color, + fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'), + // bold: true, + // color: Colors.white, + ), + leading: Builder( + builder: (BuildContext context) { + return new Stack( + children: [ + currentTab == 0 + ? IconButton( + icon: Icon(Icons.menu), + color: Theme.of(context).textTheme.headline1.color, + onPressed: () => Scaffold.of(context).openDrawer(), + ) + : IconButton( + icon: Icon(Icons.arrow_back), + color: Theme.of(context).textTheme.headline1.color, + onPressed: () { + setState(() { + currentTab = 0; + }); + + pageController.jumpToPage(0); + }, + ), + notificationCount != '' + ? new Positioned( + right: projectViewModel.isArabic ? 35 : 0, + top: 5, + child: new Container( + padding: EdgeInsets.all(4), + decoration: new BoxDecoration( + color: Colors.red, + borderRadius: BorderRadius.circular(20), + ), + constraints: BoxConstraints( + minWidth: 20, + minHeight: 20, + ), + child: new Text( + notificationCount, + style: new TextStyle( + color: Colors.white, + fontSize: projectViewModel.isArabic ? 8 : 9, + ), + textAlign: TextAlign.center, ), - textAlign: TextAlign.center, ), - ), - ) - : SizedBox() - ], - ); - }, + ) + : SizedBox() + ], + ); + }, + ), + actions: [ + IconButton( + //iconSize: 70, + icon: Icon( + projectViewModel.isLogin ? Icons.settings : Icons.login, + color: Theme.of(context).textTheme.headline1.color, + ), + onPressed: () { + if (projectViewModel.isLogin) + Navigator.of(context).pushNamed( + SETTINGS, + ); + else + login(); + }, //do something, + ) + ], + centerTitle: true, ), - isShowDrawer: true, - appBarIcons: [ - IconButton( - //iconSize: 70, - icon: Icon( - projectViewModel.isLogin ? Icons.settings : Icons.login, - color: Theme.of(context).textTheme.headline1.color, - ), - onPressed: () { - if (projectViewModel.isLogin) - Navigator.of(context).pushNamed( - SETTINGS, - ); - else - login(); - }, //do something, - ) - ], - // drawer: SafeArea(child: AppDrawer()), - // extendBody: true, - isShowDecPage: false, - changeTab: changeCurrentTab, - isFromLandingPage: true, - currentTab: widget.currentTab, + drawer: SafeArea(child: AppDrawer()), + extendBody: true, body: PageView( physics: NeverScrollableScrollPhysics(), controller: pageController, @@ -581,9 +587,13 @@ class _LandingPageState extends State with WidgetsBindingObserver { ToDo(isShowAppBar: false), ], // Please do not remove the BookingOptions from this array ), + bottomNavigationBar: BottomNavBar( + changeIndex: changeCurrentTab, + index: currentTab, + ), floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, floatingActionButton: - (projectViewModel.havePrivilege(34) && widget.currentTab == 0) + (projectViewModel.havePrivilege(34) && currentTab == 0) ? FloatingButton( elevation: true, onTap: () { diff --git a/lib/pages/landing/landing_page_pharmcy.dart b/lib/pages/landing/landing_page_pharmcy.dart index e087a87e..04c9bb54 100644 --- a/lib/pages/landing/landing_page_pharmcy.dart +++ b/lib/pages/landing/landing_page_pharmcy.dart @@ -110,6 +110,35 @@ class _LandingPagePharmacyState extends State { centerTitle: true, ) : null, + // : AppBar( + // backgroundColor: Color(0xff5AB145), + // elevation: 0, + // textTheme: TextTheme( + // headline6: TextStyle( + // color: Colors.white, fontWeight: FontWeight.bold), + // ), + // title: Text(getText(currentTab).toUpperCase()), + // leading: Builder( + // builder: (BuildContext context) { + // return IconButton( + // icon: Icon(Icons.arrow_back), + // color: Colors.white, + // onPressed: () => Scaffold.of(context).openDrawer(), + // ); + // }, + // ), + // actions: [ + // // IconButton( + // // iconSize: 70, + // // icon: SvgPicture.asset('assets/images/svg/robort_svg.svg', + // // height: 100, width: 100, fit: BoxFit.cover), + // // onPressed: () { + // // triggerRobot(); + // // } //do something, + // // ) + // ], + // centerTitle: true, + // ), extendBody: false, body: PageView( physics: NeverScrollableScrollPhysics(), diff --git a/lib/pages/livecare/livecare_home.dart b/lib/pages/livecare/livecare_home.dart index 403acf0c..d74dd6c8 100644 --- a/lib/pages/livecare/livecare_home.dart +++ b/lib/pages/livecare/livecare_home.dart @@ -51,7 +51,6 @@ class _LiveCareHomeState extends State return AppScaffold( appBarTitle: "LiveCare", isShowAppBar: true, - isShowBottomNavBar: false, imagesInfo: imagesInfo, description: TranslationBase.of(context).erConsultation, body: Container( diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index d8639a6a..bcbcf6cb 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -101,7 +101,6 @@ class _ConfirmLogin extends State { appBarTitle: TranslationBase.of(context).confirm, isShowAppBar: true, isShowDecPage: false, - isShowBottomNavBar: false, body: SingleChildScrollView( child: Container( padding: EdgeInsets.all(20), diff --git a/lib/pages/login/forgot-password.dart b/lib/pages/login/forgot-password.dart index fc21b0e1..d6478c92 100644 --- a/lib/pages/login/forgot-password.dart +++ b/lib/pages/login/forgot-password.dart @@ -31,7 +31,6 @@ class _ForgotPassword extends State { appBarTitle: TranslationBase.of(context).forgotFileNoTitle, isShowAppBar: true, isShowDecPage: false, - isShowBottomNavBar: false, body: SingleChildScrollView( child: Container( padding: EdgeInsets.only(top: 10, left: 20, right: 20), diff --git a/lib/pages/login/login-type.dart b/lib/pages/login/login-type.dart index 18a3da8b..f8af8eac 100644 --- a/lib/pages/login/login-type.dart +++ b/lib/pages/login/login-type.dart @@ -21,7 +21,6 @@ class LoginType extends StatelessWidget { appBarTitle: TranslationBase.of(context).login, isShowAppBar: true, isShowDecPage: false, - isShowBottomNavBar: false, body: SingleChildScrollView( child: Container( padding: diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 245167e6..448238fd 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -66,8 +66,8 @@ class _Login extends State { super.initState(); if(BASE_URL.contains("uat.")){ - nationalIDorFile.text = "1231755"; - mobileNumberController.text = mobileNo = "537503378"; + nationalIDorFile.text = "2001273"; + mobileNumberController.text = mobileNo = "0555416043"; } } @@ -85,7 +85,6 @@ class _Login extends State { appBarTitle: TranslationBase.of(context).login, isShowAppBar: true, isShowDecPage: false, - isShowBottomNavBar: false, body: SingleChildScrollView( child: Container( padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), diff --git a/lib/pages/login/register-info.dart b/lib/pages/login/register-info.dart index c7fc1c69..e1152032 100644 --- a/lib/pages/login/register-info.dart +++ b/lib/pages/login/register-info.dart @@ -74,7 +74,6 @@ class _RegisterInfo extends State { appBarTitle: TranslationBase.of(context).register, isShowAppBar: true, isShowDecPage: false, - isShowBottomNavBar: false, body: SingleChildScrollView( padding: EdgeInsets.all(20), child: Column(children: [ diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart index 6fc31d4a..1591d1d5 100644 --- a/lib/pages/login/register.dart +++ b/lib/pages/login/register.dart @@ -49,7 +49,6 @@ class _Register extends State { appBarTitle: TranslationBase.of(context).register, isShowAppBar: true, isShowDecPage: false, - isShowBottomNavBar: false, body: SingleChildScrollView( child: Container( padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), diff --git a/lib/pages/login/welcome.dart b/lib/pages/login/welcome.dart index 761d4df3..6a007e0a 100644 --- a/lib/pages/login/welcome.dart +++ b/lib/pages/login/welcome.dart @@ -30,7 +30,6 @@ class _WelcomeLogin extends State { appBarTitle: TranslationBase.of(context).welcome, isShowDecPage: false, isShowAppBar: true, - isShowBottomNavBar: false, body: Padding( padding: EdgeInsets.all(20), child: Column( diff --git a/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart b/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart index 770e5ca1..902225b1 100644 --- a/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart +++ b/lib/pages/medical/ask_doctor/ask_doctor_home_page.dart @@ -39,7 +39,6 @@ class _AskDoctorHomPageState extends State Widget build(BuildContext context) { return AppScaffold( isShowAppBar: true, - isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).askDoctor, body: Scaffold( extendBodyBehindAppBar: true, diff --git a/lib/pages/medical/eye/EyeHomePage.dart b/lib/pages/medical/eye/EyeHomePage.dart index 3af45f25..3af2279e 100644 --- a/lib/pages/medical/eye/EyeHomePage.dart +++ b/lib/pages/medical/eye/EyeHomePage.dart @@ -44,7 +44,6 @@ class _EyeHomePageState extends State return AppScaffold( isShowAppBar: true, isShowDecPage: false, - isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).measurements, body: Scaffold( extendBodyBehindAppBar: true, diff --git a/lib/pages/medical/medical_profile_page.dart b/lib/pages/medical/medical_profile_page.dart index 87a06d84..6f46388b 100644 --- a/lib/pages/medical/medical_profile_page.dart +++ b/lib/pages/medical/medical_profile_page.dart @@ -13,10 +13,6 @@ import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; class MedicalProfilePage extends StatefulWidget { - - final bool isFromAllServicePage; - - const MedicalProfilePage({ this.isFromAllServicePage = false}) ; @override _MedicalProfilePageState createState() => _MedicalProfilePageState(); } @@ -29,7 +25,6 @@ class _MedicalProfilePageState extends State { @override Widget build(BuildContext context) { projectViewModel = Provider.of(context); - var appoCountProvider = Provider.of(context); List myMedicalList = Utils.myMedicalList( projectViewModel: projectViewModel, @@ -38,12 +33,10 @@ class _MedicalProfilePageState extends State { isLogin: projectViewModel.isLogin); return BaseView( onModelReady: (model) => model.getAppointmentHistory(), - builder: (_, model, x) => AppScaffold( + builder: (_, model, widget) => AppScaffold( isShowDecPage: false, baseViewModel: model, isHelp: true, - isShowBottomNavBar: widget.isFromAllServicePage, - body: Container( child: SingleChildScrollView( child: Column( diff --git a/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart b/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart index 5a15908b..41592110 100644 --- a/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart +++ b/lib/pages/medical/my_trackers/Weight/WeightHomePage.dart @@ -42,7 +42,6 @@ class _WeightHomePageState extends State with SingleTickerProvid builder: (_, model, w) => AppScaffold( isShowAppBar: true, isShowDecPage: false, - isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).weight, appBarIcons: [ IconButton( @@ -101,29 +100,26 @@ class _WeightHomePageState extends State with SingleTickerProvid ) ], ), - floatingActionButton: Container( - margin: EdgeInsets.only(bottom: 70), - child: InkWell( - onTap: () { - Navigator.push( - context, - FadePage( - page: AddWeightPage( - model: model, - ))); - }, - child: Container( - width: 55, - height: 55, - decoration: BoxDecoration( - shape: BoxShape.circle, - color: Theme.of(context).primaryColor, - ), - child: Center( - child: Icon( - Icons.add, - color: Colors.white, - ), + floatingActionButton: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: AddWeightPage( + model: model, + ))); + }, + child: Container( + width: 55, + height: 55, + decoration: BoxDecoration( + shape: BoxShape.circle, + color: Theme.of(context).primaryColor, + ), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, ), ), ), diff --git a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart index 30414245..723871cb 100644 --- a/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart +++ b/lib/pages/medical/my_trackers/blood_pressure/BloodPressureHomePage.dart @@ -42,7 +42,6 @@ class _BloodPressureHomePageState extends State onModelReady: (model) => model.getBloodPressure(), builder: (_, model, w) => AppScaffold( isShowAppBar: true, - isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).bloodPressure, baseViewModel: model, appBarIcons: [IconButton( @@ -95,22 +94,19 @@ class _BloodPressureHomePageState extends State ) ], ), - floatingActionButton: Container( - margin: EdgeInsets.only(bottom: 70), - child: InkWell( - onTap: () { - Navigator.push(context, FadePage(page: AddBloodPressurePage(model: model,))); - }, - child: Container( - width: 55, - height: 55, - decoration: BoxDecoration( - shape: BoxShape.circle, color: Theme.of(context).primaryColor), - child: Center( - child: Icon( - Icons.add, - color: Colors.white, - ), + floatingActionButton: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: AddBloodPressurePage(model: model,))); + }, + child: Container( + width: 55, + height: 55, + decoration: BoxDecoration( + shape: BoxShape.circle, color: Theme.of(context).primaryColor), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, ), ), ), diff --git a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart index 48f6b9d2..29989e53 100644 --- a/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart +++ b/lib/pages/medical/my_trackers/blood_suger/blood_sugar_home_page.dart @@ -47,7 +47,6 @@ class _BloodSugarHomePageState extends State return BaseView( onModelReady: (model) => model.getBloodSugar(), builder: (_, model, w) => AppScaffold( - isShowBottomNavBar: false, appBarIcons: [IconButton( icon: Icon(Icons.email), color: Colors.white, @@ -106,22 +105,19 @@ class _BloodSugarHomePageState extends State ) ], ), - floatingActionButton: Container( - margin: EdgeInsets.only(bottom: 70), - child: InkWell( - onTap: () { - Navigator.push(context, FadePage(page: AddBloodSugarPage(bloodSugarViewMode: model,))); - }, - child: Container( - width: 55, - height: 55, - decoration: BoxDecoration( - shape: BoxShape.circle, color:Theme.of(context).primaryColor), - child: Center( - child: Icon( - Icons.add, - color: Colors.white, - ), + floatingActionButton: InkWell( + onTap: () { + Navigator.push(context, FadePage(page: AddBloodSugarPage(bloodSugarViewMode: model,))); + }, + child: Container( + width: 55, + height: 55, + decoration: BoxDecoration( + shape: BoxShape.circle, color:Theme.of(context).primaryColor), + child: Center( + child: Icon( + Icons.add, + color: Colors.white, ), ), ), diff --git a/lib/pages/medical/prescriptions/prescriptions_home_page.dart b/lib/pages/medical/prescriptions/prescriptions_home_page.dart index 29a6e0cb..380d6284 100644 --- a/lib/pages/medical/prescriptions/prescriptions_home_page.dart +++ b/lib/pages/medical/prescriptions/prescriptions_home_page.dart @@ -47,7 +47,6 @@ class _HomePrescriptionsPageState extends State description: TranslationBase.of(context).infoPrescriptions, infoList: TranslationBase.of(context).infoPrescriptionsPoints, imagesInfo: imagesInfo, - isShowBottomNavBar: false, body: Scaffold( extendBodyBehindAppBar: true, appBar: PreferredSize( diff --git a/lib/pages/medical/reports/report_home_page.dart b/lib/pages/medical/reports/report_home_page.dart index fb6a729c..f9efb1a1 100644 --- a/lib/pages/medical/reports/report_home_page.dart +++ b/lib/pages/medical/reports/report_home_page.dart @@ -59,7 +59,6 @@ class _HomeReportPageState extends State onModelReady: (model) => model.getReports(), //model.getPrescriptions(), builder: (_, model, widget) => AppScaffold( isShowAppBar: true, - isShowBottomNavBar: false, appBarTitle: TranslationBase.of(context).newMedReport, title: TranslationBase.of(context).medReport, description: TranslationBase.of(context).infoMonthReport, diff --git a/lib/pages/medical/smart_watch_health_data/stepsTracker.dart b/lib/pages/medical/smart_watch_health_data/stepsTracker.dart index d1b6607c..3fe1a4ba 100644 --- a/lib/pages/medical/smart_watch_health_data/stepsTracker.dart +++ b/lib/pages/medical/smart_watch_health_data/stepsTracker.dart @@ -44,7 +44,6 @@ class _StepsTrackerState extends State isShowAppBar: true, appBarTitle: "Steps", isShowDecPage: false, - isShowBottomNavBar: false, body: Container( child: Column( mainAxisSize: MainAxisSize.min, diff --git a/lib/pages/pharmacies/screens/pharmacy_module_page.dart b/lib/pages/pharmacies/screens/pharmacy_module_page.dart index bdb508bc..e4830583 100644 --- a/lib/pages/pharmacies/screens/pharmacy_module_page.dart +++ b/lib/pages/pharmacies/screens/pharmacy_module_page.dart @@ -80,7 +80,6 @@ class _PharmacyPageState extends State { isShowAppBar: false, isShowDecPage: false, baseViewModel: model, - isPharmacy:true, backgroundColor: Colors.white, body: Container( width: double.infinity, diff --git a/lib/pages/pharmacy_categorise.dart b/lib/pages/pharmacy_categorise.dart index 64b6bf6a..ff1920dc 100644 --- a/lib/pages/pharmacy_categorise.dart +++ b/lib/pages/pharmacy_categorise.dart @@ -35,7 +35,6 @@ class _PharmacyCategorisePageState extends State { AppScaffold( isShowDecPage: false, baseViewModel: model, - isPharmacy:true, body: Column( children: [ Expanded( diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index c691123e..888efd30 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -30,7 +30,7 @@ class DoctorsListService extends BaseService { Future getDoctorsList( int clinicID, int projectID, bool isNearest, BuildContext context, - {doctorId, doctorName}) async { + {doctorId, doctorName, isContinueDentalPlan = false}) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { @@ -61,20 +61,18 @@ class DoctorsListService extends BaseService { "ClinicID": clinicID, "ProjectID": projectID, "DoctorName": doctorName, //!= null ? doctorId : 0, - "ContinueDentalPlan": false, - "IsSearchAppointmnetByClinicID": true, + "ContinueDentalPlan": isContinueDentalPlan, + "IsSearchAppointmnetByClinicID": isContinueDentalPlan ? false : true, "PatientID": authUser.patientID != null ? authUser.patientID : 0, "gender": authUser.gender != null ? authUser.gender : 0, "age": authUser.age != null ? authUser.age : 0, "IsGetNearAppointment": false, - // "Latitude": 0, - // "Longitude": 0, - // "License": true, "SearchForVoiceCommand": doctorId != null && doctorId.length > 0 ? true : false, "DoctorIDsList": doctorId, "Latitude": lat != null ? lat.toString() : 0, "Longitude": long != null ? long.toString() : 0, + "isDentalAllowedBackend": isContinueDentalPlan, "IsGetNearAppointment": isNearest, if (isNearest) "SelectedDate": DateUtil.convertDateToString(DateTime.now()), @@ -1483,7 +1481,6 @@ class DoctorsListService extends BaseService { int projectId, BuildContext context) async { Map request; - Request req = appGlobal.getPublicRequest(); request = { "AppointmentNo": appointmentNo, "NFC_Code": nfcCode, @@ -1498,4 +1495,21 @@ class DoctorsListService extends BaseService { }, body: request); return Future.value(localRes); } + + Future checkIfHasDentalPlan(int projectID, BuildContext context) async { + Map request; + + request = { + "ProjectID": projectID, + }; + dynamic localRes; + await baseAppClient.post(HAS_DENTAL_PLAN, + onSuccess: (response, statusCode) async { + localRes = response; + }, onFailure: (String error, int statusCode) { + throw error; + }, body: request); + return Future.value(localRes); + } + } diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index cd7a1c7d..7ead312a 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -1223,7 +1223,10 @@ class TranslationBase { String get passportNumber => localizedValues["passport-number"][locale.languageCode]; String get enterPassportNumber => localizedValues["enter-passport-number"][locale.languageCode]; String get validPassportNumber => localizedValues["valid-passport-number"][locale.languageCode]; - + String get continuePlan => localizedValues["continue-plan"][locale.languageCode]; + String get dentalProcedureList => localizedValues["dental-procedure-list"][locale.languageCode]; + String get timeNeeded => localizedValues["time-needed"][locale.languageCode]; + String get totalTimeNeeded => localizedValues["total-time-needed"][locale.languageCode]; } class TranslationBaseDelegate extends LocalizationsDelegate { diff --git a/lib/widgets/others/app_scaffold_widget.dart b/lib/widgets/others/app_scaffold_widget.dart index ffd23bfd..6a20ef3f 100644 --- a/lib/widgets/others/app_scaffold_widget.dart +++ b/lib/widgets/others/app_scaffold_widget.dart @@ -12,9 +12,7 @@ import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.da import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; @@ -46,7 +44,6 @@ class AppScaffold extends StatelessWidget { final BaseViewModel baseViewModel; final bool isBottomBar; final Widget floatingActionButton; - final FloatingActionButtonLocation floatingActionButtonLocation; final bool isPharmacy; final bool isOfferPackages; final bool showPharmacyCart; @@ -61,19 +58,10 @@ class AppScaffold extends StatelessWidget { final List appBarIcons; final List imagesInfo; final bool isHelp; - - final int currentTab; - final bool isShowBottomNavBar; - final bool isFromLandingPage; - final bool isShowDrawer; - final Function(int tab) changeTab; - final Widget leading; - AuthenticatedUserObject authenticatedUserObject = locator(); AppBarWidget appBar; - AppScaffold( {@required this.body, this.appBarTitle = '', @@ -97,14 +85,7 @@ class AppScaffold extends StatelessWidget { this.infoList, this.isHelp = false, this.showHomeAppBarIcon = true, - this.imagesInfo, - this.currentTab, - this.isShowBottomNavBar = true, - this.isFromLandingPage = false, - this.changeTab, - this.floatingActionButtonLocation, - this.leading, - this.isShowDrawer = false}); + this.imagesInfo}); AppScaffold setOnAppBarCartClick(VoidCallback onClick) { _onCartClick = onClick; @@ -117,7 +98,6 @@ class AppScaffold extends StatelessWidget { return Scaffold( backgroundColor: backgroundColor ?? Theme.of(context).scaffoldBackgroundColor, - drawer: isShowDrawer ? SafeArea(child: AppDrawer()) : null, appBar: isShowAppBar ? appBar = AppBarWidget( appBarTitle: appBarTitle, @@ -128,21 +108,15 @@ class AppScaffold extends StatelessWidget { isOfferPackages: isOfferPackages, showOfferPackagesCart: showOfferPackagesCart, isShowDecPage: isShowDecPage, - leading: leading, ) : null, bottomSheet: bottomSheet, - bottomNavigationBar: isShowBottomNavBar && !getIsShowDecPageValue(context) && !isPharmacy - ? BottomNavBar( - changeIndex: changeCurrentTab, - index: currentTab, - ) - : null, body: SafeArea( top: true, bottom: true, child: - getIsShowDecPageValue(context) + (!Provider.of(context, listen: false).isLogin && + isShowDecPage) ? NotAutPage( title: title ?? appBarTitle, description: description, @@ -157,15 +131,9 @@ class AppScaffold extends StatelessWidget { : buildBodyWidget(context), ), floatingActionButton: floatingActionButton, - floatingActionButtonLocation: floatingActionButtonLocation, ); } - - getIsShowDecPageValue(context){ - return (!Provider.of(context, listen: false).isLogin && - isShowDecPage); - } buildAppLoaderWidget(bool isLoading) { return isLoading ? AppLoaderWidget() : Container(); } @@ -174,18 +142,6 @@ class AppScaffold extends StatelessWidget { return Stack( children: [body, isHelp == true ? RobotIcon() : Container()]); } - - void changeCurrentTab(int value) { - if (isFromLandingPage) { - changeTab(value); - } else { - Navigator.pushAndRemoveUntil( - AppGlobal.context, - MaterialPageRoute( - builder: (context) => LandingPage(currentTabLocal: value)), - (Route r) => false); - } - } } class AppBarWidget extends StatefulWidget with PreferredSizeWidget { @@ -203,8 +159,6 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget { Function(String) badgeUpdater; - final Widget leading; - AppBarWidget( {this.appBarTitle, this.showHomeAppBarIcon, @@ -213,8 +167,7 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget { this.showPharmacyCart = true, this.isOfferPackages = false, this.showOfferPackagesCart = false, - this.isShowDecPage = true, - this.leading}); + this.isShowDecPage = true}); @override State createState() => AppBarWidgetState(); @@ -225,7 +178,6 @@ class AppBarWidget extends StatefulWidget with PreferredSizeWidget { class AppBarWidgetState extends State { String badgeText = "0"; - @override Widget build(BuildContext context) { widget.badgeUpdater = badgeUpdateBlock; @@ -258,12 +210,11 @@ class AppBarWidgetState extends State { fontWeight: FontWeight.bold, color: Theme.of(context).textTheme.headline1.color, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans')), - leading: widget.leading ?? - Builder( - builder: (BuildContext context) { - return ArrowBack(); - }, - ), + leading: Builder( + builder: (BuildContext context) { + return ArrowBack(); + }, + ), centerTitle: true, actions: [ (widget.isPharmacy && widget.showPharmacyCart) @@ -405,7 +356,6 @@ class _RobotIcon extends State { ))) : Container(), FloatingSearchButton() - ], ) ], @@ -414,10 +364,10 @@ class _RobotIcon extends State { bottom: -15); } -// setAnimation() async { -// /// await sharedPref.getBool(IS_ROBOT_VISIBLE) || -// // var animation = -// // IS_TEXT_COMPLETED == ? true : false; + // setAnimation() async { + // /// await sharedPref.getBool(IS_ROBOT_VISIBLE) || + // // var animation = + // // IS_TEXT_COMPLETED == ? true : false; -// } + // } }