diff --git a/lib/config/config.dart b/lib/config/config.dart index 8e19b054..2257f3b0 100644 --- a/lib/config/config.dart +++ b/lib/config/config.dart @@ -25,13 +25,13 @@ var PACKAGES_TAMARA_OPT = '/api/orders/paymentoptions/tamara'; // var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'http://10.20.200.111:1010/'; -var BASE_URL = 'https://uat.hmgwebservices.com/'; +//var BASE_URL = 'https://uat.hmgwebservices.com/'; // var BASE_URL = 'https://hmgwebservices.com/'; // var BASE_URL = 'https://orash.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidauat.cloudsolutions.com.sa/'; // var BASE_URL = 'https://vidamergeuat.cloudsolutions.com.sa/'; -// var BASE_URL = 'https://webservices.hmg.com/'; + var BASE_URL = 'https://webservices.hmg.com/'; // var BASE_URL = 'http://10.50.100.198:4422/'; @@ -436,7 +436,7 @@ var UPDATE_COVID_QUESTIONNAIRE = var CHANNEL = 3; var GENERAL_ID = 'Cs2020@2016\$2958'; var IP_ADDRESS = '10.20.10.20'; -var VERSION_ID = 12.4; +var VERSION_ID = 12.6; var SETUP_ID = '91877'; var LANGUAGE = 2; // var PATIENT_OUT_SA = 0; @@ -854,8 +854,6 @@ var addPayFortApplePayResponse = "Services/PayFort_Serv.svc/REST/AddResponse"; var payFortEnvironment = FortEnvironment.test; var applePayMerchantId = "merchant.com.hmgwebservices.uat"; -bool apiStatus = false; - class AppGlobal { static var context; diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart index 2c46e0b1..3d104e58 100644 --- a/lib/config/localized_values.dart +++ b/lib/config/localized_values.dart @@ -449,7 +449,7 @@ const Map localizedValues = { "Cylinder": {"en": "Cylinder", "ar": "الدائرية"}, "Axis": {"en": "Axis", "ar": "المحاور"}, "Prism": {"en": "Prism", "ar": "موشور"}, - "VA": {"en": "Prism", "ar": "المحاور"}, + "VA": {"en": "VA", "ar": "فرجينيا"}, "LeftEye": {"en": "Left Eye", "ar": "العين اليسرى"}, "Brand": {"en": "Brand", "ar": "النوع"}, "Power": {"en": "Power", "ar": "القوة"}, @@ -1953,4 +1953,5 @@ const Map localizedValues = { "upcoming": {"en": "Upcoming", "ar": "المواعيد القادمة"}, "noUpcomingAppointment": {"en": "No upcoming appointments", "ar": "لا توجد مواعيد القادمة"}, "locationTimeoutError": {"en": "Unable to fetch your location, Please try again.", "ar": "غير قادر على جلب موقعك، يرجى المحاولة مرة أخرى."}, + "loadMore": {"en": "Load More", "ar": "تحميل المزيد"}, }; \ No newline at end of file diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart index 2583a776..57df9ff8 100644 --- a/lib/core/service/client/base_app_client.dart +++ b/lib/core/service/client/base_app_client.dart @@ -193,7 +193,7 @@ class BaseAppClient { // body['IdentificationNo'] = 1023854217; // body['MobileNo'] = "531940021"; //0560717232 - // body['PatientID'] = 1374756; //4609100 + // body['PatientID'] = 3300938; //4609100 // body['TokenID'] = "@dm!n"; // Patient ID: 3027574 diff --git a/lib/core/service/medical/medical_service.dart b/lib/core/service/medical/medical_service.dart index d3b131da..a77729c9 100644 --- a/lib/core/service/medical/medical_service.dart +++ b/lib/core/service/medical/medical_service.dart @@ -11,7 +11,7 @@ class MedicalService extends BaseService { List appoitmentAllHistoryResultList =[]; List doctorScheduleResponse =[]; List freeSlots = []; - getAppointmentHistory({bool isActiveAppointment = false}) async { + getAppointmentHistory({bool isActiveAppointment = false, bool isForTimeLine = false}) async { hasError = false; super.error = ""; Map body = Map(); @@ -19,6 +19,7 @@ class MedicalService extends BaseService { body['IsActiveAppointment'] = true; body['isDentalAllowedBackend'] = false; } + body['IsForTimeLine'] = isForTimeLine; var appoHistory = await sharedPref.getObject(APPOINTMENT_HISTORY_MEDICAL); if (appoHistory != null) { appoitmentAllHistoryResultList.clear(); diff --git a/lib/core/viewModels/er/rrt-view-model.dart b/lib/core/viewModels/er/rrt-view-model.dart index 2be06372..96c0436d 100644 --- a/lib/core/viewModels/er/rrt-view-model.dart +++ b/lib/core/viewModels/er/rrt-view-model.dart @@ -29,6 +29,7 @@ class _RRTServiceData { class RRTViewModel extends BaseViewModel { var _service = RRTService(); + late int createdRequestNo; var _pharmacy_service = locator(); var _pharmacy_address_service = locator(); CustomerAddressesService _customerAddressesService = locator(); @@ -69,10 +70,10 @@ class RRTViewModel extends BaseViewModel { // body['CreatedBy'] = user.patientIdentificationType; // body['OrderServiceID'] = 5; var localRes; - int requestNo; + await _service.baseAppClient.post(ADD_RRT_ORDER_RC, isRCService: true, body: body, onSuccess: (response, statusCode) { - requestNo = response['response']; - return requestNo; + createdRequestNo = response['response']; + Future.value(createdRequestNo); }, onFailure: (error, statusCode) { AppToast.showErrorToast(message: error); return error; diff --git a/lib/core/viewModels/medical/medical_view_model.dart b/lib/core/viewModels/medical/medical_view_model.dart index e2cc2520..a111b6a5 100644 --- a/lib/core/viewModels/medical/medical_view_model.dart +++ b/lib/core/viewModels/medical/medical_view_model.dart @@ -10,12 +10,15 @@ class MedicalViewModel extends BaseViewModel { MedicalService _medicalService = locator(); List get appoitmentAllHistoryResultList => _medicalService.appoitmentAllHistoryResultList; + List get getDoctorScheduleList => _medicalService.doctorScheduleResponse; + List get freeSlots => _medicalService.freeSlots; - getAppointmentHistory() async { + + getAppointmentHistory({bool isForTimeLine = false}) async { if (authenticatedUserObject.isLogin) { setState(ViewState.Busy); - await _medicalService.getAppointmentHistory(); + await _medicalService.getAppointmentHistory(isForTimeLine: isForTimeLine); if (_medicalService.hasError) { error = _medicalService.error!; setState(ViewState.Error); @@ -46,5 +49,5 @@ class MedicalViewModel extends BaseViewModel { } else setState(ViewState.Idle); } - //} +//} } diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart index c0f71633..398b3afe 100644 --- a/lib/core/viewModels/project_view_model.dart +++ b/lib/core/viewModels/project_view_model.dart @@ -37,12 +37,20 @@ class ProjectViewModel extends BaseViewModel { String error = ''; dynamic searchvalue; bool isLogin = false; + bool _isAllAppointmentsLoaded = false; + bool get isAllAppointmentsLoaded => _isAllAppointmentsLoaded; bool isPatientAdmitted = false; bool patientHasAdmissionRequest = false; int inPatientProjectID = 0; GetAdmissionInfoResponseModel getAdmissionInfoResponseModel = GetAdmissionInfoResponseModel(); GetAdmissionRequestInfoResponseModel getAdmissionRequestInfoResponseModel = GetAdmissionRequestInfoResponseModel(); + void setIsAllAppointmentsLoaded(bool value) { + _isAllAppointmentsLoaded = value; + notifyListeners(); + } + + RegisterInfoResponse _registerInfo = RegisterInfoResponse(); RegisterInfoResponse get registerInfo => _registerInfo; diff --git a/lib/main.dart b/lib/main.dart index c4299d46..cb064e0e 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -27,27 +27,10 @@ import 'core/viewModels/project_view_model.dart'; import 'locator.dart'; import 'pages/pharmacies/compare-list.dart'; -var logger = Logger( - printer: PrettyPrinter( - methodCount: 2, - // Number of method calls to be displayed - errorMethodCount: 8, - // Number of method calls if stacktrace is provided - lineLength: 500, - // Width of the output - colors: true, - // Colorful log messages - printEmojis: true, - // Print an emoji for each log message - printTime: false // Should each log print contain a timestamp - ), -); - void main() async { WidgetsFlutterBinding.ensureInitialized(); - setupLocator(); await Firebase.initializeApp(); - + setupLocator(); HttpOverrides.global = MyHttpOverrides(); runApp(MyApp()); } @@ -108,10 +91,6 @@ class _MyApp extends State { Widget build(BuildContext context) { PlatformBridge.init(context); - LocalNotification.init(onNotificationClick: (payload) { - LocalNotification.getInstance()?.showNow(title: "Payload", subtitle: payload, payload: payload); - }); - // SystemChrome.setPreferredOrientations([ // DeviceOrientation.portraitUp, // DeviceOrientationO.portraitDown, 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 fb6e3081..95bfdf0a 100644 --- a/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart +++ b/lib/pages/AlHabibMedicalService/health_calculator/bmi_calculator/result_page.dart @@ -138,7 +138,7 @@ class _ResultPageState extends State { } callDoctorsSearchAPI() { - int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; + int languageID = Provider.of(context, listen: false).isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); List doctorsList = []; List arr = []; diff --git a/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart b/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart index cb0885b3..29531d6d 100644 --- a/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart +++ b/lib/pages/AlHabibMedicalService/health_converter/blood_cholesterol.dart @@ -246,7 +246,7 @@ class _BloodCholesterolState extends State { TextField( enabled: isEnable, scrollPadding: EdgeInsets.zero, - keyboardType: TextInputType.number, + keyboardType: TextInputType.numberWithOptions(decimal: true), controller: _controller, onChanged: (value) => {}, style: TextStyle( diff --git a/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart b/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart index 4bb22754..bbdb0f73 100644 --- a/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart +++ b/lib/pages/AlHabibMedicalService/health_converter/blood_sugar.dart @@ -263,7 +263,7 @@ class _BloodSugarState extends State { TextField( enabled: isEnable, scrollPadding: EdgeInsets.zero, - keyboardType: TextInputType.number, + keyboardType: TextInputType.numberWithOptions(decimal: true), controller: _controller, onChanged: (value) => {}, style: TextStyle( diff --git a/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart b/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart index 67e12964..8fd454e8 100644 --- a/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart +++ b/lib/pages/AlHabibMedicalService/health_converter/triglycerides.dart @@ -252,7 +252,7 @@ class _TriglyceridesState extends State { TextField( enabled: isEnable, scrollPadding: EdgeInsets.zero, - keyboardType: TextInputType.number, + keyboardType: TextInputType.numberWithOptions(decimal: true), controller: _controller, onChanged: (value) => {}, style: TextStyle( diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index ec7eec2c..a7d21c61 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -257,9 +257,9 @@ class _BookConfirmState extends State { cancelAppointment(DoctorList docObject, AppoitmentAllHistoryResultList appo, BuildContext context) async { ConfirmDialog.closeAlertDialog(context); - GifLoaderDialogUtils.showMyDialog(context); - DoctorsListService service = DoctorsListService(); - bool isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT) ?? false; + GifLoaderDialogUtils.showMyDialog(context, barrierDismissible: false); + DoctorsListService service = new DoctorsListService(); + bool isLiveCareSchedule = await this.sharedPref.getBool(IS_LIVECARE_APPOINTMENT); service.cancelAppointment(appo, context, isReschedule: true).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { @@ -274,7 +274,7 @@ class _BookConfirmState extends State { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } }).catchError((err) { - logger.d(err); + GifLoaderDialogUtils.hideDialog(context); }); } @@ -327,7 +327,7 @@ class _BookConfirmState extends State { final timeSlot = DocAvailableAppointments.selectedAppoDateTime; String logs = await sharedPref.getString('selectedLogSlots'); List decodedLogs = json.decode(logs); - GifLoaderDialogUtils.showMyDialog(context); + GifLoaderDialogUtils.showMyDialog(context, barrierDismissible: false); AppoitmentAllHistoryResultList appo; widget.service // .insertAppointment(docObject.doctorID!, docObject.clinicID!, docObject.projectID!, widget.selectedTime, widget.selectedDate, initialSlotDuration, context, 'null', null, null, projectViewModel) @@ -375,7 +375,6 @@ class _BookConfirmState extends State { dialog.showAlertDialog(context); } }).catchError((err) { - logger.d(err); GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: err); }); @@ -386,18 +385,18 @@ class _BookConfirmState extends State { final timeSlot = DocAvailableAppointments.selectedAppoDateTime; widget.selectedDate = timeSlot!.toUtc().add(Duration(hours: 3)).toString().split(" ")[0]; widget.selectedTime = timeSlot.toUtc().add(Duration(hours: 3)).toString().split(" ")[1].substring(0, 5); - GifLoaderDialogUtils.showMyDialog(context); + GifLoaderDialogUtils.showMyDialog(context, barrierDismissible: false); AppoitmentAllHistoryResultList appo; widget.service .insertLiveCareScheduleAppointment( - docObject.doctorID!, docObject.clinicID!, docObject.projectID!, docObject.serviceID, widget.selectedTime, widget.selectedDate, projectViewModel.isArabic ? 1 : 2, context) + docObject!.doctorID!, docObject.clinicID!, docObject.projectID!, docObject.serviceID, widget.selectedTime, widget.selectedDate, projectViewModel.isArabic ? 1 : 2, context) .then((res) { if (res['MessageStatus'] == 1) { AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); print(res['AppointmentNo']); Future.delayed(new Duration(milliseconds: 500), () { - getLiveCareAppointmentPatientShare(context, res['AppointmentNo'], docObject.clinicID!, docObject.projectID!, docObject); + getLiveCareAppointmentPatientShare(context, res['AppointmentNo'], docObject!.clinicID!, docObject.projectID!, docObject); getToDoCount(); }); projectViewModel.analytics.appointment.book_appointment_confirmation_success(appointment_type: 'livecare', dateTime: timeSlot, doctor: widget.doctor); @@ -450,7 +449,7 @@ class _BookConfirmState extends State { getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) { int languageID = projectViewModel.isArabic ? 1 : 2; String errorMsg = ""; - GifLoaderDialogUtils.showMyDialog(context); + GifLoaderDialogUtils.showMyDialog(context, barrierDismissible: false); widget.service.getPatientShare(appointmentNo, clinicID, projectID, languageID, context).then((res) { projectViewModel.selectedBodyPartList.clear(); projectViewModel.laserSelectionDuration = 0; diff --git a/lib/pages/ErService/rapid-response-team/rrt-place-order.dart b/lib/pages/ErService/rapid-response-team/rrt-place-order.dart index a09fa076..3606b9f4 100644 --- a/lib/pages/ErService/rapid-response-team/rrt-place-order.dart +++ b/lib/pages/ErService/rapid-response-team/rrt-place-order.dart @@ -201,18 +201,20 @@ class RRTPlaceOrderPage extends StatelessWidget { // params['paymentAmount'] = selectedProcedure.patientShareWithTax; // params['procedureId'] = selectedProcedure.procedureID; - var requestId = await viewModel!.createOrderRC(rrtRequestModel.toJson()); + await viewModel!.createOrderRC(rrtRequestModel.toJson()); GifLoaderDialogUtils.hideDialog(_context); - if (requestId != null) { + if (viewModel!.createdRequestNo != null) { showCMCConfirmDialog( _context, - requestId.toString(), + viewModel!.createdRequestNo.toString(), onClick: () { + Navigator.pop(_context); + Navigator.pop(_context); gotoRRTRoot(); - // Navigator.pop(_context); - // Navigator.pop(_context); + + }, ); } diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index c2f39085..4719b47d 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -297,10 +297,10 @@ class _AppointmentDetailsState extends State with SingleTick } void goToBookConfirm() { - if (DocAvailableAppointments.areAppointmentsAvailable) + if (DocAvailableAppointments.areSlotsAvailable) navigateToBookConfirm(context); else - AppToast.showErrorToast(message: TranslationBase.of(context).emptySchedule); + AppToast.showErrorToast(message: TranslationBase.of(context).selectSlot); } Future navigateToBookConfirm(context) async { diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 7a58a4f1..8ea1decb 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -99,6 +99,7 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { _tabController = TabController(length: 2, vsync: this); WidgetsBinding.instance.addPostFrameCallback((_) { getPatientAppointmentHistory(); + getAncillaryOrders(); }); super.initState(); imagesInfo @@ -853,6 +854,36 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { obGyneProcedureListResponse: obGyneProcedureListResponse))); } + getAncillaryOrders() { + DoctorsListService service = new DoctorsListService(); + service.getAncillaryOrders().then((res) { + if (res['MessageStatus'] == 1) { + if (res['AncillaryOrderList'].length != 0) { + res['AncillaryOrderList'].forEach((v) { + ancillaryLists.add(new AncillaryOrdersListModel.fromJson(v)); + }); + } + // if (res['AncillaryOrderList'].length != 0) { + // res['AncillaryOrderList'].forEach((item) { + // ancillaryLists.add(AncillaryOrdersListModel.fromJson(item)); + // }); + // } + // dataLoaded = true; + // if (widget.isFromMyAppointments) { + // performNextAction(widget.appointment); + // widget.isFromMyAppointments = false; + // } + setState(() {}); + } else { + AppToast.showErrorToast(message: res['ErrorEndUserMessage']); + } + }).catchError((err) { + print(err); + GifLoaderDialogUtils.hideDialog(context); + err != null ?? AppToast.showErrorToast(message: err); + }); + } + getPatientAppointmentHistory() async { int languageID = projectViewModel.isArabic ? 1 : 2; GifLoaderDialogUtils.showMyDialog(context); @@ -867,11 +898,11 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { appoList.add(new AppoitmentAllHistoryResultList.fromJson(v)); }); } - if (res['AncillaryOrderList'].length != 0) { - res['AncillaryOrderList'].forEach((item) { - ancillaryLists.add(AncillaryOrdersListModel.fromJson(item)); - }); - } + // if (res['AncillaryOrderList'].length != 0) { + // res['AncillaryOrderList'].forEach((item) { + // ancillaryLists.add(AncillaryOrdersListModel.fromJson(item)); + // }); + // } dataLoaded = true; if (widget.isFromMyAppointments!) { performNextAction(widget.appointment!); @@ -1202,9 +1233,9 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { addAdvancedNumberRequestTamara("Tamara-Advance-0000", tamaraOrderID, appo.appointmentNo.toString(), appo); } }).catchError((err) { + GifLoaderDialogUtils.hideDialog(context); print(err); AppToast.showErrorToast(message: err); - GifLoaderDialogUtils.hideDialog(context); }); } catch (err) { print(err); diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 49beeddc..a4b431e4 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -308,6 +308,9 @@ class _LandingPageState extends State with WidgetsBindingObserver { : 2; familyFileProvider.getSharedRecordByStatus(languageID); } + // Future.delayed(Duration(seconds: 3)).then((result) async { + // LocalNotification.getInstance().showNow(title: "Payload Update", subtitle: "Payload Update", payload: "Payload Update"); + // }); }); PayfortViewModel payfortViewModel = context.read(); @@ -382,30 +385,21 @@ class _LandingPageState extends State with WidgetsBindingObserver { } else { // AppGlobal.context = context; GifLoaderDialogUtils.showMyDialog(context); - // - // authService - // .selectDeviceImei(DEVICE_TOKEN) - // .then((value) {}) - // .catchError((err) { - // print("error: ${err.toString()}"); - // GifLoaderDialogUtils.hideDialog(context); - // Navigator.of(context).pushNamed( - // WELCOME_LOGIN, - // ); - // }); - - int languageID = projectViewModel.isArabic ? 1 : 2; - - await authService.selectDeviceImei(DEVICE_TOKEN, languageID: languageID); - - var userData = await getUserInformation(); - if (apiStatus && userData != null) { + authService.selectDeviceImei(DEVICE_TOKEN).then((SelectDeviceIMEIRES? value) { GifLoaderDialogUtils.hideDialog(context); - Navigator.of(context).pushNamed(CONFIRM_LOGIN); - } else { + if (value != null) { + setUserValues(value); + Navigator.of(context).pushNamed(CONFIRM_LOGIN); + } else { + GifLoaderDialogUtils.hideDialog(context); + Navigator.of(context).pushNamed( + WELCOME_LOGIN, + ); + } + }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); Navigator.of(context).pushNamed(WELCOME_LOGIN); - } + }); } } diff --git a/lib/pages/livecare/widgets/LiveCareHistoryCard.dart b/lib/pages/livecare/widgets/LiveCareHistoryCard.dart index 61b6f64f..eecbfea6 100644 --- a/lib/pages/livecare/widgets/LiveCareHistoryCard.dart +++ b/lib/pages/livecare/widgets/LiveCareHistoryCard.dart @@ -237,9 +237,10 @@ class _LiveCareHistoryCardState extends State { } sendInvoiceEmail(context) { + int languageID = projectViewModel.isArabic ? 1 : 2; LiveCareService service = new LiveCareService(); GifLoaderDialogUtils.showMyDialog(context); - service.sendLiveCareInvoiceEmail(widget.erRequestHistoryList!.appointmentNo.toString(), widget.erRequestHistoryList!.projectID!, authUser.emailAddress!, context).then((res) { + service.sendLiveCareInvoiceEmail(widget.erRequestHistoryList!.appointmentNo.toString(), widget.erRequestHistoryList!.projectID!, authUser.emailAddress!, languageID, context).then((res) { GifLoaderDialogUtils.hideDialog(context); AppToast.showSuccessToast(message: TranslationBase.of(context).emailSentSuccessfully); }).catchError((err) { diff --git a/lib/pages/medical/eye/ContactLensPage.dart b/lib/pages/medical/eye/ContactLensPage.dart index ac10f22e..77ec5041 100644 --- a/lib/pages/medical/eye/ContactLensPage.dart +++ b/lib/pages/medical/eye/ContactLensPage.dart @@ -52,7 +52,7 @@ class ContactLensPage extends StatelessWidget { getRow('OZ', '${listHISGetContactLensPerscription!.oZ}'), getRow('CT', '${listHISGetContactLensPerscription!.cT}'), getRow('Blend', '${listHISGetContactLensPerscription!.blend}'), - getRow(TranslationBase.of(context).reminder, '${listHISGetContactLensPerscription!.remarks}', isLast: true), + getRow(TranslationBase.of(context).remarks, '${listHISGetContactLensPerscription!.remarks}', isLast: true), ], ), ), @@ -78,13 +78,13 @@ class ContactLensPage extends StatelessWidget { ), ), getRow(TranslationBase.of(context).brand, '${listHISGetContactLensPerscription!.brand}'), - getRow('B.C', '${listHISGetContactLensPerscription!.baseCurve}'), + getRow('B.C', '${listHISGetContactLensPerscription!.baseCurve!}'), getRow(TranslationBase.of(context).power, '${listHISGetContactLensPerscription!.power}'), getRow(TranslationBase.of(context).diameter, '${listHISGetContactLensPerscription!.diameter}'), getRow('OZ', '${listHISGetContactLensPerscription!.oZ}'), getRow('CT', '${listHISGetContactLensPerscription!.cT}'), getRow('Blend', '${listHISGetContactLensPerscription!.blend}'), - getRow(TranslationBase.of(context).reminder, '${listHISGetContactLensPerscription!.remarks}', isLast: true), + getRow(TranslationBase.of(context).remarks, '${listHISGetContactLensPerscription!.remarks}', isLast: true), ], ), ), diff --git a/lib/pages/medical/medical_profile_page_new.dart b/lib/pages/medical/medical_profile_page_new.dart index 2f61a795..e2a8f0af 100644 --- a/lib/pages/medical/medical_profile_page_new.dart +++ b/lib/pages/medical/medical_profile_page_new.dart @@ -32,7 +32,7 @@ class _MedicalProfilePageState extends State { var appoCountProvider = Provider.of(context); List myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel, context: context, count: appoCountProvider.count, isLogin: projectViewModel!.isLogin); return BaseView( - onModelReady: (model) => model.getAppointmentHistory(), + onModelReady: (model) => model.getAppointmentHistory(isForTimeLine: true), builder: (_, model, widget1) => AppScaffold( isShowDecPage: false, isShowAppBar: false, @@ -47,7 +47,7 @@ class _MedicalProfilePageState extends State { child: Column( crossAxisAlignment: CrossAxisAlignment.start, children: [ - TimeLineView(model.isLogin, projectViewModel!.isArabic, model.appoitmentAllHistoryResultList), + TimeLineView(model.isLogin, projectViewModel!.isArabic, model.appoitmentAllHistoryResultList, model), SizedBox( height: 20, ), diff --git a/lib/pages/medical/my_invoices/my_invoice_page.dart b/lib/pages/medical/my_invoices/my_invoice_page.dart index 92ad8ae9..2d287c39 100644 --- a/lib/pages/medical/my_invoices/my_invoice_page.dart +++ b/lib/pages/medical/my_invoices/my_invoice_page.dart @@ -124,7 +124,7 @@ class _MyInvoicesState extends State { GifLoaderDialogUtils.showMyDialog(context); MyInvoicesService myInvoicesService = new MyInvoicesService(); - myInvoicesService.getAllDentalAppointments(12, context).then((res) { + myInvoicesService.getAllDentalAppointments(0, context).then((res) { GifLoaderDialogUtils.hideDialog(context); setState(() { if (res['MessageStatus'] == 1) { diff --git a/lib/pages/medical/reports/report_list_widget.dart b/lib/pages/medical/reports/report_list_widget.dart index 2fa13b03..5eee4dfd 100644 --- a/lib/pages/medical/reports/report_list_widget.dart +++ b/lib/pages/medical/reports/report_list_widget.dart @@ -43,7 +43,6 @@ class ReportListWidget extends StatelessWidget { separatorBuilder: (context, index) => SizedBox(height: 14), itemBuilder: (context, index) { Reports report = reportList[index]; - logger.d(report.toJson()); return Container( decoration: BoxDecoration( borderRadius: BorderRadius.all( diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart index f9abb655..aaf30b97 100644 --- a/lib/services/appointment_services/GetDoctorsList.dart +++ b/lib/services/appointment_services/GetDoctorsList.dart @@ -396,7 +396,6 @@ class DoctorsListService extends BaseService { }, body: request); return Future.value(localRes); } catch (e) { - logger.d(e); return Future.error(e); } } @@ -1792,6 +1791,21 @@ class DoctorsListService extends BaseService { return Future.value(localRes); } + Future getAncillaryOrders() async { + Map body = Map(); + + hasError = false; + dynamic localRes; + await baseAppClient.post(GET_ANCILLARY_ORDERS, onSuccess: (dynamic response, int statusCode) { + localRes = response; + }, onFailure: (String error, int statusCode) { + hasError = true; + super.error = error; + }, body: body); + + return Future.value(localRes); + } + Future getPayfortSDKTokenForPayment(String deviceID, String signatureValue, {bool isTest = true}) async { Map request; request = {"service_command": "SDK_TOKEN", "access_code": "BsM6He4FMBaZ86W64kjZ", "merchant_identifier": "ipxnRXXq", "language": "en", "device_id": deviceID, "signature": signatureValue}; diff --git a/lib/services/authentication/auth_provider.dart b/lib/services/authentication/auth_provider.dart index e89a6741..f19bb7f5 100644 --- a/lib/services/authentication/auth_provider.dart +++ b/lib/services/authentication/auth_provider.dart @@ -183,7 +183,7 @@ class AuthProvider with ChangeNotifier { print( "Here response: ${response['Patient_SELECTDeviceIMEIbyIMEIList'][0]}"); if (response['Patient_SELECTDeviceIMEIbyIMEIList'][0] != null) { - apiStatus = true; + sharedPref.setObject( IMEI_USER_DATA, SelectDeviceIMEIRES.fromJson( diff --git a/lib/services/livecare_services/livecare_provider.dart b/lib/services/livecare_services/livecare_provider.dart index e2dd4d23..8b89047e 100644 --- a/lib/services/livecare_services/livecare_provider.dart +++ b/lib/services/livecare_services/livecare_provider.dart @@ -290,13 +290,13 @@ class LiveCareService extends BaseService { return Future.value(localRes); } - Future sendLiveCareInvoiceEmail(String appoNo, int projectID, String emailAddress, BuildContext context) async { + Future sendLiveCareInvoiceEmail(String appoNo, int projectID, String emailAddress, int languageID, BuildContext context) async { Map request; if (await this.sharedPref.getObject(USER_PROFILE) != null) { var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE)); authUser = data; } - request = {"To": emailAddress, "ProjectID": projectID, "AppointmentNo": appoNo}; + request = {"To": emailAddress, "ProjectID": projectID, "AppointmentNo": appoNo, "LanguageID": languageID}; dynamic localRes; await baseAppClient.post(SEND_LIVECARE_INVOICE_EMAIL, onSuccess: (response, statusCode) async { localRes = response; diff --git a/lib/splashPage.dart b/lib/splashPage.dart index b9e265ff..40194843 100644 --- a/lib/splashPage.dart +++ b/lib/splashPage.dart @@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/pages/landing/landing_page.dart'; import 'package:diplomaticquarterapp/theme/theme_notifier.dart'; import 'package:diplomaticquarterapp/theme/theme_value.dart'; +import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/push-notification-handler.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; @@ -39,6 +40,8 @@ class _SplashScreenState extends State { Duration(seconds: 1, milliseconds: 500), () async { await loadPrivilege().then((value) { + LocalNotification.init(onNotificationClick: (payload) {}); + // LocalNotification.getInstance().showNow(title: "Payload", subtitle: "Subtitle", payload: "Payload"); if(!_privilegeService.hasError) { Navigator.of(context).pushReplacement( MaterialPageRoute( diff --git a/lib/uitl/LocalNotification.dart b/lib/uitl/LocalNotification.dart index 9f6b4abf..0cdef6ca 100644 --- a/lib/uitl/LocalNotification.dart +++ b/lib/uitl/LocalNotification.dart @@ -31,25 +31,27 @@ class LocalNotification { _initialize() async { try { var initializationSettingsAndroid = new AndroidInitializationSettings('app_icon'); - // var initializationSettingsIOS = DarwinInitializationSettings(onDidReceiveLocalNotification: null); - // var initializationSettings = InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS); - // await flutterLocalNotificationsPlugin.initialize( - // initializationSettings, - // onDidReceiveNotificationResponse: (NotificationResponse notificationResponse) { - // switch (notificationResponse.notificationResponseType) { - // case NotificationResponseType.selectedNotification: - // // selectNotificationStream.add(notificationResponse.payload); - // break; - // case NotificationResponseType.selectedNotificationAction: - // // if (notificationResponse.actionId == navigationActionId) { - // // selectNotificationStream.add(notificationResponse.payload); - // // } - // break; - // } - // }, - // onDidReceiveBackgroundNotificationResponse: notificationTapBackground, - // ); - } catch (ex) {} + var initializationSettingsIOS = DarwinInitializationSettings(onDidReceiveLocalNotification: null); + var initializationSettings = InitializationSettings(android: initializationSettingsAndroid, iOS: initializationSettingsIOS); + await flutterLocalNotificationsPlugin.initialize( + initializationSettings, + onDidReceiveNotificationResponse: (NotificationResponse notificationResponse) { + switch (notificationResponse.notificationResponseType) { + case NotificationResponseType.selectedNotification: + // selectNotificationStream.add(notificationResponse.payload); + break; + case NotificationResponseType.selectedNotificationAction: + // if (notificationResponse.actionId == navigationActionId) { + // selectNotificationStream.add(notificationResponse.payload); + // } + break; + } + }, + // onDidReceiveBackgroundNotificationResponse: notificationTapBackground, + ); + } catch (ex) { + print(ex.toString()); + } // flutterLocalNotificationsPlugin.initialize(initializationSettings, onDidReceiveNotificationResponse: (NotificationResponse notificationResponse) // { // switch (notificationResponse.notificationResponseType) { @@ -96,15 +98,26 @@ class LocalNotification { } Future? showNow({required String title, required String subtitle, required String payload}) { - // Future.delayed(Duration(seconds: 1)).then((result) async { - // var androidPlatformChannelSpecifics = AndroidNotificationDetails('com.hmg.local_notification', 'HMG', - // channelDescription: 'HMG', importance: Importance.max, priority: Priority.high, ticker: 'ticker', vibrationPattern: _vibrationPattern()); - // var iOSPlatformChannelSpecifics = DarwinNotificationDetails(); - // var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics); - // await flutterLocalNotificationsPlugin.show(_randomNumber(), title, subtitle, platformChannelSpecifics, payload: payload).catchError((err) { - // print(err); - // }); - // }); + Future.delayed(Duration(seconds: 1)).then((result) async { + var androidPlatformChannelSpecifics = AndroidNotificationDetails( + 'com.hmg.local_notification', + 'HMG', + channelDescription: 'HMG', + importance: Importance.max, + priority: Priority.high, + ticker: 'ticker', + vibrationPattern: _vibrationPattern(), + ongoing: true, + autoCancel: false, + usesChronometer: true, + when: DateTime.now().millisecondsSinceEpoch - 120 * 1000, + ); + var iOSPlatformChannelSpecifics = DarwinNotificationDetails(); + var platformChannelSpecifics = NotificationDetails(android: androidPlatformChannelSpecifics, iOS: iOSPlatformChannelSpecifics); + await flutterLocalNotificationsPlugin.show(25613, title, subtitle, platformChannelSpecifics, payload: payload).catchError((err) { + print(err); + }); + }); } Future scheduleNotification({required DateTime scheduledNotificationDateTime, required String title, required String description}) async { @@ -115,7 +128,7 @@ class LocalNotification { vibrationPattern[2] = 5000; vibrationPattern[3] = 2000; - // var androidPlatformChannelSpecifics = AndroidNotificationDetails('active-prescriptions', 'ActivePrescriptions', + // var androidPlatformChannelSpecifics = AndroidNotificationDetails('active-prescriptions', 'ActivePrescriptions', // channelDescription: 'ActivePrescriptionsDescription', // // icon: 'secondary_icon', // sound: RawResourceAndroidNotificationSound('slow_spring_board'), diff --git a/lib/uitl/gif_loader_dialog_utils.dart b/lib/uitl/gif_loader_dialog_utils.dart index 304dda51..31d03c52 100644 --- a/lib/uitl/gif_loader_dialog_utils.dart +++ b/lib/uitl/gif_loader_dialog_utils.dart @@ -3,15 +3,43 @@ import 'package:flutter/material.dart'; import '../widgets/Loader/gif_loader_container.dart'; class GifLoaderDialogUtils { - static showMyDialog(BuildContext context) { - showDialog(context: context, builder: (cxt) => GifLoaderContainer()); + static bool _isLoadingVisible = false; + + static bool get isLoading => _isLoadingVisible; + + static showMyDialog(BuildContext context, {bool barrierDismissible = true}) { + // showDialog(context: context, builder: (cxt) => GifLoaderContainer()); + WidgetsBinding.instance.addPostFrameCallback((_) { + _isLoadingVisible = true; + showDialog( + barrierDismissible: barrierDismissible, + context: context, + barrierColor: Colors.black.withOpacity(0.5), + useRootNavigator: false, + builder: (BuildContext context) => GifLoaderContainer(barrierDismissible: barrierDismissible,), + ).then((value) { + _isLoadingVisible = false; + }); + }); } static hideDialog(BuildContext context) { try { - Navigator.of(context, rootNavigator: true).pop(); + + if (_isLoadingVisible) { + _isLoadingVisible = false; + Navigator.of(context).pop(); + } + _isLoadingVisible = false; + // Navigator.of(context, rootNavigator: true).canPop(); } catch (error) { - Future.delayed(Duration(milliseconds: 250)).then((value) => Navigator.of(context, rootNavigator: true).canPop()); + //Future.delayed(Duration(milliseconds: 250)).then((value) => Navigator.of(context, rootNavigator: true).canPop()); + // Future.delayed(Duration(milliseconds: 250)).then((value) => Navigator.of(context, rootNavigator: true).canPop()); + if (_isLoadingVisible) { + _isLoadingVisible = false; + Navigator.of(context).pop(); + } + _isLoadingVisible = false; } } } \ No newline at end of file diff --git a/lib/uitl/translations_delegate_base.dart b/lib/uitl/translations_delegate_base.dart index 0ec49e9f..6e4ad3c1 100644 --- a/lib/uitl/translations_delegate_base.dart +++ b/lib/uitl/translations_delegate_base.dart @@ -2959,6 +2959,7 @@ class TranslationBase { String get upcoming => localizedValues["upcoming"][locale.languageCode]; String get noUpcomingAppointment => localizedValues["noUpcomingAppointment"][locale.languageCode]; String get locationTimeoutError => localizedValues["locationTimeoutError"][locale.languageCode]; + String get loadMore => localizedValues["loadMore"][locale.languageCode]; } diff --git a/lib/widgets/Loader/gif_loader_container.dart b/lib/widgets/Loader/gif_loader_container.dart index f19b1594..ccc986c7 100644 --- a/lib/widgets/Loader/gif_loader_container.dart +++ b/lib/widgets/Loader/gif_loader_container.dart @@ -2,6 +2,10 @@ import 'package:flutter/cupertino.dart'; import 'package:gif_view/gif_view.dart'; class GifLoaderContainer extends StatefulWidget { + bool barrierDismissible; + + GifLoaderContainer({this.barrierDismissible = true}); + @override _GifLoaderContainerState createState() => _GifLoaderContainerState(); } @@ -30,15 +34,20 @@ class _GifLoaderContainerState extends State with TickerProv @override Widget build(BuildContext context) { - return Center( + return WillPopScope( + onWillPop: () async { + return widget.barrierDismissible; + }, + child: Center( //progress-loading.gif child: Container( - // margin: EdgeInsets.only(bottom: 40), - child: GifView.asset( - 'assets/images/progress-loading-red.gif', - controller: controller, - // image: AssetImage("assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), + // margin: EdgeInsets.only(bottom: 40), + child: GifView( + controller: controller, + image: AssetImage("assets/images/progress-loading-red.gif"), //NetworkImage("http://img.mp.itc.cn/upload/20161107/5cad975eee9e4b45ae9d3c1238ccf91e.jpg"), + ), + ), ), - )); + ); } } diff --git a/lib/widgets/data_display/medical/time_line_new_widget.dart b/lib/widgets/data_display/medical/time_line_new_widget.dart index af2386bf..f6414f4b 100644 --- a/lib/widgets/data_display/medical/time_line_new_widget.dart +++ b/lib/widgets/data_display/medical/time_line_new_widget.dart @@ -2,6 +2,7 @@ import 'package:auto_size_text/auto_size_text.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; +import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart'; import 'package:diplomaticquarterapp/models/Authentication/select_device_imei_res.dart'; @@ -25,8 +26,9 @@ import 'package:provider/provider.dart'; class TimeLineView extends StatefulWidget { bool isLogged, isArabic; List appoitmentAllHistoryResultList; + MedicalViewModel medicalViewModel; - TimeLineView(this.isLogged, this.isArabic, this.appoitmentAllHistoryResultList); + TimeLineView(this.isLogged, this.isArabic, this.appoitmentAllHistoryResultList, this.medicalViewModel); @override _TimeLineViewState createState() => _TimeLineViewState(); @@ -40,19 +42,24 @@ class _TimeLineViewState extends State { final authService = auth.AuthProvider(); + ProjectViewModel? projectViewModel; + + @override + void dispose() { + super.dispose(); + } + @override void initState() { super.initState(); - // selectedDateObj = DateObj(DateTime.august, 2021, 2021.toString()); - dateObjs.add(DateObj(0, 0, widget.isArabic ? "الكل" : "All")); - for (int i = 0; i < widget.appoitmentAllHistoryResultList.length; i++) { - tempList.add(widget.appoitmentAllHistoryResultList[i]); - dateObjs.add( - DateObj( - DateUtil.convertStringToDate(widget.appoitmentAllHistoryResultList[i].appointmentDate!).month, - DateUtil.convertStringToDate(widget.appoitmentAllHistoryResultList[i].appointmentDate!).year, + dateObjs.add(new DateObj(0, 0, widget.isArabic ? "الكل" : "All")); + for (int i = 0; i < widget.medicalViewModel.appoitmentAllHistoryResultList.length; i++) { + tempList.add(widget.medicalViewModel.appoitmentAllHistoryResultList[i]); + dateObjs.add(new DateObj( + DateUtil.convertStringToDate(widget.medicalViewModel.appoitmentAllHistoryResultList[i].appointmentDate).month, + DateUtil.convertStringToDate(widget.medicalViewModel.appoitmentAllHistoryResultList[i].appointmentDate).year, DateUtil.getMonthYearLangDateFormatted( - DateUtil.convertStringToDate(widget.appoitmentAllHistoryResultList[i].appointmentDate!), + DateUtil.convertStringToDate(widget.medicalViewModel.appoitmentAllHistoryResultList[i].appointmentDate), widget.isArabic ? "ar" : "en", ), ), @@ -71,17 +78,17 @@ class _TimeLineViewState extends State { applyFilter(bool isAll) { tempList.clear(); if (isAll) { - for (int i = 0; i < widget.appoitmentAllHistoryResultList.length; i++) { - tempList.add(widget.appoitmentAllHistoryResultList[i]); + for (int i = 0; i < widget.medicalViewModel.appoitmentAllHistoryResultList.length; i++) { + tempList.add(widget.medicalViewModel.appoitmentAllHistoryResultList[i]); } } else { - for (int i = 0; i < widget.appoitmentAllHistoryResultList.length; i++) { + for (int i = 0; i < widget.medicalViewModel.appoitmentAllHistoryResultList.length; i++) { if (DateUtil.getMonthYearLangDateFormatted( - DateUtil.convertStringToDate(widget.appoitmentAllHistoryResultList[i].appointmentDate!), + DateUtil.convertStringToDate(widget.medicalViewModel.appoitmentAllHistoryResultList[i].appointmentDate), widget.isArabic ? "ar" : "en", ) == selectedDateObj!.monthYear) { - tempList.add(widget.appoitmentAllHistoryResultList[i]); + tempList.add(widget.medicalViewModel.appoitmentAllHistoryResultList[i]); } } } @@ -90,6 +97,7 @@ class _TimeLineViewState extends State { @override Widget build(BuildContext context) { + projectViewModel = Provider.of(context); return Container( width: double.infinity, height: 210, @@ -172,27 +180,70 @@ class _TimeLineViewState extends State { ), mFlex(1), widget.isLogged - ? Container( - height: widget.isArabic ? 130 : 110, - width: double.infinity, - child: ListView.separated( - itemBuilder: (context, index) => Padding( - padding: widget.isArabic - ? EdgeInsets.only(left: index == 0 ? 0 : 12, right: (tempList.length - 1) == index ? 0 : 12) - : EdgeInsets.only(left: index == 0 ? 12 : 0, right: (tempList.length - 1) == index ? 12 : 0), - child: TimelineNewWidget( - appoitmentAllHistoryResul: tempList[index], - isLast: tempList.length - 1 == index ? true : false, + ? Row( + children: [ + Container( + height: widget.isArabic ? 130 : 110, + // width: double.infinity, + width: MediaQuery.of(context).size.width, + child: ListView.separated( + itemBuilder: (context, index) => Padding( + padding: widget.isArabic + ? EdgeInsets.only(left: index == 0 ? 0 : 12, right: (tempList.length - 1) == index ? 0 : 12) + : EdgeInsets.only(left: index == 0 ? 12 : 0, right: (tempList.length - 1) == index ? 12 : 0), + child: index < tempList.length + ? TimelineNewWidget( + appoitmentAllHistoryResul: tempList[index], + isLast: tempList.length - 1 == index ? true : false, + ) + : !projectViewModel!.isAllAppointmentsLoaded + ? InkWell( + onTap: () async { + await sharedPref.remove(APPOINTMENT_HISTORY_MEDICAL); + widget.medicalViewModel.getAppointmentHistory(isForTimeLine: false); + projectViewModel!.setIsAllAppointmentsLoaded(true); + }, + child: Row( + children: [ + Column( + crossAxisAlignment: CrossAxisAlignment.center, + children: [ + mHeight(22.0), + Container( + child: Icon( + Icons.arrow_forward_outlined, + color: CustomColors.white, + size: 30, + ), + ), + mHeight(6.0), + Text( + TranslationBase.of(context).loadMore, + style: TextStyle( + color: CustomColors.white, + fontSize: 10, + fontWeight: FontWeight.w600, + letterSpacing: -0.36, + ), + ), + ], + ), + mWidth(24.0) + ], + ), + ) + : Container(), + ), + itemCount: (tempList.length + 1), + scrollDirection: Axis.horizontal, + shrinkWrap: false, + physics: BouncingScrollPhysics(), + separatorBuilder: (BuildContext context, int index) { + return index < tempList.length ? mWidth(8) : Container(); + }, ), ), - itemCount: tempList.length, - scrollDirection: Axis.horizontal, - shrinkWrap: false, - physics: BouncingScrollPhysics(), - separatorBuilder: (BuildContext context, int index) { - return mWidth(8); - }, - ), + ], ) : Container(), ], @@ -251,7 +302,7 @@ class _TimeLineViewState extends State { height: MediaQuery.of(context).size.width / 14, width: MediaQuery.of(context).size.width / (widget.isArabic ? 4 : 6), child: CustomTextButton( - // shape: cardRadiusNew(8), + shape: cardRadiusNew(8), elevation: 0, backgroundColor: Color(0xFFFBF2E31), onPressed: () { @@ -323,7 +374,7 @@ class TimelineNewWidget extends StatelessWidget { Widget build(BuildContext context) { ProjectViewModel projectViewModel = Provider.of(context); return Container( - width: MediaQuery.of(context).size.width / 2.3, + width: isLast! ? MediaQuery.of(context).size.width / 3.5 : MediaQuery.of(context).size.width / 2.5, child: Column( crossAxisAlignment: CrossAxisAlignment.start, mainAxisSize: MainAxisSize.min, diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index d6cabbf0..5aa48c9a 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -341,6 +341,7 @@ class _AppDrawerState extends State { sharedPref.remove(APPOINTMENT_HISTORY_MEDICAL); sharedPref.remove(CLINICS_LIST); sharedPref.setBool(IS_ROBOT_INIT, false); + projectProvider!.setIsAllAppointmentsLoaded(false); if (projectProvider!.isArabic) { projectProvider!.changeLanguage('en'); locator().hamburgerMenu.logMenuItemClick('change language to english'); @@ -614,6 +615,7 @@ class _AppDrawerState extends State { await sharedPref.clear(); await sharedPref.setString(APP_LANGUAGE, appLanguage); await sharedPref.remove(APPOINTMENT_HISTORY_MEDICAL); + projectProvider!.setIsAllAppointmentsLoaded(false); this.user = null; Navigator.of(context).pushNamed(HOME); locator().hamburgerMenu.logMenuItemClick('logout');