From deb0b40cfe6df77d917f4af84f20ce25caf45ea4 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 1 Mar 2021 12:49:59 +0300 Subject: [PATCH 1/2] fixes --- .../components/DocAvailableAppointments.dart | 12 +++++------ .../MyAppointments/AppointmentDetails.dart | 1 + .../widgets/AppointmentActions.dart | 2 +- lib/pages/landing/home_page.dart | 21 ++++++++++++++----- 4 files changed, 24 insertions(+), 12 deletions(-) diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index 7caf1977..d18d4680 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -137,7 +137,7 @@ class _DocAvailableAppointmentsState extends State shape: RoundedRectangleBorder( borderRadius: BorderRadius.circular(5.0), side: BorderSide( - color: Colors.blue[400], //Color of the border + color: Color(0xff76cfb7), //Color of the border style: BorderStyle.solid, //Style of the border width: 1.5, //width of the border ), @@ -209,8 +209,8 @@ class _DocAvailableAppointmentsState extends State color: _calendarController.isSelected(date) ? Colors.green[400] : _calendarController.isToday(date) - ? Colors.brown[300] - : Colors.blue[400], + ? Colors.transparent + : Color(0xff76cfb7), ), width: 40.0, height: 40.0, @@ -321,7 +321,7 @@ class _DocAvailableAppointmentsState extends State Widget getSelectedButton(int index) { return RaisedButton( - color: Colors.blue[400], + color: Color(0xff76cfb7), //Color of the border textColor: Colors.white, onPressed: () { setState(() { @@ -399,10 +399,10 @@ class _DocAvailableAppointmentsState extends State decoration: BoxDecoration( shape: BoxShape.circle, color: _calendarController.isSelected(date) - ? Colors.green[400] + ? Color(0xffB8382C) : _calendarController.isToday(date) ? Colors.brown[300] - : Colors.blue[400], + : Color(0xff76cfb7), ), width: 40.0, height: 40.0, diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index 17b6d57b..b638b2ff 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -239,6 +239,7 @@ class _AppointmentDetailsState extends State MaterialPageRoute( builder: (context) => BookConfirm( doctor: getDoctorObject(), + isLiveCareAppointment: widget.appo.isLiveCareAppointment, selectedDate: DocAvailableAppointments.selectedDate, selectedTime: DocAvailableAppointments.selectedTime))); } diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 60035ee1..0df4a3a5 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -110,7 +110,7 @@ class _AppointmentActionsState extends State { child: Text(e.title, overflow: TextOverflow.clip, style: TextStyle( - color: new Color(0xFF40ACC9), + color: new Color(0xffB8382C), letterSpacing: 1.0, fontSize: 18.0)), ), diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index f5a00f04..511630c4 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -19,6 +19,7 @@ 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:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -245,11 +246,16 @@ class _HomePageState extends State { Radius.circular(0)), ), child: Center( - child: Texts( - TranslationBase.of(context).viewMore, - color: Colors.white, - fontWeight: FontWeight.w700, - fontSize: 12, + child: InkWell( + onTap: () { + openBrowser(); + }, + child: Texts( + TranslationBase.of(context).viewMore, + color: Colors.white, + fontWeight: FontWeight.w700, + fontSize: 12, + ), ), ), ), @@ -757,6 +763,11 @@ class _HomePageState extends State { ); } + openBrowser() { + InAppBrowser browser = new InAppBrowser(); + browser.openUrl(url: "https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=ca9dd276-0a20-4924-a768-fafa9a855ef1&&CustomerId=1367368"); + } + navigateToCovidDriveThru() { Navigator.push(context, MaterialPageRoute(builder: (context) => CovidDrivethruLocation())); From da3ad90dddba8fe7f872536994d53b1880237832 Mon Sep 17 00:00:00 2001 From: haroon amjad Date: Mon, 1 Mar 2021 17:38:46 +0300 Subject: [PATCH 2/2] added app-wide route transition animation --- lib/core/service/client/base_app_client.dart | 5 +- .../NewCMC/new_cmc_step_tow_page.dart | 5 +- .../new_Home_health_care_step_tow_page.dart | 5 +- .../bmi_calculator/bmi_calculator.dart | 5 +- .../bmi_calculator/result_page.dart | 5 +- .../bmr_calculator/bmr_calculator.dart | 5 +- .../health_calculator/body_fat/body_fat.dart | 5 +- .../calorie_calculator.dart | 5 +- .../health_calculator/carbs/carbs.dart | 11 +- .../delivery_due/delivery_due.dart | 5 +- .../ideal_body/ideal_body.dart | 5 +- .../ovulation_period/ovulation_period.dart | 5 +- lib/pages/Blood/blood_donation.dart | 25 +- lib/pages/BookAppointment/BookConfirm.dart | 5 +- lib/pages/BookAppointment/BookSuccess.dart | 13 +- lib/pages/BookAppointment/DoctorProfile.dart | 60 +- lib/pages/BookAppointment/Search.dart | 14 +- .../components/DocAvailableAppointments.dart | 14 +- .../components/SearchByClinic.dart | 9 +- .../components/SearchByDoctor.dart | 5 +- .../BookAppointment/widgets/CardCommon.dart | 10 +- .../widgets/DentalComplaintCard.dart | 5 +- .../BookAppointment/widgets/DoctorView.dart | 82 +- lib/pages/ChildVaccines/child_page.dart | 72 +- .../covid-drivethru-location.dart | 5 +- .../Covid-DriveThru/covid-payment-alert.dart | 2 +- .../covid-payment-details.dart | 17 +- .../covid-payment-summary.dart | 14 +- .../notifications/notifications_page.dart | 22 +- .../PickupLocation.dart | 48 +- .../MyAppointments/AppointmentDetails.dart | 5 +- lib/pages/MyAppointments/MyAppointments.dart | 18 +- .../widgets/AppointmentActions.dart | 12 +- .../widgets/AppointmentCardView.dart | 47 +- lib/pages/ToDoList/ToDo.dart | 11 +- lib/pages/ToDoList/widgets/upcomingCard.dart | 3 +- lib/pages/landing/home_page.dart | 613 +++--- lib/pages/landing/landing_page_pharmcy.dart | 17 +- lib/pages/livecare/widgets/clinic_list.dart | 9 +- lib/pages/login/login-type.dart | 21 +- lib/pages/login/login.dart | 38 +- lib/pages/login/register.dart | 84 +- lib/pages/login/welcome.dart | 14 +- .../medical/balance/advance_payment_page.dart | 26 +- .../PrescriptionIDeliveryAddressPage.dart | 111 +- lib/pages/parent_categorise_page.dart | 52 +- .../pharmacies/medicine_search_screen.dart | 5 +- lib/pages/pharmacies/product-brands.dart | 81 +- lib/pages/pharmacies/product_detail.dart | 5 +- .../screens/pharmacy_module_page.dart | 20 +- .../pharmacies/widgets/manufacturerItem.dart | 8 +- lib/pages/pharmacy/order/Order.dart | 1783 +++++++++-------- lib/pages/pharmacy/order/OrderDetails.dart | 13 +- lib/pages/pharmacy/profile/profile.dart | 99 +- lib/pages/pharmacy_categorise.dart | 53 +- lib/pages/sub_categorise_page.dart | 15 +- .../bottom_navigation/bottom_nav_bar.dart | 75 +- lib/widgets/drawer/app_drawer_widget.dart | 73 +- .../others/app_scafold_detail_page.dart | 2 +- lib/widgets/others/bottom_bar.dart | 30 +- .../others/floating_button_search.dart | 28 +- .../bottom_nav_pharmacy_home_item.dart | 5 +- lib/widgets/pharmacy/product_tile.dart | 60 +- lib/widgets/robo-search/search.dart | 30 +- 64 files changed, 2122 insertions(+), 1832 deletions(-) diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index db30fd8b..07da24a4 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel. import 'package:diplomaticquarterapp/pages/appUpdatePage/app_update_page.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:http/http.dart' as http; @@ -213,8 +214,8 @@ class BaseAppClient { Future navigateToAppUpdate(context, String text) async { Navigator.pushReplacement( context, - MaterialPageRoute( - builder: (context) => AppUpdatePage(appUpdateText: text))); + FadePage( + page: AppUpdatePage(appUpdateText: text))); } get(String endPoint, 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 cc8ea8dd..d9d4c56a 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 @@ -9,6 +9,7 @@ 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:google_maps_flutter/google_maps_flutter.dart'; @@ -111,8 +112,8 @@ class _NewCMCStepTowPageState onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (BuildContext context) => + FadePage( + page: CMCLocationPage( latitude: latitude, longitude: longitude, 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 9f301328..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 @@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.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:google_maps_flutter/google_maps_flutter.dart'; @@ -112,8 +113,8 @@ class _NewHomeHealthCareStepTowPageState onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (BuildContext context) => + FadePage( + page: LocationPage( latitude: latitude, longitude: longitude, diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart index 2dbf2035..8b9a5409 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/bmi_calculator.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/button.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/material.dart'; import 'package:flutter/services.dart'; import 'dart:math'; @@ -508,8 +509,8 @@ class _BMICalculatorState extends State { { Navigator.push( context, - MaterialPageRoute( - builder: (context) => ResultPage( + FadePage( + page: ResultPage( finalResult: bmiResult, textResult: textResult, msg: msg, diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart index 8ac6b06c..a541b3ce 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart @@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/borderedButton.dart'; import 'package:diplomaticquarterapp/widgets/buttons/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/material.dart'; import 'package:percent_indicator/percent_indicator.dart'; @@ -114,8 +115,8 @@ class ResultPage extends StatelessWidget { handler: (){ Navigator.push( context, - MaterialPageRoute( - builder: (context) => BariatricsPage(1, 1, finalResult)), + FadePage( + page: BariatricsPage(1, 1, finalResult)), ); }, ), diff --git a/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart index b393600f..9e3d049f 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmr_calculator/bmr_calculator.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/button.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/material.dart'; import 'dart:math'; @@ -701,8 +702,8 @@ class _BmrCalculatorState extends State { { Navigator.push( context, - MaterialPageRoute( - builder: (context) => BmrResultPage( + FadePage( + page: BmrResultPage( bmrResult: bmrResult, calories: calories, )), diff --git a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart index 51b4cad6..3bda439f 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/body_fat/body_fat.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/button.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/material.dart'; import 'dart:math'; @@ -1001,8 +1002,8 @@ class _BodyFatState extends State { { Navigator.push( context, - MaterialPageRoute( - builder: (context) => FatResult( + FadePage( + page: FatResult( bodyFat: bodyFat, fat: fat, textResult: textResult, diff --git a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart index d4e9c427..a7f60f68 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/button.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/material.dart'; import 'calorie_result_page.dart'; @@ -678,8 +679,8 @@ class _CalorieCalculatorState extends State { { Navigator.push( context, - MaterialPageRoute( - builder: (context) => CalorieResultPage( + FadePage( + page: CalorieResultPage( calorie: calories, )), ); diff --git a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart index 50152328..78a737bb 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/carbs/carbs.dart @@ -1,10 +1,10 @@ +import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.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/material.dart'; -import 'dart:math'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_calculator/calorie_calculator/calorie_calculator.dart'; import 'package:flutter/services.dart'; import 'carbs_result_page.dart'; @@ -207,8 +207,7 @@ class _CarbsState extends State { { Navigator.push( context, - MaterialPageRoute( - builder: (context) => CalorieCalculator()), + FadePage(page: CalorieCalculator()), ); } }); @@ -340,8 +339,8 @@ class _CarbsState extends State { calculate(); Navigator.push( context, - MaterialPageRoute( - builder: (context) => CarbsResult( + FadePage( + page: CarbsResult( cCal: cCal, pCal: pCal, fCal: fCal, diff --git a/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart index c69f0564..d19c6017 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/delivery_due/delivery_due.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/button.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/material.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:intl/intl.dart'; @@ -121,8 +122,8 @@ class _DeliveryDueState extends State { { Navigator.push( context, - MaterialPageRoute( - builder: (context) => DeliveryDueResult( + FadePage( + page: DeliveryDueResult( conceivedDate: conceivedDate, dateFrom: dateFrom, dateTo: dateTo, diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart index 2aff7836..4e0b1391 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/ideal_body/ideal_body.dart @@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/button.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/material.dart'; import 'dart:math'; @@ -532,8 +533,8 @@ class _IdealBodyState extends State { { Navigator.push( context, - MaterialPageRoute( - builder: (context) => IdealBodyResult( + FadePage( + page: IdealBodyResult( idealBodyWeight: idealWeight, minRange: minRange, mixRange: maxRange, diff --git a/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart index 9c5dc0d3..508e8590 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/ovulation_period/ovulation_period.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/button.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/material.dart'; import 'package:flutter_datetime_picker/flutter_datetime_picker.dart'; import 'package:intl/intl.dart'; @@ -329,8 +330,8 @@ class _OvulationPeriodState extends State { { Navigator.push( context, - MaterialPageRoute( - builder: (context) => OvulationResult( + FadePage( + page: OvulationResult( conceivedDate: conceivedDate, dateFrom: dateFrom, dateTo: dateTo, diff --git a/lib/pages/Blood/blood_donation.dart b/lib/pages/Blood/blood_donation.dart index 6d1e98ea..76ad2e1d 100644 --- a/lib/pages/Blood/blood_donation.dart +++ b/lib/pages/Blood/blood_donation.dart @@ -6,21 +6,16 @@ import 'package:diplomaticquarterapp/core/model/blooddonation/get_all_cities.dar //import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; -import 'package:diplomaticquarterapp/core/service/blood/blood_details_servies.dart'; -import 'package:diplomaticquarterapp/core/viewModels/blooddonation/blood_details_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/pages/Blood/user_agreement_page.dart'; -import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectCiteisDialog.dart'; -import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectHospitalDialog.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/uitl/utils.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'; @@ -30,14 +25,11 @@ import 'package:flutter/material.dart'; import 'package:giffy_dialog/giffy_dialog.dart'; import 'package:provider/provider.dart'; -//import '../../../core/model/my_balance/AdvanceModel.dart'; -import 'confirm_payment_page.dart'; import 'dialogs/SelectBeneficiaryDialog.dart'; import 'dialogs/SelectBloodDialog.dart'; import 'dialogs/SelectGenderDialog.dart'; import 'dialogs/SelectPatientFamilyDialog.dart'; import 'dialogs/SelectPatientInfoDialog.dart'; -import 'new_text_Field.dart'; enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON } enum Gender { Male, Female, NON } @@ -63,7 +55,8 @@ class _BloodDonationPageState extends State { AuthenticatedUser authenticatedUser; GetAllSharedRecordsByStatusList selectedPatientFamily; AdvanceModel advanceModel = AdvanceModel(); - List_BloodGroupDetailsModel bloodDetails = List_BloodGroupDetailsModel(bloodGroup: "A-"); + List_BloodGroupDetailsModel bloodDetails = + List_BloodGroupDetailsModel(bloodGroup: "A-"); AppSharedPreferences sharedPref = AppSharedPreferences(); AuthenticatedUser authUser; var checkedValue = false; @@ -180,9 +173,8 @@ class _BloodDonationPageState extends State { ), InkWell( onTap: () { - Navigator.of(context).push(MaterialPageRoute( - builder: (BuildContext context) => - UserAgreementPage())); + Navigator.of(context) + .push(FadePage(page: UserAgreementPage())); }, child: Container( child: Texts( @@ -267,7 +259,6 @@ class _BloodDonationPageState extends State { ), ], ), - SizedBox( height: MediaQuery.of(context).size.height * 0.15, ) @@ -291,8 +282,9 @@ class _BloodDonationPageState extends State { ), label: TranslationBase.of(context).save, onTap: () async { - if(_selectedHospital == null){ - AppToast.showErrorToast(message: TranslationBase.of(context).selectCity); + if (_selectedHospital == null) { + AppToast.showErrorToast( + message: TranslationBase.of(context).selectCity); return; } bloodDetails.city = projectProvider.isArabic @@ -536,7 +528,8 @@ class _BloodDonationPageState extends State { return "Select Blood Type"; //TranslationBase.of(context).selectBeneficiary; } - String getHospitalName(ProjectViewModel projectProvider, BuildContext context) { + String getHospitalName( + ProjectViewModel projectProvider, BuildContext context) { if (_selectedHospital != null) return projectProvider.isArabic ? _selectedHospital.descriptionN diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index ae968764..966dc4d4 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -14,6 +14,7 @@ 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_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:intl/intl.dart'; import 'package:provider/provider.dart'; @@ -628,8 +629,8 @@ class _BookConfirmState extends State { GifLoaderDialogUtils.hideDialog(context); Navigator.push( context, - MaterialPageRoute( - builder: (context) => BookSuccess( + FadePage( + page: BookSuccess( docObject: docObject, patientShareResponse: patientShareResponse, appoDateFormatted: widget.appoDateFormatted, diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index bd6c242c..26a5b0fe 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -12,6 +12,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart'; @@ -592,7 +593,7 @@ class _BookSuccessState extends State { appo.appointmentNo = widget.patientShareResponse.appointmentNo; Navigator.push( - context, MaterialPageRoute(builder: (context) => PaymentMethod())) + context, FadePage(page: PaymentMethod())) .then((value) { print(value); if (value != null) { @@ -920,11 +921,11 @@ class _BookSuccessState extends State { Future navigateToQR(context, String appoQR) async { Navigator.push( context, - MaterialPageRoute( - builder: (context) => QRCode( - patientShareResponse: widget.patientShareResponse, - appoQR: appoQR, - ))); + FadePage( + page: QRCode( + patientShareResponse: widget.patientShareResponse, + appoQR: appoQR, + ))); } _getNormalText(text) { diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index 392eb24c..2a349cf2 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -12,6 +12,7 @@ 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_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:rating_bar/rating_bar.dart'; @@ -153,7 +154,8 @@ class _DoctorProfileState extends State alignment: Alignment.center, child: Text( "(" + - widget.docProfileList.noOfPatientsRate.toString() + + widget.docProfileList.noOfPatientsRate + .toString() + " " + TranslationBase.of(context).reviews + ")", @@ -279,7 +281,8 @@ class _DoctorProfileState extends State color: Theme.of(context).primaryColor, margin: EdgeInsets.only(bottom: 5.0), padding: EdgeInsets.all(10.0), - child: Text(TranslationBase.of(context).doctorRating, + child: Text( + TranslationBase.of(context).doctorRating, style: TextStyle( fontSize: 22.0, color: Colors.white))), Container( @@ -297,8 +300,11 @@ class _DoctorProfileState extends State margin: EdgeInsets.only(top: 5.0), alignment: Alignment.center, child: RatingBar.readOnly( - initialRating: - this.widget.doctor.actualDoctorRate.toDouble(), + initialRating: this + .widget + .doctor + .actualDoctorRate + .toDouble(), size: 35.0, filledColor: Colors.yellow[700], emptyColor: Colors.grey[500], @@ -311,7 +317,11 @@ class _DoctorProfileState extends State Container( margin: EdgeInsets.only(top: 10.0), child: Text( - this.widget.doctor.noOfPatientsRate.toString() + + this + .widget + .doctor + .noOfPatientsRate + .toString() + " " + TranslationBase.of(context).reviews, style: TextStyle( @@ -327,7 +337,8 @@ class _DoctorProfileState extends State child: Text( TranslationBase.of(context).excellent, style: TextStyle( - fontSize: 13.0, color: Colors.black))), + fontSize: 13.0, + color: Colors.black))), Container( margin: EdgeInsets.only(top: 10.0), child: SizedBox( @@ -349,9 +360,11 @@ class _DoctorProfileState extends State width: 100.0, margin: EdgeInsets.only( top: 10.0, left: 15.0, right: 15.0), - child: Text(TranslationBase.of(context).v_good, + child: Text( + TranslationBase.of(context).v_good, style: TextStyle( - fontSize: 13.0, color: Colors.black))), + fontSize: 13.0, + color: Colors.black))), Container( margin: EdgeInsets.only(top: 10.0), child: SizedBox( @@ -373,9 +386,11 @@ class _DoctorProfileState extends State width: 100.0, margin: EdgeInsets.only( top: 10.0, left: 15.0, right: 15.0), - child: Text(TranslationBase.of(context).good, + child: Text( + TranslationBase.of(context).good, style: TextStyle( - fontSize: 13.0, color: Colors.black))), + fontSize: 13.0, + color: Colors.black))), Container( margin: EdgeInsets.only(top: 10.0), child: SizedBox( @@ -397,9 +412,11 @@ class _DoctorProfileState extends State width: 100.0, margin: EdgeInsets.only( top: 10.0, left: 15.0, right: 15.0), - child: Text(TranslationBase.of(context).average, + child: Text( + TranslationBase.of(context).average, style: TextStyle( - fontSize: 13.0, color: Colors.black))), + fontSize: 13.0, + color: Colors.black))), Container( margin: EdgeInsets.only(top: 10.0), child: SizedBox( @@ -422,9 +439,11 @@ class _DoctorProfileState extends State margin: EdgeInsets.only( top: 10.0, left: 15.0, right: 15.0), child: Text( - TranslationBase.of(context).below_average, + TranslationBase.of(context) + .below_average, style: TextStyle( - fontSize: 13.0, color: Colors.black))), + fontSize: 13.0, + color: Colors.black))), Container( margin: EdgeInsets.only(top: 10.0), child: SizedBox( @@ -440,7 +459,8 @@ class _DoctorProfileState extends State ), ), Container( - margin: EdgeInsets.only(top: 40.0), child: Divider()), + margin: EdgeInsets.only(top: 40.0), + child: Divider()), Container( margin: EdgeInsets.only(top: 0.0), child: Align( @@ -462,7 +482,8 @@ class _DoctorProfileState extends State onPressed: () { Navigator.of(context).pop(); }, - child: Text(TranslationBase.of(context).cancel, + child: Text( + TranslationBase.of(context).cancel, style: TextStyle(fontSize: 18.0)), ), ), @@ -485,7 +506,8 @@ class _DoctorProfileState extends State } double getRatingWidth(int patientNumber) { - var width = (patientNumber / this.widget.docProfileList.noOfPatientsRate) * 100; + var width = + (patientNumber / this.widget.docProfileList.noOfPatientsRate) * 100; return width; } @@ -528,8 +550,8 @@ class _DoctorProfileState extends State Future navigateToBookConfirm(context) async { Navigator.push( context, - MaterialPageRoute( - builder: (context) => BookConfirm( + FadePage( + page: BookConfirm( doctor: widget.doctor, isLiveCareAppointment: widget.isLiveCareAppointment, selectedDate: DocAvailableAppointments.selectedDate, diff --git a/lib/pages/BookAppointment/Search.dart b/lib/pages/BookAppointment/Search.dart index 94308c1c..6dee1076 100644 --- a/lib/pages/BookAppointment/Search.dart +++ b/lib/pages/BookAppointment/Search.dart @@ -1,21 +1,18 @@ import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.dart'; -import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; -import 'package:diplomaticquarterapp/widgets/others/arrow_back.dart'; -import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:flutter/material.dart'; -import 'package:geolocator/geolocator.dart'; import 'components/SearchByClinic.dart'; class Search extends StatefulWidget { final int type; final List clnicIds; + Search({this.type = 0, this.clnicIds}); + @override _SearchState createState() => _SearchState(); } @@ -43,9 +40,12 @@ class _SearchState extends State with TickerProviderStateMixin { children: [ TabBar( tabs: [ - Tab(text: TranslationBase.of(context).clinicName), Tab( - text: TranslationBase.of(context).doctorName, + child: Text(TranslationBase.of(context).clinicName, + style: TextStyle(color: Colors.black))), + Tab( + child: Text(TranslationBase.of(context).doctorName, + style: TextStyle(color: Colors.black)), ) ], controller: _tabController, diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index d18d4680..cd8bb789 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -16,6 +16,7 @@ import '../../../uitl/date_uitl.dart'; class DocAvailableAppointments extends StatefulWidget { DoctorList doctor; static bool areSlotsAvailable = false; + static bool areAppointmentsAvailable = false; static DateTime selectedAppoDateTime; static String selectedDate; static String selectedTime; @@ -345,17 +346,22 @@ class _DocAvailableAppointmentsState extends State GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { if (res['FreeTimeSlots'].length != 0) { + DocAvailableAppointments.areAppointmentsAvailable = true; freeSlotsResponse = res['FreeTimeSlots']; print("res['FreeTimeSlots']"); print(res['FreeTimeSlots'].length); _getJSONSlots().then((value) => { setState(() => {_events.clear(), _events = value}) }); - } else {} + } else { + DocAvailableAppointments.areAppointmentsAvailable = false; + } } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); }); } @@ -370,18 +376,22 @@ class _DocAvailableAppointmentsState extends State GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { if (res['PatientER_DoctorFreeSlots'].length != 0) { + DocAvailableAppointments.areAppointmentsAvailable = true; freeSlotsResponse = res['PatientER_DoctorFreeSlots']; print("res['PatientER_DoctorFreeSlots']"); print(res['PatientER_DoctorFreeSlots'].length); _getJSONSlots().then((value) => { setState(() => {_events.clear(), _events = value}) }); - } else {} + } else { + DocAvailableAppointments.areAppointmentsAvailable = false; + } } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); + AppToast.showErrorToast(message: err); print(err); }); } diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 7e4e8fa9..733bbe10 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -12,6 +12,7 @@ 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/card/rounded_container.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; class SearchByClinic extends StatefulWidget { @@ -295,8 +296,8 @@ class _SearchByClinicState extends State { BuildContext context, SearchInfo searchInfo) async { Navigator.push( context, - MaterialPageRoute( - builder: (context) => DentalComplaints(searchInfo: searchInfo), + FadePage( + page: DentalComplaints(searchInfo: searchInfo), ), ); } @@ -309,8 +310,8 @@ class _SearchByClinicState extends State { isProjectLoaded = false; Navigator.push( context, - MaterialPageRoute( - builder: (context) => SearchResults( + FadePage( + page: SearchResults( isLiveCareAppointment: false, doctorsList: docList, patientDoctorAppointmentListHospital: diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart index 5e4ea91c..a1ecb7a0 100644 --- a/lib/pages/BookAppointment/components/SearchByDoctor.dart +++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsLis 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/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import '../SearchResults.dart'; @@ -160,8 +161,8 @@ class _SearchByDoctorState extends State { patientDoctorAppointmentListHospital) async { Navigator.push( context, - MaterialPageRoute( - builder: (context) => SearchResults( + FadePage( + page: SearchResults( isLiveCareAppointment: false, doctorsList: docList, patientDoctorAppointmentListHospital: diff --git a/lib/pages/BookAppointment/widgets/CardCommon.dart b/lib/pages/BookAppointment/widgets/CardCommon.dart index b03e9b24..ce26200d 100644 --- a/lib/pages/BookAppointment/widgets/CardCommon.dart +++ b/lib/pages/BookAppointment/widgets/CardCommon.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import '../../../Constants.dart'; @@ -8,6 +9,7 @@ class CardCommon extends StatelessWidget { final text; final subText; final type; + const CardCommon( {@required this.image, @required this.text, @@ -58,9 +60,9 @@ class CardCommon extends StatelessWidget { Future navigateToSearch(context, type) async { Navigator.push( context, - MaterialPageRoute( - builder: (context) => Search( - type: type, - ))); + FadePage( + page: Search( + type: type, + ))); } } diff --git a/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart b/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart index 57377d75..02d40b3f 100644 --- a/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart +++ b/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/SearchResults.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; // ignore: must_be_immutable @@ -128,8 +129,8 @@ class _DentalComplaintCardState extends State { patientDoctorAppointmentListHospital) async { Navigator.push( context, - MaterialPageRoute( - builder: (context) => SearchResults( + FadePage( + page: SearchResults( doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital))); diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart index 2788145f..bb6fccab 100644 --- a/lib/pages/BookAppointment/widgets/DoctorView.dart +++ b/lib/pages/BookAppointment/widgets/DoctorView.dart @@ -4,16 +4,15 @@ import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsLis import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:rating_bar/rating_bar.dart'; import '../DoctorProfile.dart'; class DoctorView extends StatelessWidget { - final DoctorList doctor; - bool isLiveCareAppointment; - - + final DoctorList doctor; + bool isLiveCareAppointment; DoctorView({@required this.doctor, @required this.isLiveCareAppointment}); @@ -52,48 +51,53 @@ class DoctorView extends StatelessWidget { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - if(doctor.doctorTitle!=null) - Text(this.doctor.doctorTitle + " " + this.doctor.name, - style: TextStyle( - fontSize: 14.0, - color: Colors.grey[700], - letterSpacing: 1.0)), - Container( - margin: EdgeInsets.only(top: 3.0), - child: Text(this.doctor.clinicName != null ? this.doctor.clinicName : "", + if (doctor.doctorTitle != null) + Text(this.doctor.doctorTitle + " " + this.doctor.name, style: TextStyle( - fontSize: 12.0, - color: Colors.grey[600], + fontSize: 14.0, + color: Colors.grey[700], letterSpacing: 1.0)), - ), Container( margin: EdgeInsets.only(top: 3.0), - child: Text(this.doctor.projectName, + child: Text( + this.doctor.clinicName != null + ? this.doctor.clinicName + : "", style: TextStyle( fontSize: 12.0, color: Colors.grey[600], letterSpacing: 1.0)), ), - if(doctor.speciality!=null) Container( - margin: EdgeInsets.only(top: 3.0, bottom: 3.0), - child: Text( - getDoctorSpeciality(this.doctor.speciality).trim(), + margin: EdgeInsets.only(top: 3.0), + child: Text(this.doctor.projectName, style: TextStyle( fontSize: 12.0, color: Colors.grey[600], letterSpacing: 1.0)), ), - this.doctor.nearestFreeSlot != null ? Container( - margin: EdgeInsets.only(top: 3.0, bottom: 3.0), - child: Text( - getDate(this.doctor.nearestFreeSlot), - style: TextStyle( - fontSize: 14.0, - fontWeight: FontWeight.bold, - color: Colors.green[600], - letterSpacing: 1.0)), - ) : Container(), + if (doctor.speciality != null) + Container( + margin: EdgeInsets.only(top: 3.0, bottom: 3.0), + child: Text( + getDoctorSpeciality(this.doctor.speciality) + .trim(), + style: TextStyle( + fontSize: 12.0, + color: Colors.grey[600], + letterSpacing: 1.0)), + ), + this.doctor.nearestFreeSlot != null + ? Container( + margin: EdgeInsets.only(top: 3.0, bottom: 3.0), + child: Text(getDate(this.doctor.nearestFreeSlot), + style: TextStyle( + fontSize: 14.0, + fontWeight: FontWeight.bold, + color: Colors.green[600], + letterSpacing: 1.0)), + ) + : Container(), Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisSize: MainAxisSize.max, @@ -175,7 +179,7 @@ class DoctorView extends StatelessWidget { } String getMinute(DateTime dateObj) { - if(dateObj.minute == 0) { + if (dateObj.minute == 0) { return dateObj.minute.toString() + "0"; } else { return dateObj.minute.toString(); @@ -186,12 +190,12 @@ class DoctorView extends StatelessWidget { {isAppo}) async { Navigator.push( context, - MaterialPageRoute( - builder: (context) => DoctorProfile( - doctor: docObject, - isLiveCareAppointment: isLiveCareAppointment, - docProfileList: docProfile, - isOpenAppt: isAppo, - ))); + FadePage( + page: DoctorProfile( + doctor: docObject, + isLiveCareAppointment: isLiveCareAppointment, + docProfileList: docProfile, + isOpenAppt: isAppo, + ))); } } diff --git a/lib/pages/ChildVaccines/child_page.dart b/lib/pages/ChildVaccines/child_page.dart index ae33cc03..fad0b0c2 100644 --- a/lib/pages/ChildVaccines/child_page.dart +++ b/lib/pages/ChildVaccines/child_page.dart @@ -1,10 +1,10 @@ -import 'package:diplomaticquarterapp/core/model/childvaccines/List_BabyInformationModel.dart'; import 'package:diplomaticquarterapp/core/model/childvaccines/delete_baby_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/child_vaccines/child_vaccines_view_model.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/add_newchild_page.dart'; import 'package:diplomaticquarterapp/pages/ChildVaccines/vaccinationtable_page.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; +import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -12,9 +12,6 @@ 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:diplomaticquarterapp/uitl/date_uitl.dart'; - -import 'dialogs/delete_child.dart'; class ChildPage extends StatefulWidget { @override @@ -60,7 +57,8 @@ class _ChildPageState extends State Navigator.push( context, FadePage( - page: VaccinationTablePage(model.babyInformationModelList[index]), + page: VaccinationTablePage(model + .babyInformationModelList[index]), ), ); }, @@ -119,7 +117,9 @@ class _ChildPageState extends State Navigator.push( context, FadePage( - page: VaccinationTablePage(model.babyInformationModelList[index]), + page: VaccinationTablePage(model + .babyInformationModelList[ + index]), ), ); }, @@ -159,9 +159,9 @@ class _ChildPageState extends State newChild: deleteBaby); if (model.isDeleted) { AppToast.showSuccessToast( - message: - TranslationBase.of(context) - .recordDeleted); + message: TranslationBase.of( + context) + .recordDeleted); Navigator.pop( context, model.isDeleted); } else { @@ -183,34 +183,34 @@ class _ChildPageState extends State ], ))), ), - bottomSheet: Container( - height: height * 0.15, - width: double.infinity, - padding: EdgeInsets.all(16), - child: SecondaryButton( - textColor: Colors.white, - color: checkedValue == false - ? Colors.white24 - : Color.fromRGBO( - 63, - 72, - 74, - 1, + bottomSheet: Container( + height: height * 0.15, + width: double.infinity, + padding: EdgeInsets.all(16), + child: SecondaryButton( + textColor: Colors.white, + color: checkedValue == false + ? Colors.white24 + : Color.fromRGBO( + 63, + 72, + 74, + 1, + ), + label: TranslationBase.of(context).addNewChild, + // + onTap: () { + Navigator.push( + context, + FadePage( + page: AddNewChildPage(), + ), + ).then((value) { + if (value) model.getNewUserOrders(); + }); + }, + ), ), - label: TranslationBase.of(context).addNewChild, - // - onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => AddNewChildPage(), - ), - ).then((value) { - if (value) model.getNewUserOrders(); - }); - }, - ), - ), )); } } diff --git a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart index c82fd0f1..a8cb5048 100644 --- a/lib/pages/Covid-DriveThru/covid-drivethru-location.dart +++ b/lib/pages/Covid-DriveThru/covid-drivethru-location.dart @@ -8,6 +8,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:maps_launcher/maps_launcher.dart'; import 'package:provider/provider.dart'; @@ -285,8 +286,8 @@ class _CovidDrivethruLocationState extends State { }); Navigator.push( context, - MaterialPageRoute( - builder: (context) => CovidPaymentDetails( + FadePage( + page: CovidPaymentDetails( covidPaymentInfoResponse: covidPaymentInfoResponse, projectID: int.parse(projectID), ))); diff --git a/lib/pages/Covid-DriveThru/covid-payment-alert.dart b/lib/pages/Covid-DriveThru/covid-payment-alert.dart index 2daa3cf7..ca6640c0 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-alert.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-alert.dart @@ -296,7 +296,7 @@ class _CovidPaymentAlertState extends State { } Navigator.push( - context, MaterialPageRoute(builder: (context) => PaymentMethod())) + context, FadePage(page: PaymentMethod())) .then((value) { print(value); if (value != null) { diff --git a/lib/pages/Covid-DriveThru/covid-payment-details.dart b/lib/pages/Covid-DriveThru/covid-payment-details.dart index 07914c9e..e6c87d0a 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-details.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-details.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/pages/Covid-DriveThru/Covid-TimeSlots.dart' import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; @@ -17,7 +18,7 @@ class CovidPaymentDetails extends StatefulWidget { _CovidPaymentDetailsState createState() => _CovidPaymentDetailsState(); } -class _CovidPaymentDetailsState extends State { +class _CovidPaymentDetailsState extends State { bool isAgree = false; @override @@ -197,7 +198,8 @@ class _CovidPaymentDetailsState extends State { onPressed: () { cancel(); }, - child: Text(TranslationBase.of(context).cancel, style: TextStyle(fontSize: 18.0)), + child: Text(TranslationBase.of(context).cancel, + style: TextStyle(fontSize: 18.0)), ), ), ), @@ -218,7 +220,8 @@ class _CovidPaymentDetailsState extends State { disabledTextColor: Colors.white, disabledColor: Colors.grey[500], onPressed: isAgree ? next : null, - child: Text(TranslationBase.of(context).next, style: TextStyle(fontSize: 18.0)), + child: Text(TranslationBase.of(context).next, + style: TextStyle(fontSize: 18.0)), ), ), ), @@ -232,10 +235,10 @@ class _CovidPaymentDetailsState extends State { void next() { Navigator.push( context, - MaterialPageRoute( - builder: (context) => CovidTimeSlots( - projectID: widget.projectID, - ))); + FadePage( + page: CovidTimeSlots( + projectID: widget.projectID, + ))); } cancel() { diff --git a/lib/pages/Covid-DriveThru/covid-payment-summary.dart b/lib/pages/Covid-DriveThru/covid-payment-summary.dart index 93b4e7ae..e71285b5 100644 --- a/lib/pages/Covid-DriveThru/covid-payment-summary.dart +++ b/lib/pages/Covid-DriveThru/covid-payment-summary.dart @@ -14,6 +14,7 @@ import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; @@ -67,7 +68,8 @@ class _CovidPaymentSummaryState extends State { Image.asset(getImagePath(widget.selectedPaymentMethod)), ), Texts( - '${widget.patientShareResponse.patientShareWithTax} ' + TranslationBase.of(context).sar, + '${widget.patientShareResponse.patientShareWithTax} ' + + TranslationBase.of(context).sar, fontSize: 26, bold: true, ) @@ -300,11 +302,11 @@ class _CovidPaymentSummaryState extends State { Future navigateToQR(context, String appoQR) async { Navigator.push( context, - MaterialPageRoute( - builder: (context) => QRCode( - patientShareResponse: widget.patientShareResponse, - appoQR: appoQR, - ))); + FadePage( + page: QRCode( + patientShareResponse: widget.patientShareResponse, + appoQR: appoQR, + ))); } String getImagePath(String paymentMethod) { diff --git a/lib/pages/DrawerPages/notifications/notifications_page.dart b/lib/pages/DrawerPages/notifications/notifications_page.dart index 53aad843..9745609d 100644 --- a/lib/pages/DrawerPages/notifications/notifications_page.dart +++ b/lib/pages/DrawerPages/notifications/notifications_page.dart @@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.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/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -57,15 +58,14 @@ class NotificationsPage extends StatelessWidget { .map( (notification) => InkWell( onTap: () async { - if(!notification.isRead) + if (!notification.isRead) model.markAsRead(notification.id); Navigator.push( context, - MaterialPageRoute( - builder: (BuildContext context) => - NotificationsDetailsPage( - notification: notification, - ))); + FadePage( + page: NotificationsDetailsPage( + notification: notification, + ))); }, child: Container( width: double.infinity, @@ -122,8 +122,7 @@ class NotificationsPage extends StatelessWidget { ..add( InkWell( onTap: () async { - GifLoaderDialogUtils.showMyDialog( - context); + GifLoaderDialogUtils.showMyDialog(context); currentIndex++; GetNotificationsRequestModel getNotificationsRequestModel = @@ -132,10 +131,9 @@ class NotificationsPage extends StatelessWidget { pagingSize: 14, notificationStatusID: 2); - await model.getNotifications(getNotificationsRequestModel,context); - GifLoaderDialogUtils.hideDialog( - context); - + await model.getNotifications( + getNotificationsRequestModel, context); + GifLoaderDialogUtils.hideDialog(context); }, child: Center( child: Image.asset('assets/images/notf.png'), diff --git a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart index 1ea0f7f5..831eb013 100644 --- a/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart +++ b/lib/pages/ErService/AmbulanceRequestIndexPages/PickupLocation.dart @@ -14,11 +14,13 @@ 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/pickupLocation/PickupLocationFromMap.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:geolocator/geolocator.dart'; import 'package:google_maps_place_picker/google_maps_place_picker.dart'; + import '../AvailableAppointmentsPage.dart'; enum HaveAppointment { YES, NO } @@ -87,17 +89,16 @@ class _PickupLocationState extends State { onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => PickupLocationFromMap( - latitude: _latitude, - longitude: _longitude, - onPick: (value) { - setState(() { - _result = value; - }); - }, - ), - ), + FadePage( + page: PickupLocationFromMap( + latitude: _latitude, + longitude: _longitude, + onPick: (value) { + setState(() { + _result = value; + }); + }, + )), ); }, child: Container( @@ -111,7 +112,8 @@ class _PickupLocationState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Expanded(child: Texts(getSelectFromMapName(context))), + Expanded( + child: Texts(getSelectFromMapName(context))), Icon( FontAwesomeIcons.mapMarkerAlt, size: 24, @@ -327,8 +329,8 @@ class _PickupLocationState extends State { onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => PickupLocationFromMap( + FadePage( + page: PickupLocationFromMap( latitude: _latitude, longitude: _longitude, onPick: (value) { @@ -351,7 +353,8 @@ class _PickupLocationState extends State { child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - Expanded(child: Texts(getSelectFromMapName(context))), + Expanded( + child: Texts(getSelectFromMapName(context))), Icon( FontAwesomeIcons.mapMarkerAlt, size: 24, @@ -366,7 +369,6 @@ class _PickupLocationState extends State { SizedBox( height: 45, ), - ], ), ), @@ -409,18 +411,16 @@ class _PickupLocationState extends State { widget.patientER.pickupLocationLattitude; widget.patientER.longitude = widget.patientER.pickupLocationLongitude; - widget.patientER.dropoffLocationName = - _selectedHospital.name; + widget.patientER.dropoffLocationName = _selectedHospital.name; widget.patientER.createdBy = widget.amRequestViewModel.user.patientID; widget.patientER.isOutPatient = widget.amRequestViewModel.user.outSA; - widget.patientER.patientIdentificationID = widget - .amRequestViewModel.user.patientIdentificationNo; + widget.patientER.patientIdentificationID = + widget.amRequestViewModel.user.patientIdentificationNo; widget.patientER.pickupDateTime = DateUtil.convertDateToStringLocation(DateTime.now()); - widget.patientER.pickupLocationName = - _result.formattedAddress; + widget.patientER.pickupLocationName = _result.formattedAddress; widget.patientER.projectID = widget.amRequestViewModel.user.projectID; widget.patientER.requesterFileNo = @@ -498,8 +498,8 @@ class _PickupLocationState extends State { GifLoaderDialogUtils.hideDialog(context); Navigator.push( context, - MaterialPageRoute( - builder: (context) => AvailableAppointmentsPage( + FadePage( + page: AvailableAppointmentsPage( appointmentsAllHistoryList: widget.amRequestViewModel.appoitmentAllHistoryResultList, ), diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index b638b2ff..9848b394 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; import 'package:rating_bar/rating_bar.dart'; @@ -236,8 +237,8 @@ class _AppointmentDetailsState extends State Future navigateToBookConfirm(context) async { Navigator.push( context, - MaterialPageRoute( - builder: (context) => BookConfirm( + FadePage( + page: BookConfirm( doctor: getDoctorObject(), isLiveCareAppointment: widget.appo.isLiveCareAppointment, selectedDate: DocAvailableAppointments.selectedDate, diff --git a/lib/pages/MyAppointments/MyAppointments.dart b/lib/pages/MyAppointments/MyAppointments.dart index a49149b5..5ed0fef4 100644 --- a/lib/pages/MyAppointments/MyAppointments.dart +++ b/lib/pages/MyAppointments/MyAppointments.dart @@ -82,9 +82,17 @@ class _MyAppointmentsState extends State child: Column(children: [ TabBar( tabs: [ - Tab(text: TranslationBase.of(context).booked), - Tab(text: TranslationBase.of(context).confirmed), - Tab(text: TranslationBase.of(context).arrived), + Tab( + child: Text(TranslationBase.of(context).booked, + style: TextStyle(color: Colors.black))), + Tab( + child: Text(TranslationBase.of(context).confirmed, + style: TextStyle(color: Colors.black)), + ), + Tab( + child: Text(TranslationBase.of(context).arrived, + style: TextStyle(color: Colors.black)), + ) ], controller: _tabController, ), @@ -103,7 +111,7 @@ class _MyAppointmentsState extends State leading: Radio( value: FilterType.Clinic, groupValue: filterType, - activeColor: Theme.of(context).primaryColor, + activeColor: Color(0xffB8382C), onChanged: (FilterType value) { setFilterType(value); }, @@ -120,7 +128,7 @@ class _MyAppointmentsState extends State leading: Radio( value: FilterType.Hospital, groupValue: filterType, - activeColor: Theme.of(context).primaryColor, + activeColor: Color(0xffB8382C), onChanged: (FilterType value) => setFilterType(value), ), ), diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 0df4a3a5..51eefe1a 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -498,8 +498,8 @@ class _AppointmentActionsState extends State { dynamic listPres) async { Navigator.push( context, - MaterialPageRoute( - builder: (context) => PrescriptionReportPage( + FadePage( + page: PrescriptionReportPage( prescriptionReportEnhList: prescriptionReportEnhList, listPres: listPres, appo: widget.appo))); @@ -508,8 +508,8 @@ class _AppointmentActionsState extends State { Future navigateToLabResults(PatientLabOrders patientLabOrders) async { Navigator.push( context, - MaterialPageRoute( - builder: (context) => + FadePage( + page: LaboratoryResultPage(patientLabOrders: patientLabOrders))) .then((value) {}); } @@ -517,8 +517,8 @@ class _AppointmentActionsState extends State { Future navigateToRadiologyDetails(FinalRadiology finalRadiology) async { Navigator.push( context, - MaterialPageRoute( - builder: (context) => + FadePage( + page: RadiologyDetailsPage(finalRadiology: finalRadiology))) .then((value) {}); } diff --git a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart index 0d3ac2e5..51e18ff4 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentCardView.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentCardView.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResu import 'package:diplomaticquarterapp/pages/MyAppointments/models/AppointmentType.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_countdown_timer/countdown_timer_controller.dart'; import 'package:flutter_countdown_timer/current_remaining_time.dart'; @@ -57,14 +58,14 @@ class _ApointmentCardState extends State { children: [ Container( width: projectViewModel.isArabic ? 27 : 20, - height: projectViewModel.isArabic ? 165 : 140, + height: projectViewModel.isArabic ? 165 : 140, decoration: BoxDecoration( //Colors.red[900] Color(0xff404545) color: widget.appo.isLiveCareAppointment ? Color(0xff404545) : !widget.appo.isInOutPatient - ? Colors.red[900] - : Theme.of(context).primaryColor, + ? Colors.red[900] + : Theme.of(context).primaryColor, borderRadius: BorderRadius.only( topLeft: projectViewModel.isArabic ? Radius.circular(0) @@ -85,21 +86,21 @@ class _ApointmentCardState extends State { child: Center( child: Text( widget.appo.isLiveCareAppointment - ? TranslationBase.of(context) - .liveCare - .toUpperCase() + ? TranslationBase.of(context).liveCare.toUpperCase() : !widget.appo.isInOutPatient - ? TranslationBase.of(context) - .inPatient - .toUpperCase() - : TranslationBase.of(context) - .outpatient - .toUpperCase(), + ? TranslationBase.of(context) + .inPatient + .toUpperCase() + : TranslationBase.of(context) + .outpatient + .toUpperCase(), style: TextStyle(color: Colors.white), ), )), ), - SizedBox(width: 8,), + SizedBox( + width: 8, + ), ClipRRect( borderRadius: BorderRadius.circular(100.0), child: Image.network(widget.appo.doctorImageURL, @@ -166,7 +167,7 @@ class _ApointmentCardState extends State { ), Container( transform: - Matrix4.translationValues(15.0, -40.0, 0.0), + Matrix4.translationValues(15.0, -40.0, 0.0), child: projectViewModel.isArabic ? Image.asset( "assets/images/new-design/arrow_menu_black-ar.png", @@ -179,17 +180,18 @@ class _ApointmentCardState extends State { ), ], ), - (widget.appo.patientStatusType == AppointmentType.BOOKED || + (widget.appo.patientStatusType == + AppointmentType.BOOKED || widget.appo.patientStatusType == AppointmentType.CONFIRMED) ? Container( child: CountdownTimer( controller: new CountdownTimerController( - endTime: - DateTime.now().millisecondsSinceEpoch + - (widget.appo.remaniningHoursTocanPay * - 1000) * - 60), + endTime: DateTime.now() + .millisecondsSinceEpoch + + (widget.appo.remaniningHoursTocanPay * + 1000) * + 60), widgetBuilder: (_, CurrentRemainingTime time) { return time != null ? Text( @@ -235,10 +237,7 @@ class _ApointmentCardState extends State { } Future navigateToAppointmentDetails(context, appo) async { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => AppointmentDetails(appo: appo))) + Navigator.push(context, FadePage(page: AppointmentDetails(appo: appo))) .then((value) { widget.onReloadAppointmentHistory(); }); diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index e33a98d9..79bcd94b 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -21,6 +21,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_countdown_timer/countdown_timer_controller.dart'; import 'package:flutter_countdown_timer/current_remaining_time.dart'; @@ -600,8 +601,8 @@ class _ToDoState extends State { Future navigateToAppointmentDetails(context, appo) async { Navigator.push( context, - MaterialPageRoute( - builder: (context) => AppointmentDetails(appo: appo))) + FadePage( + page: AppointmentDetails(appo: appo))) .then((value) { getPatientAppointmentHistory(); }); @@ -702,8 +703,8 @@ class _ToDoState extends State { context, String appoQR, PatientShareResponse patientShareResponse) async { Navigator.push( context, - MaterialPageRoute( - builder: (context) => QRCode( + FadePage( + page: QRCode( patientShareResponse: patientShareResponse, appoQR: appoQR, ))).then((value) { @@ -907,7 +908,7 @@ class _ToDoState extends State { } Navigator.push( - context, MaterialPageRoute(builder: (context) => PaymentMethod())) + context, FadePage(page: PaymentMethod())) .then((value) { print(value); getPatientAppointmentHistory(); diff --git a/lib/pages/ToDoList/widgets/upcomingCard.dart b/lib/pages/ToDoList/widgets/upcomingCard.dart index 3fefe616..6610ed33 100644 --- a/lib/pages/ToDoList/widgets/upcomingCard.dart +++ b/lib/pages/ToDoList/widgets/upcomingCard.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dar import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:rating_bar/rating_bar.dart'; @@ -351,6 +352,6 @@ class _TodoListCardState extends State { Future navigateToAppointmentDetails(context) async { Navigator.push( - context, MaterialPageRoute(builder: (context) => AppointmentDetails())); + context, FadePage(page: AppointmentDetails())); } } diff --git a/lib/pages/landing/home_page.dart b/lib/pages/landing/home_page.dart index 511630c4..c2639bbd 100644 --- a/lib/pages/landing/home_page.dart +++ b/lib/pages/landing/home_page.dart @@ -2,7 +2,6 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart'; -import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_index_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart'; @@ -11,7 +10,6 @@ import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -19,7 +17,6 @@ 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:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:flutter_svg/flutter_svg.dart'; import 'package:hexcolor/hexcolor.dart'; import 'package:provider/provider.dart'; @@ -70,7 +67,7 @@ class _HomePageState extends State { right: 5, child: Container( width: - MediaQuery.of(context).size.width * 0.8, + MediaQuery.of(context).size.width * 0.8, child: Row( children: [ Expanded( @@ -85,54 +82,82 @@ class _HomePageState extends State { fit: BoxFit.fill, ), color: - Colors.white.withOpacity(0.3), + Colors.white.withOpacity(0.3), borderRadius: BorderRadius.all( Radius.circular(5))), child: Container( - child: Column( children: [ - Texts(TranslationBase.of(context).covidTest, - color: Colors.white, - fontWeight: FontWeight.w700, - ), + Texts( + TranslationBase.of(context) + .covidTest, + color: Colors.white, + fontWeight: FontWeight.w700, + ), Row( - mainAxisAlignment: MainAxisAlignment.spaceAround, + mainAxisAlignment: + MainAxisAlignment + .spaceAround, children: [ Container( margin: EdgeInsets.only( - top: 15.0,), + top: 15.0, + ), child: SvgPicture.asset( 'assets/images/new-design/covid-19-car.svg', width: 45.0, height: 45.0), ), Container( - margin: EdgeInsets.only(top: 5.0), + margin: EdgeInsets.only( + top: 5.0), child: Column( children: [ - Texts(TranslationBase.of(context).driveThru, - fontWeight: FontWeight.w700, - color: Colors.white,), + Texts( + TranslationBase.of( + context) + .driveThru, + fontWeight: + FontWeight.w700, + color: Colors.white, + ), ButtonTheme( - shape: RoundedRectangleBorder( + shape: + RoundedRectangleBorder( borderRadius: - BorderRadius.circular(5.0),), - minWidth: MediaQuery.of(context).size.width * 0.15, + BorderRadius + .circular( + 5.0), + ), + minWidth: MediaQuery.of( + context) + .size + .width * + 0.15, height: 25.0, child: RaisedButton( - color: Colors.red[800], - textColor: Colors.white, - disabledTextColor: Colors.white, - disabledColor: new Color(0xFFbcc2c4), + color: Colors + .red[800], + textColor: + Colors.white, + disabledTextColor: + Colors.white, + disabledColor: + new Color( + 0xFFbcc2c4), onPressed: () { navigateToCovidDriveThru(); }, child: Texts( - TranslationBase.of(context).bookNow, - fontWeight: FontWeight.w700, - color: Colors.white, - ), + TranslationBase.of( + context) + .bookNow, + fontWeight: + FontWeight + .w700, + color: Colors + .white, + ), ), ), ], @@ -173,265 +198,274 @@ class _HomePageState extends State { ], ), ), - Container(width: double.infinity, height:projectViewModel.isArabic ?110: 80) + Container( + width: double.infinity, + height: projectViewModel.isArabic ? 110 : 80) ], ), Positioned( top: 155, left: MediaQuery.of(context).size.width * (MediaQuery.of(context).orientation == - Orientation.landscape + Orientation.landscape ? 0.02 : 0.03), right: MediaQuery.of(context).size.width * (MediaQuery.of(context).orientation == - Orientation.landscape + Orientation.landscape ? 0.02 : 0.03), child: (!model.isLogin) ? Container( - width: double.infinity, - height: 125, - decoration: BoxDecoration( - color: HexColor('#A59E9E'), - shape: BoxShape.rectangle, - border: Border.all( - color: Colors.transparent, width: 0.5), - borderRadius: - BorderRadius.all(Radius.circular(9)), - image: DecorationImage( - image: ExactAssetImage( - 'assets/images/bg_graphic.png'), - fit: BoxFit.cover)), - child: Container( - margin: EdgeInsets.all(5), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - SizedBox( - height: 2, - ), - Texts( - TranslationBase.of(context).myMedicalFile, - color: Colors.black87, - fontWeight: FontWeight.w700, - fontSize: 23, - ), - - Texts( - TranslationBase.of(context) - .myMedicalFileSubTitle, - color: Colors.black, - fontSize: 16, - ), - Align( - alignment: projectViewModel.isArabic - ? Alignment.bottomLeft - : Alignment.bottomRight, - child: InkWell( - onTap: () { - widget.goToMyProfile(); - }, - child: Container( - margin: EdgeInsets.only(left: 15,right: 15), - width: 90, - height: 30, - decoration: BoxDecoration( - color: HexColor('#D81A2E'), - shape: BoxShape.rectangle, - border: Border.all( - color: Colors.transparent, - width: 0.5), - borderRadius: BorderRadius.all( - Radius.circular(0)), + width: double.infinity, + height: 125, + decoration: BoxDecoration( + color: HexColor('#A59E9E'), + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.transparent, width: 0.5), + borderRadius: + BorderRadius.all(Radius.circular(9)), + image: DecorationImage( + image: ExactAssetImage( + 'assets/images/bg_graphic.png'), + fit: BoxFit.cover)), + child: Container( + margin: EdgeInsets.all(5), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + SizedBox( + height: 2, + ), + Texts( + TranslationBase.of(context).myMedicalFile, + color: Colors.black87, + fontWeight: FontWeight.w700, + fontSize: 23, ), - child: Center( + Texts( + TranslationBase.of(context) + .myMedicalFileSubTitle, + color: Colors.black, + fontSize: 16, + ), + Align( + alignment: projectViewModel.isArabic + ? Alignment.bottomLeft + : Alignment.bottomRight, child: InkWell( onTap: () { - openBrowser(); + widget.goToMyProfile(); }, - child: Texts( - TranslationBase.of(context).viewMore, - color: Colors.white, - fontWeight: FontWeight.w700, - fontSize: 12, + child: Container( + margin: EdgeInsets.only( + left: 15, right: 15), + width: 90, + height: 30, + decoration: BoxDecoration( + color: HexColor('#D81A2E'), + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.transparent, + width: 0.5), + borderRadius: BorderRadius.all( + Radius.circular(0)), + ), + child: Center( + child: InkWell( + // onTap: () { + // openBrowser(); + // }, + child: Texts( + TranslationBase.of(context) + .viewMore, + color: Colors.white, + fontWeight: FontWeight.w700, + fontSize: 12, + ), + ), + ), ), ), - ), - ), + ) + ], ), - ) - ], - ), - ), - ) + ), + ) : Container( - width: double.infinity, - height: projectViewModel.isArabic ? 160:130, - decoration: BoxDecoration( - color: HexColor('#A59E9E'), - shape: BoxShape.rectangle, - border: Border.all( - color: Colors.transparent, width: 0.5), - borderRadius: - BorderRadius.all(Radius.circular(9)), - image: DecorationImage( - image: ExactAssetImage( - 'assets/images/bg_graphic.png'), - fit: BoxFit.cover), - ), - child: Container( - margin: EdgeInsets.all(5), - child: Column( - children: [ - Row( - children: [ - if (projectViewModel.user != null && model.isLogin) - Expanded( - child: Column( - crossAxisAlignment: - CrossAxisAlignment.start, - children: [ - SizedBox( - height: 8, + width: double.infinity, + height: projectViewModel.isArabic ? 160 : 130, + decoration: BoxDecoration( + color: HexColor('#A59E9E'), + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.transparent, width: 0.5), + borderRadius: + BorderRadius.all(Radius.circular(9)), + image: DecorationImage( + image: ExactAssetImage( + 'assets/images/bg_graphic.png'), + fit: BoxFit.cover), + ), + child: Container( + margin: EdgeInsets.all(5), + child: Column( + children: [ + Row( + children: [ + if (projectViewModel.user != null && + model.isLogin) + Expanded( + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + SizedBox( + height: 8, + ), + Row( + children: [ + Texts( + model.user.firstName + + " " + + model.user.lastName, + color: Colors.grey[100], + bold: true, + fontSize: 15, + ), + Container( + margin: + EdgeInsets.fromLTRB( + 8.0, + 0.0, + 8.0, + 0.0), + child: SvgPicture.asset( + "assets/images/new-design/verification_check.svg"), + ), + ], + ), + Texts( + '${model.user.patientID}', + color: Colors.white, + fontSize: 14, + ), + SizedBox( + height: 5, + ), + Texts( + '${DateUtil.getMonthDayYearDateFormatted(model.user.dateofBirthDataTime)} ,${model.user.genderDescription} ${model.user.ageDesc}', + color: Colors.grey[100], + fontWeight: FontWeight.normal, + fontSize: 14, + ), + ], + ), ), - Row( - children: [ - Texts( - model.user.firstName + - " " + - model.user.lastName, - color: Colors.grey[100], - bold: true, - fontSize: 15, + InkWell( + onTap: () { + widget.goToMyProfile(); + }, + child: Container( + margin: EdgeInsets.all(2), + width: 90, + height: 30, + decoration: BoxDecoration( + color: HexColor('#D81A2E'), + shape: BoxShape.rectangle, + border: Border.all( + color: Colors.transparent, + width: 0.5), + borderRadius: BorderRadius.all( + Radius.circular(5), ), - Container( - margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0), - child: SvgPicture.asset( - "assets/images/new-design/verification_check.svg"), + ), + child: Center( + child: Texts( + TranslationBase.of(context) + .viewMore, + color: Colors.white, + fontSize: 12, ), - ], - ), - Texts( - '${model.user.patientID}', - color: Colors.white, - fontSize: 14, - ), - SizedBox( - height: 5, - ), - Texts( - '${DateUtil.getMonthDayYearDateFormatted(model.user.dateofBirthDataTime)} ,${model.user.genderDescription} ${model.user.ageDesc}', - color: Colors.grey[100], - fontWeight: FontWeight.normal, - fontSize: 14, + ), ), - ], - ), - ), - InkWell( - onTap: () { - widget.goToMyProfile(); - }, - child: Container( - margin: EdgeInsets.all(2), - width: 90, - height: 30, - decoration: BoxDecoration( - color: HexColor('#D81A2E'), - shape: BoxShape.rectangle, - border: Border.all( - color: Colors.transparent, - width: 0.5), - borderRadius: BorderRadius.all( - Radius.circular(5), - ), - ), - child: Center( - child: Texts( - TranslationBase.of(context) - .viewMore, - color: Colors.white, - fontSize: 12, - ), - ), - ), - ) - ], - ), - Row( - children: [ - Expanded( - child: Row( - children: [ - Image.asset( - 'assets/images/height_icon.png', - width: 35, - height: 40, - ), - Texts( - "${model.heightCm}", - color: Colors.white, - fontSize: 17, ) ], ), - ), - SizedBox( - width: 3, - ), - Expanded( - child: Row( + Row( children: [ - Image.asset( - 'assets/images/weight_icon.png', - width: 25, - height: 40, + Expanded( + child: Row( + children: [ + Image.asset( + 'assets/images/height_icon.png', + width: 35, + height: 40, + ), + Texts( + "${model.heightCm}", + color: Colors.white, + fontSize: 17, + ) + ], + ), ), - Texts( - '${model.weightKg}', - color: Colors.white, - fontSize: 17 - ) - ], - ), - ), - SizedBox( - width: 3, - ), - Expanded( - child: Row( - mainAxisAlignment: - MainAxisAlignment.spaceBetween, - children: [ - Image.asset( - 'assets/images/blood_icon.png', - width: 35, - height: 40, + SizedBox( + width: 3, + ), + Expanded( + child: Row( + children: [ + Image.asset( + 'assets/images/weight_icon.png', + width: 25, + height: 40, + ), + Texts('${model.weightKg}', + color: Colors.white, + fontSize: 17) + ], + ), + ), + SizedBox( + width: 3, + ), + Expanded( + child: Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Image.asset( + 'assets/images/blood_icon.png', + width: 35, + height: 40, + ), + Texts( + '${model.booldType}', + color: Colors.white, + ) + ], + ), ), - Texts( - '${model.booldType}', - color: Colors.white, - ) ], - ), - ), - ], - ) - ], - ), - ), - ), + ) + ], + ), + ), + ), ), ], ), - if(projectViewModel.havePrivilege(64)||projectViewModel.havePrivilege(65)||projectViewModel.havePrivilege(67)) + if (projectViewModel.havePrivilege(64) || + projectViewModel.havePrivilege(65) || + projectViewModel.havePrivilege(67)) Container( margin: EdgeInsets.only(left: 15, right: 15), child: Row( mainAxisAlignment: MainAxisAlignment.spaceBetween, children: [ - if(projectViewModel.havePrivilege(64)) + if (projectViewModel.havePrivilege(64)) DashboardItem( onTap: () { Navigator.push( @@ -455,11 +489,13 @@ class _HomePageState extends State { height: 10, ), Texts( - TranslationBase.of(context).homeHealthCare, + TranslationBase.of(context) + .homeHealthCare, textAlign: TextAlign.center, color: Colors.white, fontWeight: FontWeight.w700, - fontSize: SizeConfig.textMultiplier * 1.55, + fontSize: + SizeConfig.textMultiplier * 1.55, ) ], ), @@ -469,10 +505,10 @@ class _HomePageState extends State { imageName: 'home_healthcare_service_bg.png', opacity: 0.5, ), - if(projectViewModel.havePrivilege(65)) + if (projectViewModel.havePrivilege(65)) DashboardItem( - onTap: () => Navigator.push(context, FadePage(page: LandingPagePharmacy())), - + onTap: () => Navigator.push( + context, FadePage(page: LandingPagePharmacy())), child: Center( child: Padding( padding: const EdgeInsets.all(15.0), @@ -487,11 +523,13 @@ class _HomePageState extends State { height: 20, ), Texts( - TranslationBase.of(context).onlinePharmacy, + TranslationBase.of(context) + .onlinePharmacy, textAlign: TextAlign.center, color: Colors.white, fontWeight: FontWeight.w700, - fontSize: SizeConfig.textMultiplier * 1.55, + fontSize: + SizeConfig.textMultiplier * 1.55, ) ], ), @@ -500,9 +538,9 @@ class _HomePageState extends State { height: MediaQuery.of(context).size.width * 0.4, imageName: 'al-habib_onlne_pharmacy_bg.png', ), - if(projectViewModel.havePrivilege(67)) + if (projectViewModel.havePrivilege(67)) DashboardItem( - onTap: (){ + onTap: () { Navigator.push( context, FadePage( @@ -521,14 +559,15 @@ class _HomePageState extends State { height: 50, ), SizedBox( - height:10, + height: 10, ), Texts( TranslationBase.of(context).cmcHeading, textAlign: TextAlign.center, color: Colors.white, fontWeight: FontWeight.w700, - fontSize: SizeConfig.textMultiplier * 1.55, + fontSize: + SizeConfig.textMultiplier * 1.55, ) ], ), @@ -616,7 +655,7 @@ class _HomePageState extends State { borderRadius: BorderRadius.circular(6.0), color: Colors.white, )), - if(projectViewModel.havePrivilege(60)) + if (projectViewModel.havePrivilege(60)) Container( width: MediaQuery.of(context).size.width * 0.29, child: InkWell( @@ -624,8 +663,8 @@ class _HomePageState extends State { context, FadePage( page: ErOptions( - isAppbar: true, - ))), + isAppbar: true, + ))), child: Center( child: Padding( padding: const EdgeInsets.all(15.0), @@ -645,7 +684,8 @@ class _HomePageState extends State { textAlign: TextAlign.center, color: Colors.black87, bold: false, - fontSize: SizeConfig.textMultiplier * 1.7, + fontSize: + SizeConfig.textMultiplier * 1.7, ) ], ), @@ -763,29 +803,28 @@ class _HomePageState extends State { ); } - openBrowser() { - InAppBrowser browser = new InAppBrowser(); - browser.openUrl(url: "https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=ca9dd276-0a20-4924-a768-fafa9a855ef1&&CustomerId=1367368"); - } + // openBrowser() { + // InAppBrowser browser = new InAppBrowser(); + // browser.openUrl(url: "https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=ca9dd276-0a20-4924-a768-fafa9a855ef1&&CustomerId=1367368"); + // } navigateToCovidDriveThru() { - Navigator.push(context, - MaterialPageRoute(builder: (context) => CovidDrivethruLocation())); + Navigator.push(context, FadePage(page: CovidDrivethruLocation())); } } class DashboardItem extends StatelessWidget { const DashboardItem( {this.hasBorder = false, - this.imageName, - @required this.child, - this.onTap, - Key key, - this.width, - this.height, - this.color, - this.opacity = 0.4, - this.hasColorFilter = true}) + this.imageName, + @required this.child, + this.onTap, + Key key, + this.width, + this.height, + this.color, + this.opacity = 0.4, + this.hasColorFilter = true}) : super(key: key); final bool hasBorder; final String imageName; @@ -803,14 +842,16 @@ class DashboardItem extends StatelessWidget { onTap: onTap, child: Container( width: width != null ? width : MediaQuery.of(context).size.width * 0.29, - height: height != null ? height : MediaQuery.of(context).orientation == Orientation.portrait - ? MediaQuery.of(context).size.height * 0.17 - : MediaQuery.of(context).size.height * 0.35, + height: height != null + ? height + : MediaQuery.of(context).orientation == Orientation.portrait + ? MediaQuery.of(context).size.height * 0.17 + : MediaQuery.of(context).size.height * 0.35, decoration: BoxDecoration( color: !hasBorder ? color != null - ? color - : HexColor('#050705').withOpacity(opacity) + ? color + : HexColor('#050705').withOpacity(opacity) : Colors.white, borderRadius: BorderRadius.circular(6.0), border: hasBorder @@ -818,11 +859,13 @@ class DashboardItem extends StatelessWidget { : Border.all(width: 0.0, color: Colors.transparent), image: imageName != null ? DecorationImage( - image: ExactAssetImage('assets/images/$imageName'), - fit: BoxFit.cover, - colorFilter: hasColorFilter ? new ColorFilter.mode( - Colors.black.withOpacity(0.2), BlendMode.dstIn) : null, - ) + image: ExactAssetImage('assets/images/$imageName'), + fit: BoxFit.cover, + colorFilter: hasColorFilter + ? new ColorFilter.mode( + Colors.black.withOpacity(0.2), BlendMode.dstIn) + : null, + ) : null, ), child: Center( diff --git a/lib/pages/landing/landing_page_pharmcy.dart b/lib/pages/landing/landing_page_pharmcy.dart index f9d8250c..3dab7c83 100644 --- a/lib/pages/landing/landing_page_pharmcy.dart +++ b/lib/pages/landing/landing_page_pharmcy.dart @@ -1,28 +1,22 @@ -import 'dart:convert'; - -import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; -import 'package:diplomaticquarterapp/config/config.dart'; import 'package:barcode_scan_fix/barcode_scan.dart'; +import 'package:diplomaticquarterapp/config/config.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/core/service/client/base_app_client.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; -import 'package:diplomaticquarterapp/pages/parent_categorise_page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/medicine_search_screen.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart'; import 'package:diplomaticquarterapp/pages/pharmacy_categorise.dart'; import 'package:diplomaticquarterapp/pages/search_products_page.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/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart'; import 'package:diplomaticquarterapp/widgets/pharmacy/bottom_nav_pharmacy_bar.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart'; class LandingPagePharmacy extends StatefulWidget { @override @@ -80,8 +74,7 @@ class _LandingPagePharmacyState extends State { onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => SearchProductsPage()), + FadePage(page: SearchProductsPage()), ); }, ), diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 5cfdacc6..103066d5 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -22,6 +22,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -256,9 +257,7 @@ class _clinic_listState extends State { }); } - Navigator.push( - context, MaterialPageRoute(builder: (context) => PaymentMethod())) - .then((value) { + Navigator.push(context, FadePage(page: PaymentMethod())).then((value) { print(value); if (value != null) { openPayment(value, authUser, @@ -669,8 +668,8 @@ class _clinic_listState extends State { patientDoctorAppointmentListHospital) async { Navigator.push( context, - MaterialPageRoute( - builder: (context) => SearchResults( + FadePage( + page: SearchResults( doctorsList: docList, isLiveCareAppointment: true, patientDoctorAppointmentListHospital: diff --git a/lib/pages/login/login-type.dart b/lib/pages/login/login-type.dart index 69a66d9e..f8af8eac 100644 --- a/lib/pages/login/login-type.dart +++ b/lib/pages/login/login-type.dart @@ -1,10 +1,14 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/pages/login/forgot-password.dart'; +import 'package:diplomaticquarterapp/pages/login/login.dart'; +import 'package:diplomaticquarterapp/pages/login/register.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -50,8 +54,8 @@ class LoginType extends StatelessWidget { child: InkWell( onTap: () => { LoginType.loginType = 1, - Navigator.of(context) - .pushNamed(LOGIN_PAGE) + Navigator.of(context) + .push(FadePage(page: Login())), }, child: RoundedContainer( borderColor: Colors.grey, @@ -90,8 +94,8 @@ class LoginType extends StatelessWidget { child: InkWell( onTap: () => { LoginType.loginType = 2, - Navigator.of(context) - .pushNamed(LOGIN_PAGE) + Navigator.of(context) + .push(FadePage(page: Login())), }, child: RoundedContainer( borderColor: Colors.grey, @@ -136,8 +140,8 @@ class LoginType extends StatelessWidget { Center( child: InkWell( onTap: () => { - Navigator.of(context) - .pushNamed(FORGOT_PASSWORD) + Navigator.of(context) + .push(FadePage(page: ForgotPassword())), }, child: AppText( TranslationBase.of(context) @@ -166,9 +170,8 @@ class LoginType extends StatelessWidget { child: DefaultButton( TranslationBase.of(context).registerNow, () => { - Navigator.of(context).pushNamed( - REGISTER, - ) + Navigator.of(context) + .push(FadePage(page: Register())), }, )), ], diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 44be9a6d..6bc99be5 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -9,9 +9,10 @@ import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel. import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_paitent_authentication_req.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; +import 'package:diplomaticquarterapp/pages/login/confirm-login.dart'; import 'package:diplomaticquarterapp/pages/login/login-type.dart'; +import 'package:diplomaticquarterapp/pages/login/register.dart'; import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart'; -import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; @@ -24,8 +25,6 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; -import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -48,10 +47,13 @@ class _Login extends State { final authService = new AuthProvider(); var sharedPref = new AppSharedPreferences(); bool isLoading = false; - AppointmentRateViewModel appointmentRateViewModel = locator(); - PharmacyModuleViewModel pharmacyModuleViewModel = locator(); + AppointmentRateViewModel appointmentRateViewModel = + locator(); + PharmacyModuleViewModel pharmacyModuleViewModel = + locator(); - AuthenticatedUserObject authenticatedUserObject = locator(); + AuthenticatedUserObject authenticatedUserObject = + locator(); ProjectViewModel projectViewModel; ToDoCountProviderModel toDoProvider; @@ -97,7 +99,10 @@ class _Login extends State { children: [ Directionality( textDirection: TextDirection.ltr, - child: MobileNo(onNumberChange: (value) => {mobileNo = value, validateForm()}, onCountryChange: (value) => countryCode = value)), + child: MobileNo( + onNumberChange: (value) => + {mobileNo = value, validateForm()}, + onCountryChange: (value) => countryCode = value)), Directionality( textDirection: TextDirection.ltr, child: Container( @@ -138,7 +143,9 @@ class _Login extends State { child: DefaultButton( TranslationBase.of(context).login, () => {this.startLogin()}, - color: isButtonDisabled == true ? Colors.grey : Colors.grey[900], + color: isButtonDisabled == true + ? Colors.grey + : Colors.grey[900], textColor: Colors.white, )) ], @@ -159,7 +166,8 @@ class _Login extends State { } void validateForm() { - if (util.validateIDBox(nationalIDorFile.text, loginType) == true && util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) { + if (util.validateIDBox(nationalIDorFile.text, loginType) == true && + util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) { setState(() { isButtonDisabled = false; }); @@ -196,7 +204,7 @@ class _Login extends State { sharedPref.setString(LOGIN_TOKEN_ID, value['LogInTokenID']), sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, request), GifLoaderDialogUtils.hideDialog(context), - Navigator.of(context).pushNamed(CONFIRM_LOGIN) + Navigator.of(context).push(FadePage(page: ConfirmLogin())), } else { @@ -212,9 +220,7 @@ class _Login extends State { cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => { ConfirmDialog.closeAlertDialog(context), - Navigator.of(context).pushNamed( - REGISTER, - ), + Navigator.of(context).push(FadePage(page: Register())), }, cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}); dialog.showAlertDialog(context); @@ -259,9 +265,9 @@ class _Login extends State { projectViewModel.isLogin = true; projectViewModel.user = authenticatedUserObject.user; - await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { - if(pharmacyModuleViewModel.error.isNotEmpty) - await pharmacyModuleViewModel.createUser(); + await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { + if (pharmacyModuleViewModel.error.isNotEmpty) + await pharmacyModuleViewModel.createUser(); }); appointmentRateViewModel diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart index 131db748..c6a3b872 100644 --- a/lib/pages/login/register.dart +++ b/lib/pages/login/register.dart @@ -3,24 +3,22 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_user_status_reponse.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_user_status_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/checkpatient_for_registration.dart'; +import 'package:diplomaticquarterapp/pages/login/confirm-login.dart'; import 'package:diplomaticquarterapp/pages/login/login-type.dart'; -import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.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/uitl/utils.dart'; -import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; -import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/alert_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/input/text_field.dart'; import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -43,6 +41,7 @@ class _Register extends State { final sharedPref = new AppSharedPreferences(); bool isLoading; + @override Widget build(BuildContext context) { return AppScaffold( @@ -50,39 +49,38 @@ class _Register extends State { isShowAppBar: true, isShowDecPage: false, body: SingleChildScrollView( - child: Container( - padding: - EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), - height: SizeConfig.realScreenHeight * .9, - width: SizeConfig.realScreenWidth, - child: Column(children: [ - Expanded( - flex: 1, - child: AppText( - TranslationBase.of(context).enterNationalId, - fontSize: SizeConfig.textMultiplier * 3, - textAlign: TextAlign.left, - )), - Expanded( - flex: 4, - child: Column( - mainAxisAlignment: MainAxisAlignment.spaceEvenly, - children: [ - MobileNo( - onNumberChange: (value) => - {mobileNo = value, validateForm()}, - onCountryChange: (value) => countryCode = value), - Container( - child: TextFields( - controller: nationalIDorFile, - onChanged: (value) => validateForm(), - keyboardType: TextInputType.number, - prefixIcon: Icon(Icons.chrome_reader_mode, - color: Color(0xFF40ACC9)), - padding: EdgeInsets.only( - top: 20, bottom: 20, left: 10, right: 10), - hintText: TranslationBase.of(context).nationalID, - )), + child: Container( + padding: EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30), + height: SizeConfig.realScreenHeight * .9, + width: SizeConfig.realScreenWidth, + child: Column(children: [ + Expanded( + flex: 1, + child: AppText( + TranslationBase.of(context).enterNationalId, + fontSize: SizeConfig.textMultiplier * 3, + textAlign: TextAlign.left, + )), + Expanded( + flex: 4, + child: Column( + mainAxisAlignment: MainAxisAlignment.spaceEvenly, + children: [ + MobileNo( + onNumberChange: (value) => + {mobileNo = value, validateForm()}, + onCountryChange: (value) => countryCode = value), + Container( + child: TextFields( + controller: nationalIDorFile, + onChanged: (value) => validateForm(), + keyboardType: TextInputType.number, + prefixIcon: Icon(Icons.chrome_reader_mode, + color: Color(0xFF40ACC9)), + padding: EdgeInsets.only( + top: 20, bottom: 20, left: 10, right: 10), + hintText: TranslationBase.of(context).nationalID, + )), Row( children: [ Expanded( @@ -226,9 +224,7 @@ class _Register extends State { cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => { ConfirmDialog.closeAlertDialog(context), - Navigator.of(context).pushNamed( - REGISTER, - ), + Navigator.of(context).push(FadePage(page: Register())), }, cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)}); dialog.showAlertDialog(context); @@ -312,16 +308,10 @@ class _Register extends State { { result = CheckUserStatusResponse.fromJson(result), sharedPref.setObject(NHIC_DATA, result), - Navigator.of(context).pushNamed( - CONFIRM_LOGIN, - ) - // Navigator.of(context).pushNamed( - // REGISTER_INFO, - // ) + Navigator.of(context).push(FadePage(page: ConfirmLogin())), } else {AppToast.showErrorToast(message: result)} - //this.onRegister(); }); } diff --git a/lib/pages/login/welcome.dart b/lib/pages/login/welcome.dart index 4b8e90ae..b2250f5c 100644 --- a/lib/pages/login/welcome.dart +++ b/lib/pages/login/welcome.dart @@ -1,9 +1,11 @@ import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/pages/login/login-type.dart'; +import 'package:diplomaticquarterapp/pages/login/register.dart'; import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:eva_icons_flutter/eva_icons_flutter.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -72,9 +74,8 @@ class _WelcomeLogin extends State { child: DefaultButton( TranslationBase.of(context).yes, () => { - Navigator.of(context).pushNamed( - LOGIN_TYPE, - ), + Navigator.of(context) + .push(FadePage(page: LoginType())), }, color: Color(0xFFc5272c), textColor: Colors.white, @@ -87,9 +88,8 @@ class _WelcomeLogin extends State { child: DefaultButton( TranslationBase.of(context).no, () => { - Navigator.of(context).pushNamed( - REGISTER, - ) + Navigator.of(context) + .push(FadePage(page: Register())), }, )) ], diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart index c7dd5d37..0d752e9f 100644 --- a/lib/pages/medical/balance/advance_payment_page.dart +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -214,14 +214,14 @@ class _AdvancePaymentPageState extends State { SizedBox( height: 12, ), - if(model.user!=null) - NewTextFields( - hintText: TranslationBase.of(context).depositorEmail, - initialValue: model.user.emailAddress, - onChanged: (value) { - email = value; - }, - ), + if (model.user != null) + NewTextFields( + hintText: TranslationBase.of(context).depositorEmail, + initialValue: model.user.emailAddress, + onChanged: (value) { + email = value; + }, + ), SizedBox( height: 12, ), @@ -243,7 +243,9 @@ class _AdvancePaymentPageState extends State { child: SecondaryButton( textColor: Colors.white, label: TranslationBase.of(context).submit, - disabled: amount.isEmpty || _fileTextController.text.isEmpty || _selectedHospital == null, + disabled: amount.isEmpty || + _fileTextController.text.isEmpty || + _selectedHospital == null, onTap: () { var mobileNum; var patientName; @@ -278,10 +280,8 @@ class _AdvancePaymentPageState extends State { if (model.state != ViewState.Error && model.state != ViewState.ErrorLocal) { Utils.hideKeyboard(context); - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => PaymentMethod())).then( + Navigator.push(context, FadePage(page: PaymentMethod())) + .then( (value) { Navigator.push( context, diff --git a/lib/pages/medical/prescriptions/PrescriptionIDeliveryAddressPage.dart b/lib/pages/medical/prescriptions/PrescriptionIDeliveryAddressPage.dart index 8574cc43..88234fe5 100644 --- a/lib/pages/medical/prescriptions/PrescriptionIDeliveryAddressPage.dart +++ b/lib/pages/medical/prescriptions/PrescriptionIDeliveryAddressPage.dart @@ -1,4 +1,6 @@ import 'dart:async'; + +import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; @@ -11,12 +13,12 @@ import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.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:geolocator/geolocator.dart'; import 'package:google_maps_flutter/google_maps_flutter.dart'; import 'package:provider/provider.dart'; -import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart'; import 'PrescriptionOrderOverveiw.dart'; @@ -24,7 +26,12 @@ class PrescriptionDeliveryAddressPage extends StatefulWidget { final Prescriptions prescriptions; final List prescriptionReportList; final List prescriptionReportEnhList; - const PrescriptionDeliveryAddressPage({Key key, this.prescriptions, this.prescriptionReportList, this.prescriptionReportEnhList}) + + const PrescriptionDeliveryAddressPage( + {Key key, + this.prescriptions, + this.prescriptionReportList, + this.prescriptionReportEnhList}) : super(key: key); @override @@ -37,7 +44,7 @@ class _PrescriptionDeliveryAddressPageState AddressInfo _selectedAddress; Completer _controller = Completer(); - CameraPosition _kGooglePlex = CameraPosition( + CameraPosition _kGooglePlex = CameraPosition( target: LatLng(24.665011045779107, 46.73502189439707), zoom: 14.4746, ); @@ -46,10 +53,11 @@ class _PrescriptionDeliveryAddressPageState double longitude = 0; @override - void initState(){ + void initState() { super.initState(); _getCurrentLocation(); } + _getCurrentLocation() async { await Geolocator.getLastKnownPosition().then((value) { latitude = value.latitude; @@ -63,6 +71,7 @@ class _PrescriptionDeliveryAddressPageState latitude = 46.73502189439707; }); } + @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -73,7 +82,7 @@ class _PrescriptionDeliveryAddressPageState appBarTitle: TranslationBase.of(context).shippingAddresss, baseViewModel: model, body: Container( - height: MediaQuery.of(context).size.height* 0.65, + height: MediaQuery.of(context).size.height * 0.65, child: SingleChildScrollView( physics: BouncingScrollPhysics(), child: Column( @@ -131,40 +140,54 @@ class _PrescriptionDeliveryAddressPageState ), ) : Padding( - padding: const EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, + padding: const EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: CrossAxisAlignment.start, children: [ Padding( padding: const EdgeInsets.all(8.0), child: Container( decoration: BoxDecoration( - border: Border.all(color: Colors.grey) - ), + border: Border.all(color: Colors.grey)), height: 200, child: GoogleMap( mapType: MapType.normal, markers: markers, initialCameraPosition: _kGooglePlex, - onMapCreated: (GoogleMapController controller) { + onMapCreated: + (GoogleMapController controller) { _controller.complete(controller); }, ), ), ), - SizedBox(height: 10,), - Texts(TranslationBase.of(context).shippingAddresss), - SizedBox(height: 10,), - Texts('${model.user.firstName} ${model.user.lastName}'), - SizedBox(height: 10,), + SizedBox( + height: 10, + ), + Texts( + TranslationBase.of(context).shippingAddresss), + SizedBox( + height: 10, + ), + Texts( + '${model.user.firstName} ${model.user.lastName}'), + SizedBox( + height: 10, + ), Texts(_selectedAddress.address1), - SizedBox(height: 10,), + SizedBox( + height: 10, + ), Texts(_selectedAddress.address2), - SizedBox(height: 10,), - Texts(_selectedAddress.city+" "+_selectedAddress.country), + SizedBox( + height: 10, + ), + Texts(_selectedAddress.city + + " " + + _selectedAddress.country), ], ), - ) + ) ], ), ), @@ -179,33 +202,43 @@ class _PrescriptionDeliveryAddressPageState Container( width: MediaQuery.of(context).size.width * 0.8, child: Button( - label: TranslationBase.of(context).addNewAddress.toUpperCase(), + label: + TranslationBase.of(context).addNewAddress.toUpperCase(), onTap: () { - Navigator.push(context, MaterialPageRoute(builder: (BuildContext context) => LocationPage(latitude: latitude, longitude: longitude,),), + Navigator.push( + context, + FadePage( + page: LocationPage( + latitude: latitude, + longitude: longitude, + )), ); - }, ), ), - Container( width: MediaQuery.of(context).size.width * 0.8, child: Button( - label: TranslationBase.of(context).continues.toUpperCase(), - disabled: _selectedAddress==null, - backgroundColor: _selectedAddress==null?Colors.green[300]: Colors.green[700], + label: + TranslationBase.of(context).continues.toUpperCase(), + disabled: _selectedAddress == null, + backgroundColor: _selectedAddress == null + ? Colors.green[300] + : Colors.green[700], onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (BuildContext context) => - PrescriptionOrderOverview(latitude: latitude, - longitude: longitude, - prescriptionReportEnhList: widget.prescriptionReportEnhList, - prescriptionReportList:widget.prescriptionReportList, - prescriptions: widget.prescriptions, - selectedAddress: _selectedAddress, - ), + FadePage( + page: PrescriptionOrderOverview( + latitude: latitude, + longitude: longitude, + prescriptionReportEnhList: + widget.prescriptionReportEnhList, + prescriptionReportList: + widget.prescriptionReportList, + prescriptions: widget.prescriptions, + selectedAddress: _selectedAddress, + ), ), ); }, @@ -216,8 +249,9 @@ class _PrescriptionDeliveryAddressPageState ); } - - void confirmSelectLocationDialog(List addresses,) { + void confirmSelectLocationDialog( + List addresses, + ) { showDialog( context: context, child: SelectLocationDialog( @@ -248,6 +282,7 @@ class _PrescriptionDeliveryAddressPageState ), ); } + String getAddressName() { if (_selectedAddress != null) return _selectedAddress.address1; diff --git a/lib/pages/parent_categorise_page.dart b/lib/pages/parent_categorise_page.dart index 3f33b611..46df3df7 100644 --- a/lib/pages/parent_categorise_page.dart +++ b/lib/pages/parent_categorise_page.dart @@ -7,20 +7,19 @@ import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/others/StarRating.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart'; -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:provider/provider.dart'; -import 'package:giffy_dialog/giffy_dialog.dart'; import 'base/base_view.dart'; -import 'final_products_page.dart'; class ParentCategorisePage extends StatefulWidget { String id; String titleName; + ParentCategorisePage({this.id, this.titleName}); + @override _ParentCategorisePageState createState() => _ParentCategorisePageState(id: id, titleName: titleName); @@ -29,7 +28,9 @@ class ParentCategorisePage extends StatefulWidget { class _ParentCategorisePageState extends State { String id; String titleName; + _ParentCategorisePageState({this.id, this.titleName}); + Map values = {'huusam': false, 'ali': false, 'noor': false}; bool checkedBrands = false; bool checkedCategorise = false; @@ -41,6 +42,7 @@ class _ParentCategorisePageState extends State { color: Colors.blue, size: 29.0, ); + @override Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); @@ -154,14 +156,20 @@ class _ParentCategorisePageState extends State { onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: - (context) => - SubCategorisePage( - title: model.categoriseParent[index].name, - id: model.categoriseParent[index].id, - parentId: id, - )), + FadePage( + page: + SubCategorisePage( + title: model + .categoriseParent[ + index] + .name, + id: model + .categoriseParent[ + index] + .id, + parentId: + id, + )), ); }, ), @@ -257,19 +265,15 @@ class _ParentCategorisePageState extends State { onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => - SubCategorisePage( - title: model - .categoriseParent[ - index] - .name, - id: model - .categoriseParent[ - index] - .id, - parentId: id, - )), + FadePage( + page: SubCategorisePage( + title: model + .categoriseParent[index] + .name, + id: model + .categoriseParent[index].id, + parentId: id, + )), ); print(id); }, diff --git a/lib/pages/pharmacies/medicine_search_screen.dart b/lib/pages/pharmacies/medicine_search_screen.dart index 7a61dabe..5c31f2de 100644 --- a/lib/pages/pharmacies/medicine_search_screen.dart +++ b/lib/pages/pharmacies/medicine_search_screen.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter/cupertino.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/pharmacies_model.dart'; @@ -121,8 +122,8 @@ class MedicineSearch extends StatelessWidget { onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => PharmaciesList( + FadePage( + page: PharmaciesList( medicineID: model.pharmacy[index].itemID, imageURL: model diff --git a/lib/pages/pharmacies/product-brands.dart b/lib/pages/pharmacies/product-brands.dart index b9e6db95..6dbfde46 100644 --- a/lib/pages/pharmacies/product-brands.dart +++ b/lib/pages/pharmacies/product-brands.dart @@ -1,14 +1,12 @@ -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/pages/login/register-info.dart'; +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/brand_view_model.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/search_brands_page.dart'; -import 'package:diplomaticquarterapp/pages/search_products_page.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; -import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; -import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/brand_view_model.dart'; -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/material.dart'; class ProductBrandsPage extends StatefulWidget { @override @@ -16,8 +14,8 @@ class ProductBrandsPage extends StatefulWidget { } var languageID; -class _ProductBrandsPageState extends State { +class _ProductBrandsPageState extends State { @override void initState() { super.initState(); @@ -38,18 +36,11 @@ class _ProductBrandsPageState extends State { children: [ Container( color: Colors.white, - alignment: languageID == 'ar'? - Alignment.topRight : - Alignment.topLeft, - padding: languageID == 'ar' ? - EdgeInsets.only( - right: 10.0, - top: 10.0 - ): - EdgeInsets.only( - left: 10.0, - top: 10.0 - ), + alignment: + languageID == 'ar' ? Alignment.topRight : Alignment.topLeft, + padding: languageID == 'ar' + ? EdgeInsets.only(right: 10.0, top: 10.0) + : EdgeInsets.only(left: 10.0, top: 10.0), child: Text( TranslationBase.of(context).topBrands, style: TextStyle( @@ -93,8 +84,7 @@ class _ProductBrandsPageState extends State { onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => SearchBrandsPage()), + FadePage(page: SearchBrandsPage()), ); }, ), @@ -116,7 +106,9 @@ class _ProductBrandsPageState extends State { crossAxisAlignment: CrossAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start, children: [ - languageID == 'ar' ? Text(model.brandsListList[index].namen):Text(model.brandsListList[index].name), + languageID == 'ar' + ? Text(model.brandsListList[index].namen) + : Text(model.brandsListList[index].name), SizedBox( height: 3, ), @@ -124,7 +116,7 @@ class _ProductBrandsPageState extends State { ], ), ), - onTap: (){ + onTap: () { print("ENAD"); }, ); @@ -138,7 +130,6 @@ class _ProductBrandsPageState extends State { } } - topBrand() { return BaseView( onModelReady: (model) => model.getTopBrandsData(), @@ -156,30 +147,32 @@ topBrand() { child: Container( // padding: EdgeInsets.only(left: 5), child: Container( - padding: EdgeInsets.symmetric( - horizontal: 10.0, vertical: 10.0), - decoration: BoxDecoration( - borderRadius: BorderRadius.circular(10), - border: Border( - top: BorderSide(width: 1.0, color: Colors.grey), - left: BorderSide(width: 1.0, color: Colors.grey), - right: BorderSide(width: 1.0, color: Colors.grey), - bottom: BorderSide(width: 1.0, color: Colors.grey), + padding: EdgeInsets.symmetric( + horizontal: 10.0, vertical: 10.0), + decoration: BoxDecoration( + borderRadius: BorderRadius.circular(10), + border: Border( + top: BorderSide(width: 1.0, color: Colors.grey), + left: BorderSide(width: 1.0, color: Colors.grey), + right: BorderSide(width: 1.0, color: Colors.grey), + bottom: + BorderSide(width: 1.0, color: Colors.grey), + ), + color: Colors.white, ), - color: Colors.white, - ), - child: model.topBrandsListList[index].image != null ?Image.network( - model.topBrandsListList[index].image.src, - fit: BoxFit.cover, - width: 60, - height: 40, - ): Text(model.topBrandsListList[index].name) - ), + child: model.topBrandsListList[index].image != null + ? Image.network( + model.topBrandsListList[index].image.src, + fit: BoxFit.cover, + width: 60, + height: 40, + ) + : Text(model.topBrandsListList[index].name)), ), ), ), ), - onTap: (){ + onTap: () { print("ENAD"); }, ), diff --git a/lib/pages/pharmacies/product_detail.dart b/lib/pages/pharmacies/product_detail.dart index 8388926e..7df95d5b 100644 --- a/lib/pages/pharmacies/product_detail.dart +++ b/lib/pages/pharmacies/product_detail.dart @@ -5,6 +5,7 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/login/welcome.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scafold_detail_page.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; @@ -1452,8 +1453,8 @@ class _footerWidgetState extends State { addToCartFunction(price, widget.item.id); Navigator.push( context, - MaterialPageRoute( - builder: (context) => CartOrderPage()), + FadePage(page: + CartOrderPage()), ); }, child: Container( diff --git a/lib/pages/pharmacies/screens/pharmacy_module_page.dart b/lib/pages/pharmacies/screens/pharmacy_module_page.dart index a0996522..394b516b 100644 --- a/lib/pages/pharmacies/screens/pharmacy_module_page.dart +++ b/lib/pages/pharmacies/screens/pharmacy_module_page.dart @@ -4,7 +4,7 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/landing/home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/pages/offers_categorise_page.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart'; +import 'package:diplomaticquarterapp/pages/pharmacies/product-brands.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-main-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/BannerPager.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/widgets/ProductTileItem.dart'; @@ -16,14 +16,10 @@ 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/material.dart'; -import 'package:flutter_svg/svg.dart'; import 'package:rating_bar/rating_bar.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/product-brands.dart'; import '../../final_products_page.dart'; import 'lacum-activitaion-vida-page.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/medical/doctor_card.dart'; -import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; class PharmacyPage extends StatelessWidget { @override @@ -69,10 +65,7 @@ class PharmacyPage extends StatelessWidget { hPadding: 4, handler: () { Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - HomePrescriptionsPage())); + context, FadePage(page: HomePrescriptionsPage())); }, ), ], @@ -296,7 +289,6 @@ class PharmacyPage extends StatelessWidget { itemCount: model.bestSellerProduct.length, ), ), - Container( margin: EdgeInsets.fromLTRB(10, 10, 10, 0), child: Row( @@ -349,8 +341,8 @@ class PharmacyPage extends StatelessWidget { handler: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => FinalProductsPage( + FadePage( + page: FinalProductsPage( id: "", productType: 3, ), @@ -391,8 +383,8 @@ class PharmacyPage extends StatelessWidget { handler: () => { Navigator.push( context, - MaterialPageRoute( - builder: (context) => FinalProductsPage( + FadePage( + page: FinalProductsPage( id: "", productType: 4, ), diff --git a/lib/pages/pharmacies/widgets/manufacturerItem.dart b/lib/pages/pharmacies/widgets/manufacturerItem.dart index 3ccf2313..574c37c5 100644 --- a/lib/pages/pharmacies/widgets/manufacturerItem.dart +++ b/lib/pages/pharmacies/widgets/manufacturerItem.dart @@ -1,4 +1,5 @@ import 'package:diplomaticquarterapp/core/model/pharmacies/Manufacturer.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import '../../final_products_page.dart'; @@ -14,9 +15,10 @@ class ManufacturerItem extends StatelessWidget { onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => FinalProductsPage( - id: item.id, productType: 2, + FadePage( + page: FinalProductsPage( + id: item.id, + productType: 2, ), ), ); diff --git a/lib/pages/pharmacy/order/Order.dart b/lib/pages/pharmacy/order/Order.dart index 4ef14389..6488b421 100644 --- a/lib/pages/pharmacy/order/Order.dart +++ b/lib/pages/pharmacy/order/Order.dart @@ -1,21 +1,17 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/model/pharmacies/orders_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; -import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; +import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:diplomaticquarterapp/services/pharmacy_services/order_service.dart'; -import 'package:diplomaticquarterapp/pages/pharmacy/order/OrderDetails.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/orders_model.dart'; -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; dynamic languageID; -class OrderPage extends StatefulWidget { +class OrderPage extends StatefulWidget { // orderList({this.customerId, this.pageId}); String customerID; @@ -26,19 +22,22 @@ class OrderPage extends StatefulWidget { _OrderPageState createState() => _OrderPageState(); } -class _OrderPageState extends State with SingleTickerProviderStateMixin{ - - String pageID= "1"; +class _OrderPageState extends State + with SingleTickerProviderStateMixin { + String pageID = "1"; String customerId = ""; - String order =""; + String order = ""; - List orderList = [] ; - List deliveredOrderList = [] ; - List processingOrderList = []; - List cancelledOrderList = []; - List pendingOrderList = []; + List orderList = []; + + List deliveredOrderList = []; + + List processingOrderList = []; + List cancelledOrderList = []; + List pendingOrderList = []; TabController _tabController; + // AppSharedPreferences sharedPref = AppSharedPreferences(); getLanguageID() async { languageID = await sharedPref.getString(APP_LANGUAGE); @@ -49,28 +48,29 @@ class _OrderPageState extends State with SingleTickerProviderStateMix getLanguageID(); super.initState(); - - _tabController = new TabController(length: 4, vsync: this,); + _tabController = new TabController( + length: 4, + vsync: this, + ); } @override Widget build(BuildContext context) { - print( "customerID" + widget.customerID); + print("customerID" + widget.customerID); return BaseView( onModelReady: (model) => model.getOrder(widget.customerID, pageID), - builder: (_,model, wi )=> AppScaffold( - appBarTitle:TranslationBase.of(context).order, + builder: (_, model, wi) => AppScaffold( + appBarTitle: TranslationBase.of(context).order, baseViewModel: model, - isShowAppBar: true, - isPharmacy:true , + isShowAppBar: true, + isPharmacy: true, body: Container( child: Column( children: [ TabBar( - labelPadding: - EdgeInsets.only(left: 3.0, right: 3.0), + labelPadding: EdgeInsets.only(left: 3.0, right: 3.0), tabs: [ - Tab(text: TranslationBase.of(context).delivered), + Tab(text: TranslationBase.of(context).delivered), Tab(text: TranslationBase.of(context).processing), Tab(text: TranslationBase.of(context).pending), Tab(text: TranslationBase.of(context).cancelled), @@ -103,226 +103,277 @@ class _OrderPageState extends State with SingleTickerProviderStateMix ); } - - - Widget getDeliveredOrder(OrderModelViewModel model){ - for(int i=0 ; i< model.orders.length; i++){ - if( model.orders[i].orderStatusId == 30 || model.orders[i].orderStatusId == 997 - || model.orders[i].orderStatusId == 994 - ){ + Widget getDeliveredOrder(OrderModelViewModel model) { + for (int i = 0; i < model.orders.length; i++) { + if (model.orders[i].orderStatusId == 30 || + model.orders[i].orderStatusId == 997 || + model.orders[i].orderStatusId == 994) { deliveredOrderList.add(model.orders[i]); } } return Container( width: MediaQuery.of(context).size.width, child: model.orders.length != 0 - ? SingleChildScrollView( - child: Column( - children: [ - ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: deliveredOrderList.length, - itemBuilder: (context, index){ - return Container( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - margin: EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5), - child: Text(TranslationBase.of(context).orderNumber, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - Container( - child: Text(deliveredOrderList[index].id.toString(), - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), + ? SingleChildScrollView( + child: Column( + children: [ + ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: deliveredOrderList.length, + itemBuilder: (context, index) { + return Container( + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Container( + margin: EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + margin: EdgeInsets.only(right: 5), + child: Text( + TranslationBase.of(context) + .orderNumber, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ), + Container( + child: Text( + deliveredOrderList[index] + .id + .toString(), + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ), + ], ), - ), - ], - ), - SizedBox( - height: 5,), - Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5), - child: Text(TranslationBase.of(context).orderDate, - style: TextStyle(fontSize: 14.0, - ), + SizedBox( + height: 5, ), - ), - Container( - child: Text(deliveredOrderList[index].createdOnUtc.toString().substring(0,10), - style: TextStyle(fontSize: 14.0, - ), + Row( + children: [ + Container( + margin: EdgeInsets.only(right: 5), + child: Text( + TranslationBase.of(context) + .orderDate, + style: TextStyle( + fontSize: 14.0, + ), + ), + ), + Container( + child: Text( + deliveredOrderList[index] + .createdOnUtc + .toString() + .substring(0, 10), + style: TextStyle( + fontSize: 14.0, + ), + ), + ), + ], ), + ], + ), + ), + Container( + margin: EdgeInsets.all(8.0), + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: OrderDetailsPage( + orderModel: + deliveredOrderList[ + index]), + )); + }, + child: SvgPicture.asset( + languageID == "ar" + ? 'assets/images/pharmacy/arrow_left.svg' + : 'assets/images/pharmacy/arrow_right.svg', + height: 20, + width: 20, ), - ], + ), ), ], ), - ), - Container( - margin: EdgeInsets.all(8.0), - child: InkWell( - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel: deliveredOrderList[index]),)); - }, - child: SvgPicture.asset( - languageID == "ar" - ? 'assets/images/pharmacy/arrow_left.svg' - :'assets/images/pharmacy/arrow_right.svg', - height: 20, - width: 20,), + Divider( + color: Colors.grey[350], + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, ), - ), - ], - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), - padding: EdgeInsets.only(left: 13.0, right: 13.0), - decoration: BoxDecoration( - border: Border.all( - color: Colors.blue[700], - style: BorderStyle.solid, - width: 5.0, - ), - color: Colors.blue[700], - borderRadius: BorderRadius.circular(30.0) - ), - child: deliveredOrderList[index].orderStatusId == 30 - ? Text( + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Container( + margin: EdgeInsets.only( + left: 8, right: 8, top: 1, bottom: 8), + padding: EdgeInsets.only( + left: 13.0, right: 13.0), + decoration: BoxDecoration( + border: Border.all( + color: Colors.blue[700], + style: BorderStyle.solid, + width: 5.0, + ), + color: Colors.blue[700], + borderRadius: + BorderRadius.circular(30.0)), + child: deliveredOrderList[index] + .orderStatusId == + 30 + ? Text( // deliveredOrderList[0].orderStatus.toString().substring(12), - TranslationBase.of(context).deliveredOrder, - style: TextStyle( - color: Colors.white, - fontSize: 15.0, - fontWeight: FontWeight.bold, - ), - ) - : Text( - languageID == "ar" - ? deliveredOrderList[index].orderStatusn.toString(): - deliveredOrderList[index].orderStatus.toString(), - style: TextStyle( - color: Colors.white, - fontSize: 15.0, - fontWeight: FontWeight.bold, - ), - ) - ), - Container( - margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), - child: Column( + TranslationBase.of(context) + .deliveredOrder, + style: TextStyle( + color: Colors.white, + fontSize: 15.0, + fontWeight: FontWeight.bold, + ), + ) + : Text( + languageID == "ar" + ? deliveredOrderList[index] + .orderStatusn + .toString() + : deliveredOrderList[index] + .orderStatus + .toString(), + style: TextStyle( + color: Colors.white, + fontSize: 15.0, + fontWeight: FontWeight.bold, + ), + )), + Container( + margin: EdgeInsets.only( + left: 8, right: 8, top: 1, bottom: 8), + child: Column( // crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Row( - children: [ - Container( - margin: EdgeInsets.only(left: 5), - child: Text(deliveredOrderList[index].orderTotal.toString(), - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - Container( - margin: EdgeInsets.only(left: 5), - child: Text(TranslationBase.of(context).sar, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), + children: [ + Row( + children: [ + Container( + margin: EdgeInsets.only(left: 5), + child: Text( + deliveredOrderList[index] + .orderTotal + .toString(), + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ), + Container( + margin: EdgeInsets.only(left: 5), + child: Text( + TranslationBase.of(context).sar, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ), + ], ), - ), - ], - ), - SizedBox( - height: 5,), - Row( - children: [ - Container( - child: Text(deliveredOrderList[index].productCount.toString(), - style: TextStyle(fontSize: 14.0, - ), + SizedBox( + height: 5, ), - ), - Container( - margin: EdgeInsets.only(left: 5), - child: Text(TranslationBase.of(context).itemsNo, - style: TextStyle(fontSize: 14.0, - ), + Row( + children: [ + Container( + child: Text( + deliveredOrderList[index] + .productCount + .toString(), + style: TextStyle( + fontSize: 14.0, + ), + ), + ), + Container( + margin: EdgeInsets.only(left: 5), + child: Text( + TranslationBase.of(context) + .itemsNo, + style: TextStyle( + fontSize: 14.0, + ), + ), + ), + ], ), - ), - ], + ], + ), ), ], ), - ), - ], - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 8, - indent: 0, - endIndent: 0, - ), - ], - ), - ); - } + Divider( + color: Colors.grey[350], + height: 20, + thickness: 8, + indent: 0, + endIndent: 0, + ), + ], + ), + ); + }) + ], + ), ) - ], - ), - ) : Container( - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/empty_box.svg'), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Text(TranslationBase.of(context).noOrder, - style: TextStyle( - fontSize: 16.0, - )), + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SvgPicture.asset('assets/images/pharmacy/empty_box.svg'), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text(TranslationBase.of(context).noOrder, + style: TextStyle( + fontSize: 16.0, + )), + ), + ], + ), ), - ], - ), - ), - ), + ), ); } - Widget getProcessingOrder(OrderModelViewModel model){ - for(int i=0 ; i< model.orders.length; i++){ - if( model.orders[i].orderStatusId == 20 || model.orders[i].orderStatusId == 995 || - model.orders[i].orderStatusId == 998 || model.orders[i].orderStatusId == 999){ + Widget getProcessingOrder(OrderModelViewModel model) { + for (int i = 0; i < model.orders.length; i++) { + if (model.orders[i].orderStatusId == 20 || + model.orders[i].orderStatusId == 995 || + model.orders[i].orderStatusId == 998 || + model.orders[i].orderStatusId == 999) { processingOrderList.add(model.orders[i]); } } @@ -330,206 +381,255 @@ class _OrderPageState extends State with SingleTickerProviderStateMix width: MediaQuery.of(context).size.width, child: model.orders.length != 0 ? SingleChildScrollView( - child: Column( - children: [ - ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: processingOrderList.length, - itemBuilder: (context, index){ - return Container( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - margin: EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5), - child: Text(TranslationBase.of(context).orderNumber, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - Container( - child: Text(processingOrderList[index].id.toString(), - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), + child: Column( + children: [ + ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: processingOrderList.length, + itemBuilder: (context, index) { + return Container( + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Container( + margin: EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + margin: EdgeInsets.only(right: 5), + child: Text( + TranslationBase.of(context) + .orderNumber, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ), + Container( + child: Text( + processingOrderList[index] + .id + .toString(), + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ), + ], ), - ), - ], - ), - SizedBox( - height: 5,), - Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5), - child: Text(TranslationBase.of(context).orderDate, - style: TextStyle(fontSize: 14.0, - ), + SizedBox( + height: 5, ), - ), - Container( - child: Text(processingOrderList[index].createdOnUtc.toString().substring(0,10), - style: TextStyle(fontSize: 14.0, - ), + Row( + children: [ + Container( + margin: EdgeInsets.only(right: 5), + child: Text( + TranslationBase.of(context) + .orderDate, + style: TextStyle( + fontSize: 14.0, + ), + ), + ), + Container( + child: Text( + processingOrderList[index] + .createdOnUtc + .toString() + .substring(0, 10), + style: TextStyle( + fontSize: 14.0, + ), + ), + ), + ], ), + ], + ), + ), + Container( + margin: EdgeInsets.all(8.0), + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: OrderDetailsPage( + orderModel: + processingOrderList[ + index]))); + }, + child: SvgPicture.asset( + languageID == "ar" + ? 'assets/images/pharmacy/arrow_left.svg' + : 'assets/images/pharmacy/arrow_right.svg', + height: 20, + width: 20, ), - ], + ), ), ], ), - ), - Container( - margin: EdgeInsets.all(8.0), - child: InkWell( - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel :processingOrderList[index]))); - - }, - child: SvgPicture.asset( - languageID == "ar" - ? 'assets/images/pharmacy/arrow_left.svg' - :'assets/images/pharmacy/arrow_right.svg', - height: 20, - width: 20,), - ), - ), - ], - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), - padding: EdgeInsets.only(left: 13.0, right: 13.0), - decoration: BoxDecoration( - border: Border.all( - color: Colors.green, - style: BorderStyle.solid, - width: 5.0, - ), - color: Colors.green, - borderRadius: BorderRadius.circular(30.0) + Divider( + color: Colors.grey[350], + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, ), - child: processingOrderList[index].orderStatusId == 20 - ? Text( + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Container( + margin: EdgeInsets.only( + left: 8, right: 8, top: 1, bottom: 8), + padding: EdgeInsets.only( + left: 13.0, right: 13.0), + decoration: BoxDecoration( + border: Border.all( + color: Colors.green, + style: BorderStyle.solid, + width: 5.0, + ), + color: Colors.green, + borderRadius: + BorderRadius.circular(30.0)), + child: processingOrderList[index] + .orderStatusId == + 20 + ? Text( // deliveredOrderList[0].orderStatus.toString().substring(12), - TranslationBase.of(context).processingOrder, - style: TextStyle( - color: Colors.white, - fontSize: 15.0, - fontWeight: FontWeight.bold, - ), - ) - : Text( - languageID == "ar" - ? processingOrderList[index].orderStatusn.toString(): - processingOrderList[index].orderStatus.toString(), - style: TextStyle( - color: Colors.white, - fontSize: 15.0, - fontWeight: FontWeight.bold, - ), - ) - ), - Container( - margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), - child: Column( + TranslationBase.of(context) + .processingOrder, + style: TextStyle( + color: Colors.white, + fontSize: 15.0, + fontWeight: FontWeight.bold, + ), + ) + : Text( + languageID == "ar" + ? processingOrderList[index] + .orderStatusn + .toString() + : processingOrderList[index] + .orderStatus + .toString(), + style: TextStyle( + color: Colors.white, + fontSize: 15.0, + fontWeight: FontWeight.bold, + ), + )), + Container( + margin: EdgeInsets.only( + left: 8, right: 8, top: 1, bottom: 8), + child: Column( // crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Row( - children: [ - Container( - margin: EdgeInsets.only(left: 5), - child: Text(processingOrderList[index].orderTotal.toString(), - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - Container( - margin: EdgeInsets.only(left: 5), - child: Text(TranslationBase.of(context).sar, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), + children: [ + Row( + children: [ + Container( + margin: EdgeInsets.only(left: 5), + child: Text( + processingOrderList[index] + .orderTotal + .toString(), + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ), + Container( + margin: EdgeInsets.only(left: 5), + child: Text( + TranslationBase.of(context).sar, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ), + ], ), - ), - ], - ), - SizedBox( - height: 5,), - Row( - children: [ - Container( - child: Text(processingOrderList[index].productCount.toString(), - style: TextStyle(fontSize: 14.0, - ), + SizedBox( + height: 5, ), - ), - Container( - margin: EdgeInsets.only(left: 5), - child: Text(TranslationBase.of(context).itemsNo, - style: TextStyle(fontSize: 14.0, - ), + Row( + children: [ + Container( + child: Text( + processingOrderList[index] + .productCount + .toString(), + style: TextStyle( + fontSize: 14.0, + ), + ), + ), + Container( + margin: EdgeInsets.only(left: 5), + child: Text( + TranslationBase.of(context) + .itemsNo, + style: TextStyle( + fontSize: 14.0, + ), + ), + ), + ], ), - ), - ], + ], + ), ), ], ), - ), - ], - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 8, - indent: 0, - endIndent: 0, - ), - ], - ), - ); - } + Divider( + color: Colors.grey[350], + height: 20, + thickness: 8, + indent: 0, + endIndent: 0, + ), + ], + ), + ); + }) + ], + ), ) - ], - ), - ) : Container( - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/empty_box.svg'), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Text(TranslationBase.of(context).noOrder, - style: TextStyle( - fontSize: 16.0, - )), + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SvgPicture.asset('assets/images/pharmacy/empty_box.svg'), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text(TranslationBase.of(context).noOrder, + style: TextStyle( + fontSize: 16.0, + )), + ), + ], + ), ), - ], - ), - ), - ), + ), ); // return Container( // child: model.order.length != 0 @@ -589,7 +689,7 @@ class _OrderPageState extends State with SingleTickerProviderStateMix // child: InkWell( // onTap: () { // Navigator.push(context, -// MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:processingOrderList[0]))); +// FadePage(page: OrderDetailsPage(orderModel:processingOrderList[0]))); // }, // child: SvgPicture.asset( // 'assets/images/pharmacy/arrow_right.svg', @@ -712,447 +812,552 @@ class _OrderPageState extends State with SingleTickerProviderStateMix // ); } - Widget getPendingOrder(OrderModelViewModel model){ - for(int i=0 ; i< model.orders.length; i++){ - if( model.orders[i].orderStatusId == 10){ + Widget getPendingOrder(OrderModelViewModel model) { + for (int i = 0; i < model.orders.length; i++) { + if (model.orders[i].orderStatusId == 10) { pendingOrderList.add(model.orders[i]); } } return Container( child: model.orders.length != 0 - ? SingleChildScrollView( - child: Column( - children: [ - ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: pendingOrderList.length , - itemBuilder: (context, index){ - return Container( - child: SingleChildScrollView( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - margin: EdgeInsets.all(8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5), - child: Text(TranslationBase.of(context).orderNumber, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), + ? SingleChildScrollView( + child: Column( + children: [ + ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: pendingOrderList.length, + itemBuilder: (context, index) { + return Container( + child: SingleChildScrollView( + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Container( + margin: EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + margin: + EdgeInsets.only(right: 5), + child: Text( + TranslationBase.of(context) + .orderNumber, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ), + Container( + child: Text( + pendingOrderList[index] + .id + .toString(), + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ), + ], ), - ), - Container( - child: Text(pendingOrderList[index].id.toString(), - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), + SizedBox( + height: 5, ), - ), - ], - ), - SizedBox( - height: 5,), - Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5), - child: Text(TranslationBase.of(context).orderDate, - style: TextStyle(fontSize: 14.0, - ), - ), - ), - Container( - child: Text(pendingOrderList[index].createdOnUtc.toString().substring(0,10), - style: TextStyle(fontSize: 14.0, - ), + Row( + children: [ + Container( + margin: + EdgeInsets.only(right: 5), + child: Text( + TranslationBase.of(context) + .orderDate, + style: TextStyle( + fontSize: 14.0, + ), + ), + ), + Container( + child: Text( + pendingOrderList[index] + .createdOnUtc + .toString() + .substring(0, 10), + style: TextStyle( + fontSize: 14.0, + ), + ), + ), + ], ), + ], + ), + ), + Container( + margin: EdgeInsets.all(8.0), + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: OrderDetailsPage( + orderModel: + pendingOrderList[ + index]))); + }, + child: SvgPicture.asset( + languageID == "ar" + ? 'assets/images/pharmacy/arrow_left.svg' + : 'assets/images/pharmacy/arrow_right.svg', + height: 20, + width: 20, ), - ], + ), ), ], ), - ), - Container( - margin: EdgeInsets.all( 8.0), - child: InkWell( - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel:pendingOrderList[index]))); - - }, - child: SvgPicture.asset( - languageID == "ar" - ? 'assets/images/pharmacy/arrow_left.svg' - :'assets/images/pharmacy/arrow_right.svg', - height: 20, - width: 20,), - ), - ), - ], - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - margin: EdgeInsets.all(8.0), - padding: EdgeInsets.only(left: 13.0, right: 13.0), - decoration: BoxDecoration( - border: Border.all( - color: Colors.orange[300], - style: BorderStyle.solid, - width: 5.0, - ), - color: Colors.orange[300], - borderRadius: BorderRadius.circular(30.0) + Divider( + color: Colors.grey[350], + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, ), - child: pendingOrderList[index].orderStatusId == 10 - ? Text( + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Container( + margin: EdgeInsets.all(8.0), + padding: EdgeInsets.only( + left: 13.0, right: 13.0), + decoration: BoxDecoration( + border: Border.all( + color: Colors.orange[300], + style: BorderStyle.solid, + width: 5.0, + ), + color: Colors.orange[300], + borderRadius: + BorderRadius.circular(30.0)), + child: pendingOrderList[index] + .orderStatusId == + 10 + ? Text( // deliveredOrderList[0].orderStatus.toString().substring(12), - TranslationBase.of(context).pendingOrder, - style: TextStyle( - color: Colors.white, - fontSize: 15.0, - fontWeight: FontWeight.bold, - ), - ) - : Text( - languageID == "ar" - ? pendingOrderList[index].orderStatusn.toString(): - pendingOrderList[index].orderStatus.toString(), - style: TextStyle( - color: Colors.white, - fontSize: 15.0, - fontWeight: FontWeight.bold, - ), - ) - ), - Container( - margin: EdgeInsets.all(8.0), - child: Column( + TranslationBase.of(context) + .pendingOrder, + style: TextStyle( + color: Colors.white, + fontSize: 15.0, + fontWeight: FontWeight.bold, + ), + ) + : Text( + languageID == "ar" + ? pendingOrderList[index] + .orderStatusn + .toString() + : pendingOrderList[index] + .orderStatus + .toString(), + style: TextStyle( + color: Colors.white, + fontSize: 15.0, + fontWeight: FontWeight.bold, + ), + )), + Container( + margin: EdgeInsets.all(8.0), + child: Column( // crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Row( - children: [ - Container( - margin: EdgeInsets.only(left: 5), - child: Text(pendingOrderList[index].orderTotal.toString(), - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), + children: [ + Row( + children: [ + Container( + margin: + EdgeInsets.only(left: 5), + child: Text( + pendingOrderList[index] + .orderTotal + .toString(), + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ), + Container( + margin: + EdgeInsets.only(left: 5), + child: Text( + TranslationBase.of(context) + .sar, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ), + ], ), - ), - Container( - margin: EdgeInsets.only(left: 5), - child: Text(TranslationBase.of(context).sar, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), + SizedBox( + height: 5, ), - ), - ], - ), - SizedBox( - height: 5,), - Row( - children: [ - Container( - child: Text(pendingOrderList[index].productCount.toString(), - style: TextStyle(fontSize: 14.0, - ), - ), - ), - Container( - margin: EdgeInsets.only(left: 5), - child: Text(TranslationBase.of(context).itemsNo, - style: TextStyle(fontSize: 14.0, - ), + Row( + children: [ + Container( + child: Text( + pendingOrderList[index] + .productCount + .toString(), + style: TextStyle( + fontSize: 14.0, + ), + ), + ), + Container( + margin: + EdgeInsets.only(left: 5), + child: Text( + TranslationBase.of(context) + .itemsNo, + style: TextStyle( + fontSize: 14.0, + ), + ), + ), + ], ), - ), - ], + ], + ), ), ], ), - ), - ], - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 8, - indent: 0, - endIndent: 0, + Divider( + color: Colors.grey[350], + height: 20, + thickness: 8, + indent: 0, + endIndent: 0, + ), + ], + ), ), - ], - ), - ), - - ); - } + ); + }) + ], + ), ) - ], - ), - ) : Container( - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/empty_box.svg'), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Text(TranslationBase.of(context).noOrder, - style: TextStyle( - fontSize: 16.0, - )), + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SvgPicture.asset('assets/images/pharmacy/empty_box.svg'), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text(TranslationBase.of(context).noOrder, + style: TextStyle( + fontSize: 16.0, + )), + ), + ], + ), ), - ], - ), - ), - ), - + ), ); } - Widget getCancelledOrder(OrderModelViewModel model){ - for(int i=0 ; i< model.orders.length; i++){ - if( model.orders[i].orderStatusId == 40 || model.orders[i].orderStatus == 996 - || model.orders[i].orderStatusId == 200){ + Widget getCancelledOrder(OrderModelViewModel model) { + for (int i = 0; i < model.orders.length; i++) { + if (model.orders[i].orderStatusId == 40 || + model.orders[i].orderStatus == 996 || + model.orders[i].orderStatusId == 200) { cancelledOrderList.add(model.orders[i]); } } return Container( child: model.orders.length != 0 - ? SingleChildScrollView( - child: Column( - children: [ - ListView.builder( - scrollDirection: Axis.vertical, - shrinkWrap: true, - physics: ScrollPhysics(), - itemCount: cancelledOrderList.length, - itemBuilder: (context, index){ - return Container( - child: SingleChildScrollView( - child: Column( - children: [ - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - margin: EdgeInsets.all( 8.0), - child: Column( - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5), - child: Text(TranslationBase.of(context).orderNumber, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), + ? SingleChildScrollView( + child: Column( + children: [ + ListView.builder( + scrollDirection: Axis.vertical, + shrinkWrap: true, + physics: ScrollPhysics(), + itemCount: cancelledOrderList.length, + itemBuilder: (context, index) { + return Container( + child: SingleChildScrollView( + child: Column( + children: [ + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Container( + margin: EdgeInsets.all(8.0), + child: Column( + crossAxisAlignment: + CrossAxisAlignment.start, + children: [ + Row( + children: [ + Container( + margin: + EdgeInsets.only(right: 5), + child: Text( + TranslationBase.of(context) + .orderNumber, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ), + Container( + child: Text( + cancelledOrderList[index] + .id + .toString(), + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ), + ], ), - ), - Container( - child: Text(cancelledOrderList[index].id.toString(), - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), + SizedBox( + height: 5, ), - ), - ], - ), - SizedBox( - height: 5,), - Row( - children: [ - Container( - margin: EdgeInsets.only(right: 5), - child: Text(TranslationBase.of(context).orderDate, - style: TextStyle(fontSize: 14.0, - ), - ), - ), - Container( - child: Text(cancelledOrderList[index].createdOnUtc.toString().substring(0,10), - style: TextStyle(fontSize: 14.0, - ), + Row( + children: [ + Container( + margin: + EdgeInsets.only(right: 5), + child: Text( + TranslationBase.of(context) + .orderDate, + style: TextStyle( + fontSize: 14.0, + ), + ), + ), + Container( + child: Text( + cancelledOrderList[index] + .createdOnUtc + .toString() + .substring(0, 10), + style: TextStyle( + fontSize: 14.0, + ), + ), + ), + ], ), + ], + ), + ), + Container( + margin: EdgeInsets.all(8.0), + child: InkWell( + onTap: () { + Navigator.push( + context, + FadePage( + page: OrderDetailsPage( + orderModel: + cancelledOrderList[ + index]))); + }, + child: SvgPicture.asset( + languageID == "ar" + ? 'assets/images/pharmacy/arrow_left.svg' + : 'assets/images/pharmacy/arrow_right.svg', + height: 20, + width: 20, ), - ], + ), ), ], ), - ), - Container( - margin: EdgeInsets.all(8.0), - child: InkWell( - onTap: () { - Navigator.push(context, - MaterialPageRoute(builder: (context) => OrderDetailsPage(orderModel: cancelledOrderList[index]))); - - }, - child: SvgPicture.asset( - languageID == "ar" - ? 'assets/images/pharmacy/arrow_left.svg' - :'assets/images/pharmacy/arrow_right.svg', - height: 20, - width: 20,), - ), - ), - ], - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 1, - indent: 0, - endIndent: 0, - ), - Row( - mainAxisAlignment: MainAxisAlignment.spaceBetween, - children: [ - Container( - margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), - padding: EdgeInsets.only(left: 10.0, right: 10.0), - decoration: BoxDecoration( - border: Border.all( - color: Colors.red[900], - style: BorderStyle.solid, - width: 5.0, - ), - color: Colors.red[900], - borderRadius: BorderRadius.circular(30.0) + Divider( + color: Colors.grey[350], + height: 20, + thickness: 1, + indent: 0, + endIndent: 0, ), - child: cancelledOrderList[index].orderStatusId == 40 - ? Text( + Row( + mainAxisAlignment: + MainAxisAlignment.spaceBetween, + children: [ + Container( + margin: EdgeInsets.only( + left: 8, + right: 8, + top: 1, + bottom: 8), + padding: EdgeInsets.only( + left: 10.0, right: 10.0), + decoration: BoxDecoration( + border: Border.all( + color: Colors.red[900], + style: BorderStyle.solid, + width: 5.0, + ), + color: Colors.red[900], + borderRadius: + BorderRadius.circular(30.0)), + child: cancelledOrderList[index] + .orderStatusId == + 40 + ? Text( // deliveredOrderList[0].orderStatus.toString().substring(12), - TranslationBase.of(context).cancelledOrder, - style: TextStyle( - color: Colors.white, - fontSize: 15.0, - fontWeight: FontWeight.bold, - ), - ) - : Text( - languageID == "ar" - ? cancelledOrderList[index].orderStatusn.toString(): - cancelledOrderList[index].orderStatus.toString(), - style: TextStyle( - color: Colors.white, - fontSize: 15.0, - fontWeight: FontWeight.bold, - ), - ) - ), - Container( - margin: EdgeInsets.only(left: 8, right: 8, top: 1, bottom: 8), - child: Column( + TranslationBase.of(context) + .cancelledOrder, + style: TextStyle( + color: Colors.white, + fontSize: 15.0, + fontWeight: FontWeight.bold, + ), + ) + : Text( + languageID == "ar" + ? cancelledOrderList[index] + .orderStatusn + .toString() + : cancelledOrderList[index] + .orderStatus + .toString(), + style: TextStyle( + color: Colors.white, + fontSize: 15.0, + fontWeight: FontWeight.bold, + ), + )), + Container( + margin: EdgeInsets.only( + left: 8, right: 8, top: 1, bottom: 8), + child: Column( // crossAxisAlignment: CrossAxisAlignment.end, - children: [ - Row( - children: [ - Container( - margin: EdgeInsets.only(left: 5), - child: Text(cancelledOrderList[index].orderTotal.toString(), - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), - ), - ), - Container( - margin: EdgeInsets.only(left: 5), - child: Text(TranslationBase.of(context).sar, - style: TextStyle(fontSize: 16.0, fontWeight: FontWeight.bold, - ), + children: [ + Row( + children: [ + Container( + margin: + EdgeInsets.only(left: 5), + child: Text( + cancelledOrderList[index] + .orderTotal + .toString(), + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ), + Container( + margin: + EdgeInsets.only(left: 5), + child: Text( + TranslationBase.of(context) + .sar, + style: TextStyle( + fontSize: 16.0, + fontWeight: FontWeight.bold, + ), + ), + ), + ], ), - ), - ], - ), - SizedBox( - height: 5,), - Row( - children: [ - Container( - child: Text(cancelledOrderList[index].productCount.toString(), - style: TextStyle(fontSize: 14.0, - ), + SizedBox( + height: 5, ), - ), - Container( - margin: EdgeInsets.only(left: 5), - child: Text(TranslationBase.of(context).itemsNo, - style: TextStyle(fontSize: 14.0, - ), + Row( + children: [ + Container( + child: Text( + cancelledOrderList[index] + .productCount + .toString(), + style: TextStyle( + fontSize: 14.0, + ), + ), + ), + Container( + margin: + EdgeInsets.only(left: 5), + child: Text( + TranslationBase.of(context) + .itemsNo, + style: TextStyle( + fontSize: 14.0, + ), + ), + ), + ], ), - ), - ], + ], + ), ), ], ), - ), - ], - ), - Divider( - color: Colors.grey[350], - height: 20, - thickness: 8, - indent: 0, - endIndent: 0, + Divider( + color: Colors.grey[350], + height: 20, + thickness: 8, + indent: 0, + endIndent: 0, + ), + ], + ), ), - ], - ), - ), - - ); - } + ); + }) + ], + ), ) - ], - ), - ) : Container( - child: Center( - child: Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.center, - children: [ - SvgPicture.asset( - 'assets/images/pharmacy/empty_box.svg'), - Container( - margin: EdgeInsets.only(top: 10.0), - child: Text(TranslationBase.of(context).noOrder, - style: TextStyle( - fontSize: 16.0, - )), - ), - ], - ), - ), - ), + child: Center( + child: Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + SvgPicture.asset('assets/images/pharmacy/empty_box.svg'), + Container( + margin: EdgeInsets.only(top: 10.0), + child: Text(TranslationBase.of(context).noOrder, + style: TextStyle( + fontSize: 16.0, + )), + ), + ], + ), + ), + ), ); int test = Test()["1"]; } - } -class Test{ - static const values = { - "1":1, - "2":2, - "3":3 - }; +class Test { + static const values = {"1": 1, "2": 2, "3": 3}; + int operator [](String key) => values[key]; -} \ No newline at end of file +} diff --git a/lib/pages/pharmacy/order/OrderDetails.dart b/lib/pages/pharmacy/order/OrderDetails.dart index 0c71bb38..047fda85 100644 --- a/lib/pages/pharmacy/order/OrderDetails.dart +++ b/lib/pages/pharmacy/order/OrderDetails.dart @@ -1,18 +1,19 @@ +import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/order_detail.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/orders_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/order_model_view_model.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart'; +import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets//pharmacy/product_tile.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/in_app_browser/InAppBrowser.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; -import 'package:diplomaticquarterapp/widgets//pharmacy/product_tile.dart'; -import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:flutter/src/widgets/image.dart' as flutterImage; +import 'package:flutter_svg/flutter_svg.dart'; dynamic languageID; @@ -691,8 +692,8 @@ class _OrderDetailsPageState extends State { // Navigator.pop(context); Navigator.push( context, - MaterialPageRoute( - builder: (context) => OrderPage( + FadePage( + page: OrderPage( // customerID: model.ordersList[0].customerId.toString() customerID: widget.orderModel.customerId.toString())), ); diff --git a/lib/pages/pharmacy/profile/profile.dart b/lib/pages/pharmacy/profile/profile.dart index 2eb6b32f..9c32b23f 100644 --- a/lib/pages/pharmacy/profile/profile.dart +++ b/lib/pages/pharmacy/profile/profile.dart @@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.da import 'package:diplomaticquarterapp/pages/ContactUs/LiveChat/livechat_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; +import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/login/welcome.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/compare.dart'; @@ -14,20 +15,14 @@ import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy-terms-con import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/Order.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart'; +import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/avatar/large_avatar.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:flutter_svg/flutter_svg.dart'; -import 'package:diplomaticquarterapp/pages/base/base_view.dart'; - -import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; -import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart'; -import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/my_reviews.dart'; -import 'package:diplomaticquarterapp/pages/pharmacies/compare.dart'; dynamic languageID; @@ -74,7 +69,7 @@ class _ProfilePageState extends State { if (userData == null) { Navigator.push( context, - MaterialPageRoute(builder: (context) => WelcomeLogin()), + FadePage(page: WelcomeLogin()), ); } } @@ -165,8 +160,8 @@ class _ProfilePageState extends State { } Navigator.push( context, - MaterialPageRoute( - builder: (context) => OrderPage( + FadePage( + page: OrderPage( customerID: customerId))); }, child: Column( @@ -194,11 +189,8 @@ class _ProfilePageState extends State { Expanded( child: InkWell( onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - LakumMainPage())); + Navigator.push(context, + FadePage(page: LakumMainPage())); }, child: Column( children: [ @@ -223,11 +215,8 @@ class _ProfilePageState extends State { Expanded( child: InkWell( onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - WishlistPage())); + Navigator.push(context, + FadePage(page: WishlistPage())); }, child: Column( children: [ @@ -253,11 +242,8 @@ class _ProfilePageState extends State { Expanded( child: InkWell( onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - MyReviewsPage())); + Navigator.push(context, + FadePage(page: MyReviewsPage())); }, child: Column( children: [ @@ -317,9 +303,8 @@ class _ProfilePageState extends State { onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => - HomePrescriptionsPage())); + FadePage( + page: HomePrescriptionsPage())); }, child: Row( children: [ @@ -350,11 +335,8 @@ class _ProfilePageState extends State { ), InkWell( onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - ComparePage())); + Navigator.push(context, + FadePage(page: ComparePage())); }, child: Row( children: [ @@ -385,9 +367,8 @@ class _ProfilePageState extends State { onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => - HomePrescriptionsPage())); + FadePage( + page: HomePrescriptionsPage())); }, child: Row( children: [ @@ -419,10 +400,7 @@ class _ProfilePageState extends State { InkWell( onTap: () { Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - MyFamily())); + context, FadePage(page: MyFamily())); }, child: Row( children: [ @@ -454,9 +432,8 @@ class _ProfilePageState extends State { onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => - PharmacyAddressesPage())); + FadePage( + page: PharmacyAddressesPage())); }, child: Row( children: [ @@ -489,9 +466,8 @@ class _ProfilePageState extends State { onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => - PharmacyTermsConditions())); + FadePage( + page: PharmacyTermsConditions())); }, child: Row( children: [ @@ -524,14 +500,13 @@ class _ProfilePageState extends State { onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => - LakumTermsConditions( - this.identificationNo, - this.firstName, - this.lastName, - this.mobileNo, - this.languageId))); + FadePage( + page: LakumTermsConditions( + this.identificationNo, + this.firstName, + this.lastName, + this.mobileNo, + this.languageId))); }, child: Row( children: [ @@ -591,11 +566,8 @@ class _ProfilePageState extends State { ), InkWell( onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - LiveChatPage())); + Navigator.push(context, + FadePage(page: LiveChatPage())); }, child: Row( children: [ @@ -623,11 +595,8 @@ class _ProfilePageState extends State { ), InkWell( onTap: () { - Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - FindUsPage())); + Navigator.push(context, + FadePage(page: FindUsPage())); }, child: Row( children: [ diff --git a/lib/pages/pharmacy_categorise.dart b/lib/pages/pharmacy_categorise.dart index f0062a1c..316978a7 100644 --- a/lib/pages/pharmacy_categorise.dart +++ b/lib/pages/pharmacy_categorise.dart @@ -1,7 +1,6 @@ import 'dart:convert'; import 'package:barcode_scan_fix/barcode_scan.dart'; -import 'package:charts_flutter/flutter.dart'; import 'package:diplomaticquarterapp/core/enum/viewstate.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; @@ -11,8 +10,10 @@ import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/utils.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/material.dart'; import 'package:provider/provider.dart'; + import 'base/base_view.dart'; import 'final_products_page.dart'; @@ -29,7 +30,9 @@ class _PharmacyCategorisePageState extends State { ProjectViewModel projectViewModel = Provider.of(context); return BaseView( onModelReady: (model) => model.getCategorise(), - builder: (BuildContext context, PharmacyCategoriseViewModel model, Widget child) => AppScaffold( + builder: (BuildContext context, PharmacyCategoriseViewModel model, + Widget child) => + AppScaffold( isShowDecPage: false, baseViewModel: model, body: Column( @@ -57,7 +60,9 @@ class _PharmacyCategorisePageState extends State { child: Padding( padding: EdgeInsets.symmetric(horizontal: 10.0), child: Texts( - projectViewModel.isArabic ? model.categorise[index].namen : model.categorise[index].name, + projectViewModel.isArabic + ? model.categorise[index].namen + : model.categorise[index].name, fontWeight: FontWeight.w600, ), ), @@ -65,8 +70,8 @@ class _PharmacyCategorisePageState extends State { onTap: () => { Navigator.push( context, - MaterialPageRoute( - builder: (context) => model.categorise[index].id != '12' + FadePage( + page: model.categorise[index].id != '12' ? ParentCategorisePage( id: model.categorise[index].id, titleName: model.categorise[index].name, @@ -86,7 +91,10 @@ class _PharmacyCategorisePageState extends State { height: 140, child: Column( children: [ - Divider(height: 2.0, thickness: 1.0, color: Colors.black12.withOpacity(0.14)), + Divider( + height: 2.0, + thickness: 1.0, + color: Colors.black12.withOpacity(0.14)), SizedBox( height: 10.0, ), @@ -102,12 +110,16 @@ class _PharmacyCategorisePageState extends State { width: 55.0, decoration: BoxDecoration( borderRadius: BorderRadius.circular(5.0), - color: Colors.green.shade300.withOpacity(0.34), + color: + Colors.green.shade300.withOpacity(0.34), ), child: Padding( - padding: EdgeInsets.symmetric(horizontal: 10.0), + padding: + EdgeInsets.symmetric(horizontal: 10.0), child: Texts( - projectViewModel.isArabic ? 'الاكثر مبيعا' : 'Best Sellers', + projectViewModel.isArabic + ? 'الاكثر مبيعا' + : 'Best Sellers', fontWeight: FontWeight.w600, ), ), @@ -122,13 +134,16 @@ class _PharmacyCategorisePageState extends State { height: 50.0, width: 55.0, decoration: BoxDecoration( - color: Colors.orangeAccent.shade200.withOpacity(0.34), + color: Colors.orangeAccent.shade200 + .withOpacity(0.34), borderRadius: BorderRadius.circular(5.0), ), child: Padding( padding: EdgeInsets.symmetric(horizontal: 10.0), child: Texts( - projectViewModel.isArabic ? 'الاكثر مشاهدة' : 'Most Viewed', + projectViewModel.isArabic + ? 'الاكثر مشاهدة' + : 'Most Viewed', fontWeight: FontWeight.w600, ), ), @@ -152,7 +167,9 @@ class _PharmacyCategorisePageState extends State { child: Padding( padding: EdgeInsets.symmetric(horizontal: 10.0), child: Texts( - projectViewModel.isArabic ? 'منتجات جديدة' : 'New Products', + projectViewModel.isArabic + ? 'منتجات جديدة' + : 'New Products', fontWeight: FontWeight.w600, ), ), @@ -170,13 +187,17 @@ class _PharmacyCategorisePageState extends State { height: 50.0, width: 55.0, decoration: BoxDecoration( - color: Colors.purple.shade200.withOpacity(0.34), + color: + Colors.purple.shade200.withOpacity(0.34), borderRadius: BorderRadius.circular(5.0), ), child: Padding( - padding: EdgeInsets.symmetric(horizontal: 10.0), + padding: + EdgeInsets.symmetric(horizontal: 10.0), child: Texts( - projectViewModel.isArabic ? 'شوهد مؤخرا' : 'Recently Viewed', + projectViewModel.isArabic + ? 'شوهد مؤخرا' + : 'Recently Viewed', fontWeight: FontWeight.w600, ), ), @@ -214,7 +235,7 @@ class _PharmacyCategorisePageState extends State { { Navigator.push( context, - MaterialPageRoute(builder: (context) => LandingPagePharmacy()), + FadePage(page: LandingPagePharmacy()), ); } } diff --git a/lib/pages/sub_categorise_page.dart b/lib/pages/sub_categorise_page.dart index 502df3d9..7c14e05d 100644 --- a/lib/pages/sub_categorise_page.dart +++ b/lib/pages/sub_categorise_page.dart @@ -1,5 +1,4 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; @@ -8,7 +7,6 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; -import 'package:provider/provider.dart'; import 'base/base_view.dart'; import 'final_products_page.dart'; @@ -19,6 +17,7 @@ class SubCategorisePage extends StatefulWidget { String parentId; SubCategorisePage({this.id, this.parentId, this.title}); + @override _SubCategorisePageState createState() => _SubCategorisePageState(id: id, title: title, parentId: parentId); @@ -30,7 +29,9 @@ class _SubCategorisePageState extends State { String id; String title; String parentId; + _SubCategorisePageState({this.title, this.parentId, this.id}); + String categoriseName = "Personal Care"; bool styleOne = true; bool styleTwo = false; @@ -39,6 +40,7 @@ class _SubCategorisePageState extends State { color: Colors.blue, size: 29.0, ); + @override Widget build(BuildContext context) { return BaseView( @@ -142,8 +144,8 @@ class _SubCategorisePageState extends State { onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => + FadePage( + page: FinalProductsPage( id: model .subCategorise[ @@ -230,9 +232,8 @@ class _SubCategorisePageState extends State { onTap: () { Navigator.push( context, - MaterialPageRoute( - builder: (context) => - FinalProductsPage( + FadePage( + page: FinalProductsPage( id: model.subCategorise[index].id, ), ), diff --git a/lib/widgets/bottom_navigation/bottom_nav_bar.dart b/lib/widgets/bottom_navigation/bottom_nav_bar.dart index 107e730c..6bcc5360 100644 --- a/lib/widgets/bottom_navigation/bottom_nav_bar.dart +++ b/lib/widgets/bottom_navigation/bottom_nav_bar.dart @@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:eva_icons_flutter/eva_icons_flutter.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; @@ -16,8 +17,9 @@ import 'bottom_navigation_item.dart'; class BottomNavBar extends StatefulWidget { final ValueChanged changeIndex; - final int index ; - BottomNavBar({Key key, this.changeIndex,this.index}) : super(key: key); + final int index; + + BottomNavBar({Key key, this.changeIndex, this.index}) : super(key: key); @override _BottomNavBarState createState() => _BottomNavBarState(); @@ -77,29 +79,28 @@ class _BottomNavBarState extends State { currentIndex: 1, name: TranslationBase.of(context).medicalProfile, ), - if(widget.index == 0 && projectViewModel.havePrivilege(34)) - Expanded( - child: SizedBox( - height: 50, - child: Column( - mainAxisSize: MainAxisSize.min, - mainAxisAlignment: MainAxisAlignment.center, - children: [ - SizedBox(height: 22), - ], - ), - ), - ), - if(widget.index != 0 && projectViewModel.havePrivilege(34)) - BottomNavigationItem( - icon: EvaIcons.calendar, - activeIcon: EvaIcons.calendar, - changeIndex: _changeIndex, - index: widget.index, - currentIndex: 2, - name: TranslationBase.of(context).bookAppo, - ), - + if (widget.index == 0 && projectViewModel.havePrivilege(34)) + Expanded( + child: SizedBox( + height: 50, + child: Column( + mainAxisSize: MainAxisSize.min, + mainAxisAlignment: MainAxisAlignment.center, + children: [ + SizedBox(height: 22), + ], + ), + ), + ), + if (widget.index != 0 && projectViewModel.havePrivilege(34)) + BottomNavigationItem( + icon: EvaIcons.calendar, + activeIcon: EvaIcons.calendar, + changeIndex: _changeIndex, + index: widget.index, + currentIndex: 2, + name: TranslationBase.of(context).bookAppo, + ), BottomNavigationItem( icon: DQIcons.family, activeIcon: DQIcons.family, @@ -108,15 +109,15 @@ class _BottomNavBarState extends State { currentIndex: 3, name: TranslationBase.of(context).myFamily, ), - if(projectViewModel.havePrivilege(51)) - BottomNavigationItem( - icon: EvaIcons.calendar, - activeIcon: EvaIcons.calendar, - changeIndex: _changeIndex, - index: widget.index, - currentIndex: 4, - name: TranslationBase.of(context).todoList, - ) + if (projectViewModel.havePrivilege(51)) + BottomNavigationItem( + icon: EvaIcons.calendar, + activeIcon: EvaIcons.calendar, + changeIndex: _changeIndex, + index: widget.index, + currentIndex: 4, + name: TranslationBase.of(context).todoList, + ) ], ), ), @@ -124,12 +125,10 @@ class _BottomNavBarState extends State { } Future navigateToBookingOptions(context) async { - Navigator.push( - context, MaterialPageRoute(builder: (context) => BookingOptions())); + Navigator.push(context, FadePage(page: BookingOptions())); } Future navigateToToDoList(context) async { - Navigator.push(context, - MaterialPageRoute(builder: (context) => ToDo(isShowAppBar: false))); + Navigator.push(context, FadePage(page: ToDo(isShowAppBar: false))); } } diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index d46d9eba..8926cfda 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -1,4 +1,5 @@ import 'dart:io'; + import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart'; @@ -18,7 +19,6 @@ 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/uitl/utils.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; @@ -44,7 +44,8 @@ class _AppDrawerState extends State { ProjectViewModel projectProvider; var sharedPref = new AppSharedPreferences(); var familyFileProvider = FamilyFilesProvider(); - PharmacyModuleViewModel pharmacyModuleViewModel = locator(); + PharmacyModuleViewModel pharmacyModuleViewModel = + locator(); AuthenticatedUser user; AuthenticatedUser mainUser; AuthenticatedUserObject authenticatedUserObject = @@ -55,6 +56,7 @@ class _AppDrawerState extends State { ToDoCountProviderModel toDoProvider; String booldType; String notificationCount; + @override Widget build(BuildContext context) { toDoProvider = Provider.of(context); @@ -158,7 +160,8 @@ class _AppDrawerState extends State { mainAxisAlignment: MainAxisAlignment.start, children: [ (user.isFamily == null || - user.isFamily == false)&& projectProvider.havePrivilege(2) + user.isFamily == false) && + projectProvider.havePrivilege(2) ? InkWell( child: DrawerItem( TranslationBase.of(context).family, @@ -294,21 +297,20 @@ class _AppDrawerState extends State { } }, ), - if(projectProvider.havePrivilege(1)) - + if (projectProvider.havePrivilege(1)) InkWell( - child: DrawerItem( - TranslationBase.of(context) - .arabicChange, - Icons.translate), - onTap: () { - if (projectProvider.isArabic) { - projectProvider.changeLanguage('en'); - } else { - projectProvider.changeLanguage('ar'); - } - }, - ), + child: DrawerItem( + TranslationBase.of(context) + .arabicChange, + Icons.translate), + onTap: () { + if (projectProvider.isArabic) { + projectProvider.changeLanguage('en'); + } else { + projectProvider.changeLanguage('ar'); + } + }, + ), InkWell( child: Stack( children: [ @@ -350,24 +352,22 @@ class _AppDrawerState extends State { onTap: () { //NotificationsPage Navigator.of(context).pop(); - Navigator.push( - context, - MaterialPageRoute( - builder: (BuildContext context) => - NotificationsPage())); - }, - ), - if(projectProvider.havePrivilege(3)) - InkWell( - child: DrawerItem( - TranslationBase.of(context).appsetting, - Icons.settings_input_composite), - onTap: () { - Navigator.of(context).pushNamed( - SETTINGS, - ); + Navigator.push(context, + FadePage(page: NotificationsPage())); }, ), + if (projectProvider.havePrivilege(3)) + InkWell( + child: DrawerItem( + TranslationBase.of(context) + .appsetting, + Icons.settings_input_composite), + onTap: () { + Navigator.of(context).pushNamed( + SETTINGS, + ); + }, + ), InkWell( child: DrawerItem( TranslationBase.of(context).rateApp, @@ -573,7 +573,8 @@ class _AppDrawerState extends State { loginAfter(result, context) async { result = CheckActivationCode.fromJson(result); - Provider.of(context, listen: false).setPrivilege(privilegeList: result,isLoginChild: true); + Provider.of(context, listen: false) + .setPrivilege(privilegeList: result, isLoginChild: true); var familyFile = await sharedPref.getObject(FAMILY_FILE); var currentLang = await sharedPref.getString(APP_LANGUAGE); var mainUser = await sharedPref.getObject(MAIN_USER); @@ -595,8 +596,8 @@ class _AppDrawerState extends State { authenticatedUserObject.user; Provider.of(context, listen: false) .setUser(authenticatedUserObject.user); - await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { - if(pharmacyModuleViewModel.error.isNotEmpty) + await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { + if (pharmacyModuleViewModel.error.isNotEmpty) await pharmacyModuleViewModel.createUser(); }); diff --git a/lib/widgets/others/app_scafold_detail_page.dart b/lib/widgets/others/app_scafold_detail_page.dart index ed8bc8a7..6aa77d30 100644 --- a/lib/widgets/others/app_scafold_detail_page.dart +++ b/lib/widgets/others/app_scafold_detail_page.dart @@ -194,7 +194,7 @@ class AppBarWidget extends StatelessWidget with PreferredSizeWidget { onPressed: () { Navigator.push( context, - MaterialPageRoute(builder: (context) => CartOrderPage()), + FadePage(page: CartOrderPage()), ); // Navigator.of(context) // .popUntil(ModalRoute.withName('/')); diff --git a/lib/widgets/others/bottom_bar.dart b/lib/widgets/others/bottom_bar.dart index 1003446d..ffd80108 100644 --- a/lib/widgets/others/bottom_bar.dart +++ b/lib/widgets/others/bottom_bar.dart @@ -483,25 +483,21 @@ class _SearchBot extends State { {isAppo}) async { Navigator.push( context, - MaterialPageRoute( - builder: (context) => DoctorProfile( - doctor: docObject, - docProfileList: docProfile, - isOpenAppt: isAppo, - ))); + FadePage( + page: DoctorProfile( + doctor: docObject, + docProfileList: docProfile, + isOpenAppt: isAppo, + ))); } Future navigateToSearchResults(context, docList, arr, arrDistance) async { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => SearchResults(doctorsList: docList))); var result = LinkedHashSet.from(arr).toList(); var numAll = result.length; Navigator.push( context, - MaterialPageRoute( - builder: (context) => BranchView( + FadePage( + page: BranchView( doctorsList: docList, result: result, num: numAll, @@ -524,11 +520,11 @@ class _SearchBot extends State { goToClinic(List ids) { Navigator.push( AppGlobal.context, - MaterialPageRoute( - builder: (context) => Search( - type: 0, - clnicIds: ids, - ))); + FadePage( + page: Search( + type: 0, + clnicIds: ids, + ))); speak(); } diff --git a/lib/widgets/others/floating_button_search.dart b/lib/widgets/others/floating_button_search.dart index eb0ad66e..5aec6e05 100644 --- a/lib/widgets/others/floating_button_search.dart +++ b/lib/widgets/others/floating_button_search.dart @@ -1,6 +1,7 @@ import 'dart:collection'; import 'dart:io'; import 'dart:math'; + import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; @@ -11,6 +12,8 @@ import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/my_web_view.dar import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/parking_page.dart'; import 'package:diplomaticquarterapp/pages/Blood/blood_donation.dart'; import 'package:diplomaticquarterapp/pages/Blood/my_balance_page.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/DoctorProfile.dart'; +import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/findus/findus_page.dart'; import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart'; @@ -44,17 +47,14 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/widgets/robo-search/robosearch.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; +import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; -import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_tts/flutter_tts.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:provider/provider.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_result.dart'; import 'package:speech_to_text/speech_to_text.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/DoctorProfile.dart'; -import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; -import 'package:flutter/cupertino.dart'; import 'package:url_launcher/url_launcher.dart'; class FloatingSearchButton extends StatefulWidget { @@ -795,25 +795,21 @@ class _FloatingSearchButton extends State {isAppo}) async { Navigator.push( context, - MaterialPageRoute( - builder: (context) => DoctorProfile( - doctor: docObject, - docProfileList: docProfile, - isOpenAppt: isAppo, - ))); + FadePage( + page: DoctorProfile( + doctor: docObject, + docProfileList: docProfile, + isOpenAppt: isAppo, + ))); } Future navigateToSearchResults(context, docList, arr, arrDistance) async { - // Navigator.push( - // context, - // MaterialPageRoute( - // builder: (context) => SearchResults(doctorsList: docList))); var result = LinkedHashSet.from(arr).toList(); var numAll = result.length; Navigator.push( context, - MaterialPageRoute( - builder: (context) => BranchView( + FadePage( + page: BranchView( doctorsList: docList, result: result, num: numAll, diff --git a/lib/widgets/pharmacy/bottom_nav_pharmacy_home_item.dart b/lib/widgets/pharmacy/bottom_nav_pharmacy_home_item.dart index c5c3519b..a11b5418 100644 --- a/lib/widgets/pharmacy/bottom_nav_pharmacy_home_item.dart +++ b/lib/widgets/pharmacy/bottom_nav_pharmacy_home_item.dart @@ -1,6 +1,5 @@ -import 'package:diplomaticquarterapp/pages/landing/home_page.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; -import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; class BottomNavHomeItem extends StatelessWidget { @@ -35,7 +34,7 @@ class BottomNavHomeItem extends StatelessWidget { onTap: () => { Navigator.push( context, - MaterialPageRoute(builder: (context) => LandingPage()), + FadePage(page: LandingPage()), ), }, child: Column( diff --git a/lib/widgets/pharmacy/product_tile.dart b/lib/widgets/pharmacy/product_tile.dart index 1caffefe..23eb0f0e 100644 --- a/lib/widgets/pharmacy/product_tile.dart +++ b/lib/widgets/pharmacy/product_tile.dart @@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_deta import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacy/order/ProductReview.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; +import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/material.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:rating_bar/rating_bar.dart'; @@ -23,22 +24,22 @@ class productTile extends StatelessWidget { final PharmacyProduct product; final dynamic productID; - productTile( - {this.productName, - this.productPrice, - this.productRate, - this.productReviews, - this.qyt, - this.totalPrice, - this.isOrderDetails = false, - this.productImage, - this.showLine = true, - this.img, - this.imgs, - this.status, - this.product, - this.productID, - }); + productTile({ + this.productName, + this.productPrice, + this.productRate, + this.productReviews, + this.qyt, + this.totalPrice, + this.isOrderDetails = false, + this.productImage, + this.showLine = true, + this.img, + this.imgs, + this.status, + this.product, + this.productID, + }); @override Widget build(BuildContext context) { @@ -133,11 +134,8 @@ class productTile extends StatelessWidget { child: Column( children: [ IconButton( - icon: Icon( - FontAwesomeIcons.trashAlt, - size: 15 - ), - onPressed: (){ + icon: Icon(FontAwesomeIcons.trashAlt, size: 15), + onPressed: () { deleteFromWishlistFunction(productID); }, ), @@ -145,16 +143,12 @@ class productTile extends StatelessWidget { height: 50, ), IconButton( - icon: Icon( - FontAwesomeIcons.shoppingCart, - size: 15 - ), - onPressed: () async{ + icon: Icon(FontAwesomeIcons.shoppingCart, size: 15), + onPressed: () async { await addToCartFunction(1, productID); Navigator.push( context, - MaterialPageRoute( - builder: (context) => CartOrderPage()), + FadePage(page: CartOrderPage()), ); }, ), @@ -260,10 +254,7 @@ class productTile extends StatelessWidget { InkWell( onTap: () { Navigator.push( - context, - MaterialPageRoute( - builder: (context) => - ProductReviewPage(product))); + context, FadePage(page: ProductReviewPage(product))); }, child: Container( padding: @@ -295,17 +286,14 @@ class productTile extends StatelessWidget { ), ); } + deleteFromWishlistFunction(itemID) async { ProductDetailViewModel x = new ProductDetailViewModel(); await x.deletWishlistData(itemID); } - addToCartFunction(quantity, itemID) async { ProductDetailViewModel x = new ProductDetailViewModel(); await x.addToCartData(quantity, itemID); - } } - - diff --git a/lib/widgets/robo-search/search.dart b/lib/widgets/robo-search/search.dart index c1ce33d1..4d683762 100644 --- a/lib/widgets/robo-search/search.dart +++ b/lib/widgets/robo-search/search.dart @@ -1,27 +1,18 @@ +import 'dart:math'; + import 'package:diplomaticquarterapp/config/config.dart'; -import 'package:diplomaticquarterapp/config/size_config.dart'; -import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/BookingOptions.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/Search.dart'; -import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; -import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart'; -import 'package:diplomaticquarterapp/pages/medical/my_admissions_page.dart'; import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; -import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart'; -import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:flutter/cupertino.dart'; import 'package:flutter/material.dart'; import 'package:flutter_tts/flutter_tts.dart'; -import 'package:hexcolor/hexcolor.dart'; import 'package:permission_handler/permission_handler.dart'; import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_result.dart'; import 'package:speech_to_text/speech_to_text.dart'; -import 'package:diplomaticquarterapp/widgets/robo-search/robosearch.dart'; -import 'dart:math'; -import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; class SearchBot with ChangeNotifier { SearchBot() { @@ -30,6 +21,7 @@ class SearchBot with ChangeNotifier { } SearchProvider searchProvider = new SearchProvider(); + // RobotProvider eventProvider = RobotProvider(); bool isLoading = false; bool isError = false; @@ -190,18 +182,18 @@ class SearchBot with ChangeNotifier { case '101': Navigator.push( AppGlobal.context, - MaterialPageRoute( - builder: (context) => Search( - type: 0, - ))); + FadePage( + page: Search( + type: 0, + ))); break; case '102': Navigator.push( AppGlobal.context, - MaterialPageRoute( - builder: (context) => Search( - type: 1, - ))); + FadePage( + page: Search( + type: 1, + ))); break; // case '103': // eventProvider.setValue({"clinic_id": understand});