diff --git a/lib/analytics/flows/login_registration.dart b/lib/analytics/flows/login_registration.dart index aee26a5e..4134e9fd 100644 --- a/lib/analytics/flows/login_registration.dart +++ b/lib/analytics/flows/login_registration.dart @@ -3,6 +3,8 @@ import 'package:flutter/cupertino.dart'; import '../google-analytics.dart'; class LoginRegistration{ + static int loginMethod; + static int verificationMethod; final GALogger logger; LoginRegistration(this.logger); @@ -66,20 +68,29 @@ class LoginRegistration{ } // R011:login_verify_otp | R009:registration_verification_option - verify_otp_method({@required int method, bool forRegistration = false}){ - var verification_method = ''; - if(method == 1) verification_method = 'sms'; - if(method == 2) verification_method = 'fingerprint'; - if(method == 3) verification_method = 'face id'; - if(method == 4) verification_method = 'whatsapp'; - + verify_otp_method({bool forRegistration = false}){ if(forRegistration == false) logger("login_verify_otp", parameters: { - 'login_method' : verification_method + 'login_method' : _getLoginMethod(), + 'verification_method' : _getVerificationMethod(), }); else logger("registration_verification_option", parameters: { - 'verification_method' : verification_method + 'verification_method' : _getVerificationMethod() + }); + } + + // R011:login_verify_otp | R009:registration_verification_option + login_verfication({bool forRegistration = false}){ + if(forRegistration == false) + logger("login_verfication", parameters: { + 'login_method' : _getLoginMethod(), + 'verification_method' : _getVerificationMethod(), + }); + else + logger("login_varification_register", parameters: { + 'login_method' : _getLoginMethod(), + 'verification_method' : _getVerificationMethod(), }); } @@ -94,14 +105,9 @@ class LoginRegistration{ } // R012.1, R014.1 - login_successful({@required int method}){ - var verification_method = ''; - if(method == 1) verification_method = 'sms'; - if(method == 2) verification_method = 'fingerprint'; - if(method == 3) verification_method = 'face id'; - if(method == 4) verification_method = 'whatsapp'; + login_successful(){ logger('login_successful', parameters: { - 'login_method' : verification_method + 'login_method' : _getVerificationMethod() }); } @@ -112,9 +118,9 @@ class LoginRegistration{ }); } - login_fail({@required String method, error}){ + login_fail({error}){ logger('login_unsuccessful', parameters: { - 'login_method' : method, + 'login_method' : loginMethod, 'error': error }); } @@ -128,4 +134,19 @@ class LoginRegistration{ login_with_other_account(){ logger('login_with_other_account'); } + + + _getLoginMethod(){ + if(loginMethod == 1) return 'national id'; + if(loginMethod == 2) return 'file number'; + return 'otp'; + } + + String _getVerificationMethod(){ + if(verificationMethod == 1) return 'sms'; + if(verificationMethod == 2) return 'fingerprint'; + if(verificationMethod == 3) return 'face id'; + if(verificationMethod == 4) return 'whatsapp'; + return "unknown"; + } } \ No newline at end of file diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart index 706a51d9..49404c6d 100644 --- a/lib/pages/BookAppointment/BookConfirm.dart +++ b/lib/pages/BookAppointment/BookConfirm.dart @@ -271,19 +271,18 @@ class _BookConfirmState extends State { insertAppointment(context, DoctorList docObject, int initialSlotDuration) { final timeSlot = DocAvailableAppointments.selectedAppoDateTime; - projectViewModel.analytics.appointment.book_appointment_click_confirm(appointment_type: 'regular', dateTime: timeSlot, doctor: widget.doctor); GifLoaderDialogUtils.showMyDialog(context); AppoitmentAllHistoryResultList appo; widget.service.insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, widget.selectedTime, widget.selectedDate, initialSlotDuration, context, null, null, null, projectViewModel).then((res) { if (res['MessageStatus'] == 1) { - projectViewModel.analytics.appointment.book_appointment_confirmation_success(appointment_type: 'regular', dateTime: timeSlot, doctor: widget.doctor); AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); Future.delayed(new Duration(milliseconds: 500), () { getPatientShare(context, res['AppointmentNo'], docObject.clinicID, docObject.projectID, docObject); getToDoCount(); }); + projectViewModel.analytics.appointment.book_appointment_confirmation_success(appointment_type: 'regular', dateTime: timeSlot, doctor: widget.doctor); } else { GifLoaderDialogUtils.hideDialog(context); appo = new AppoitmentAllHistoryResultList(); @@ -312,17 +311,16 @@ class _BookConfirmState extends State { AppToast.showErrorToast(message: err); print(err); }); + projectViewModel.analytics.appointment.book_appointment_click_confirm(appointment_type: 'regular', dateTime: timeSlot, doctor: widget.doctor); } insertLiveCareScheduledAppointment(context, DoctorList docObject) { final timeSlot = DocAvailableAppointments.selectedAppoDateTime; - projectViewModel.analytics.appointment.book_appointment_click_confirm(appointment_type: 'livecare', dateTime: timeSlot, doctor: widget.doctor); GifLoaderDialogUtils.showMyDialog(context); AppoitmentAllHistoryResultList appo; widget.service.insertLiveCareScheduleAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, docObject.serviceID, widget.selectedTime, widget.selectedDate, context).then((res) { if (res['MessageStatus'] == 1) { - projectViewModel.analytics.appointment.book_appointment_confirmation_success(appointment_type: 'livecare', dateTime: timeSlot, doctor: widget.doctor); AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess); print(res['AppointmentNo']); @@ -330,6 +328,7 @@ class _BookConfirmState extends State { 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); } else { GifLoaderDialogUtils.hideDialog(context); appo = new AppoitmentAllHistoryResultList(); @@ -358,6 +357,8 @@ class _BookConfirmState extends State { AppToast.showErrorToast(message: err); print(err); }); + + projectViewModel.analytics.appointment.book_appointment_click_confirm(appointment_type: 'livecare', dateTime: timeSlot, doctor: widget.doctor); } getToDoCount() { diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart index f32dba0a..5132f118 100644 --- a/lib/pages/BookAppointment/BookSuccess.dart +++ b/lib/pages/BookAppointment/BookSuccess.dart @@ -198,8 +198,8 @@ class _BookSuccessState extends State { disabledTextColor: Colors.white, disabledColor: new Color(0xFFbcc2c4), onPressed: () { - projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: true); startPaymentProcess(); + projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: true); }, child: Text(TranslationBase.of(context).payNow.toUpperCase(), style: TextStyle(fontSize: 18.0)), ), @@ -220,8 +220,8 @@ class _BookSuccessState extends State { disabledTextColor: Colors.white, disabledColor: new Color(0xFFbcc2c4), onPressed: () { - projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: false); navigateToHome(context); + projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: false); }, child: Text(TranslationBase.of(context).payLater.toUpperCase(), style: TextStyle(fontSize: 18.0)), ), @@ -538,8 +538,8 @@ class _BookSuccessState extends State { setState(() {}); }))).then((value) { if (value != null) { - projectViewModel.analytics.appointment.payment_method(appointment_type: 'regular', clinic: widget.docObject.clinicName, payment_method: value[0], payment_type: 'appointment'); openPayment(value, authUser, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); + projectViewModel.analytics.appointment.payment_method(appointment_type: 'regular', clinic: widget.docObject.clinicName, payment_method: value[0], payment_type: 'appointment'); } }); } @@ -604,9 +604,9 @@ class _BookSuccessState extends State { String amount = res['Amount']; String payment_method = res['PaymentMethod']; final currency = projectViewModel.user.outSA == 0 ? "sar" : 'aed'; + createAdvancePayment(res, appo); projectViewModel.analytics.appointment.payment_success( appointment_type: 'regular', payment_method: payment_method, clinic: appo.clinicName, hospital: appo.projectName, txn_amount: "$amount", txn_currency: currency, txn_number: txn_ref); - createAdvancePayment(res, appo); } else { GifLoaderDialogUtils.hideDialog(context); AppToast.showErrorToast(message: res['Response_Message']); diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart index eea41c4d..9b0bdae3 100644 --- a/lib/pages/BookAppointment/DoctorProfile.dart +++ b/lib/pages/BookAppointment/DoctorProfile.dart @@ -127,7 +127,6 @@ class _DoctorProfileState extends State with TickerProviderStateM showConfirmMessageDialog: false, isNeedToShowButton: !widget.isLiveCareAppointment, onTap: () { - projectViewModel.analytics.appointment.book_appointment_schedule(appointment_type: 'regular', doctor: widget.doctor); Navigator.push( context, FadePage( @@ -142,6 +141,7 @@ class _DoctorProfileState extends State with TickerProviderStateM this.doctorSchedule = value; }); }); + projectViewModel.analytics.appointment.book_appointment_schedule(appointment_type: 'regular', doctor: widget.doctor); }, onRatingAndReviewTap: () { getDoctorRatingsDetails(); @@ -497,8 +497,8 @@ class _DoctorProfileState extends State with TickerProviderStateM if (DocAvailableAppointments.areSlotsAvailable) { if (await sharedPref.getObject(USER_PROFILE) != null) { final timeSlot = DocAvailableAppointments.selectedAppoDateTime; - projectViewModel.analytics.appointment.book_appointment_review(appointment_type: 'regular', dateTime: timeSlot, doctor: widget.doctor); navigateToBookConfirm(context); + projectViewModel.analytics.appointment.book_appointment_review(appointment_type: 'regular', dateTime: timeSlot, doctor: widget.doctor); } else { ConfirmDialog dialog = new ConfirmDialog( context: context, diff --git a/lib/pages/BookAppointment/book_reminder_page.dart b/lib/pages/BookAppointment/book_reminder_page.dart index 8085976c..e7971423 100644 --- a/lib/pages/BookAppointment/book_reminder_page.dart +++ b/lib/pages/BookAppointment/book_reminder_page.dart @@ -175,8 +175,8 @@ class _BookReminderPageState extends State { disabledTextColor: Colors.white, disabledColor: new Color(0xFFEAEAEA), onPressed: () { - projectViewModel.analytics.appointment.appointment_reminder(false); navigateToBookSuccess(context); + projectViewModel.analytics.appointment.appointment_reminder(false); }, child: Text(TranslationBase.of(context).no, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48)), ), @@ -197,7 +197,6 @@ class _BookReminderPageState extends State { disabledTextColor: Colors.white, disabledColor: CustomColors.green, onPressed: () async { - projectViewModel.analytics.appointment.appointment_reminder(true); print(widget.patientShareResponse.appointmentNo); showReminderDialog( context, @@ -211,6 +210,7 @@ class _BookReminderPageState extends State { navigateToBookSuccess(context); }, ); + projectViewModel.analytics.appointment.appointment_reminder(true); }, child: Text(TranslationBase.of(context).yes, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48)), ), diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart index d7d78d89..89a2a587 100644 --- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart +++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart @@ -262,13 +262,13 @@ class _DocAvailableAppointmentsState extends State wit onPressed: () { final timeslot = dayEvents[index]; DocAvailableAppointments.selectedAppoDateTime = timeslot.end; - projectViewModel.analytics.appointment.book_appointment_time_selection(appointment_type: 'regular', dateTime: timeslot.end, doctor: widget.doctor); setState(() { selectedButtonIndex = index; DocAvailableAppointments.selectedTime = dayEvents[index].isoTime; print(DocAvailableAppointments.selectedTime); }); + projectViewModel.analytics.appointment.book_appointment_time_selection(appointment_type: 'regular', dateTime: timeslot.end, doctor: widget.doctor); }, child: Text(dayEvents[index].isoTime, style: TextStyle(fontSize: 12.0)), ); diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart index 1b8641a0..8c11386a 100644 --- a/lib/pages/BookAppointment/components/SearchByClinic.dart +++ b/lib/pages/BookAppointment/components/SearchByClinic.dart @@ -230,7 +230,6 @@ class _SearchByClinicState extends State { onTap: () { showClickListDialog(context, clinicsList, onSelection: (ListClinicCentralized clincs) { selectedClinic = clincs; - projectViewModel.analytics.appointment.book_appointment_select_clinic(appointment_type: 'regular', clinic: clincs.clinicDescription); Navigator.pop(context); setState(() { dropdownTitle = clincs.clinicDescription; @@ -244,6 +243,7 @@ class _SearchByClinicState extends State { } else { } }); + projectViewModel.analytics.appointment.book_appointment_select_clinic(appointment_type: 'regular', clinic: clincs.clinicDescription); }); }, child: Container( diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart index 836bae7d..05e0ddc1 100644 --- a/lib/pages/BookAppointment/components/SearchByDoctor.dart +++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart @@ -147,8 +147,8 @@ class _SearchByDoctorState extends State { } _searchDoctor(BuildContext context) { - projectViewModel.analytics.appointment.book_appointment_doctor_search(query: doctorNameController.text); getDoctorsList(context); + projectViewModel.analytics.appointment.book_appointment_doctor_search(query: doctorNameController.text); } navigateToSearchResults(context, List docList, List patientDoctorAppointmentListHospital) { diff --git a/lib/pages/BookAppointment/widgets/reminder_dialog.dart b/lib/pages/BookAppointment/widgets/reminder_dialog.dart index 89ce6699..d3ae44ab 100644 --- a/lib/pages/BookAppointment/widgets/reminder_dialog.dart +++ b/lib/pages/BookAppointment/widgets/reminder_dialog.dart @@ -77,7 +77,6 @@ Future _showReminderDialog(BuildContext context, DateTime dateTime, String text = "2 hours"; } - locator().appointment.appointment_reminder_time(reminde_before: text); if (onMultiDateSuccess == null) { CalendarUtils calendarUtils = await CalendarUtils.getInstance(); calendarUtils @@ -92,6 +91,7 @@ Future _showReminderDialog(BuildContext context, DateTime dateTime, String } else { onMultiDateSuccess(i); } + locator().appointment.appointment_reminder_time(reminde_before: text); }, ), ); diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart index d4a1d367..f235c8b1 100644 --- a/lib/pages/MyAppointments/AppointmentDetails.dart +++ b/lib/pages/MyAppointments/AppointmentDetails.dart @@ -572,9 +572,9 @@ class _AppointmentDetailsState extends State with SingleTick service.confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID, widget.appo.projectID, widget.appo.isLiveCareAppointment, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { - projectViewModel.analytics.appointment.appointment_details_confirm(appointment: widget.appo); AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); Navigator.of(context).pop(); + projectViewModel.analytics.appointment.appointment_details_confirm(appointment: widget.appo); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } @@ -605,7 +605,6 @@ class _AppointmentDetailsState extends State with SingleTick GifLoaderDialogUtils.showMyDialog(context); DoctorsListService service = new DoctorsListService(); service.cancelAppointment(widget.appo, context).then((res) { - projectViewModel.analytics.appointment.appointment_details_cancel(appointment: widget.appo); GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { checkIfHasReminder(); @@ -615,6 +614,7 @@ class _AppointmentDetailsState extends State with SingleTick } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } + projectViewModel.analytics.appointment.appointment_details_cancel(appointment: widget.appo); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); diff --git a/lib/pages/MyAppointments/SchedulePage.dart b/lib/pages/MyAppointments/SchedulePage.dart index 17cae84e..c84f4760 100644 --- a/lib/pages/MyAppointments/SchedulePage.dart +++ b/lib/pages/MyAppointments/SchedulePage.dart @@ -98,8 +98,8 @@ class _SchedulePageState extends State { itemBuilder: (context, index2) => InkWell( onTap: () { final weekDay = weeks[index][index2]['DayName']; - projectViewModel.analytics.appointment.book_appointment_date_selection(appointment_type: 'regular', day: weekDay, doctor: doctorList); openBookAppointment(weeks[index][index2]); + projectViewModel.analytics.appointment.book_appointment_date_selection(appointment_type: 'regular', day: weekDay, doctor: doctorList); }, child: Row( children: [ diff --git a/lib/pages/MyAppointments/widgets/AppointmentActions.dart b/lib/pages/MyAppointments/widgets/AppointmentActions.dart index 34192260..7d9a82ae 100644 --- a/lib/pages/MyAppointments/widgets/AppointmentActions.dart +++ b/lib/pages/MyAppointments/widgets/AppointmentActions.dart @@ -98,18 +98,17 @@ class _AppointmentActionsState extends State { _handleButtonClicks(AppoDetailsButton, ToDoCountProviderModel model) { switch (AppoDetailsButton.caller) { case "openReschedule": - locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'reschedule appointment'); widget.tabController.animateTo((widget.tabController.index + 1) % 2); setState(() { widget.enableFooterButton(); }); + locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'reschedule appointment'); break; case "navigateToProject": - locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'hospital location'); openMap(double.parse(widget.appo.latitude), double.parse(widget.appo.longitude)); + locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'hospital location'); break; case "addReminder": - locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'add reminder'); showReminderDialog( context, DateUtil.convertStringToDate(widget.appo.appointmentDate), @@ -121,45 +120,46 @@ class _AppointmentActionsState extends State { AppToast.showSuccessToast(message: TranslationBase.of(context).reminderSuccess); }, ); + locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'add reminder'); break; case "goToTodoList": // Navigator.of(context).pop(); - locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'todo list'); navigateToToDoPage(context, model); + locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'todo list'); break; case "askDoc": - locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'ask doctor'); askYourDoc(); + locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'ask doctor'); break; case "radiology": - locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'radiology'); openAppointmentRadiology(); + locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'radiology'); break; case "labResult": - locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'lab result'); openAppointmentLabResults(); + locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'lab result'); break; case "prescriptions": - locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'prescriptions'); openPrescriptionReport(); + locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'prescriptions'); break; case "Survey": - locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'survey'); rateAppointment(); + locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'survey'); break; case "Insurance": - locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'insurance'); navigateToInsuranceApprovals(widget.appo.appointmentNo); + locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'insurance'); break; case "VitalSigns": - locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'vital sign'); navigateToVitalSigns(widget.appo.appointmentNo, widget.appo.projectID); + locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'vital sign'); break; case "insertComplaint": - locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'raise complaint'); navigateToInsertComplaint(); + locator().appointment.appointment_detail_action(appointment: widget.appo, action: 'raise complaint'); break; } } diff --git a/lib/pages/ToDoList/ToDo.dart b/lib/pages/ToDoList/ToDo.dart index 6bca1ad9..657829a8 100644 --- a/lib/pages/ToDoList/ToDo.dart +++ b/lib/pages/ToDoList/ToDo.dart @@ -640,11 +640,11 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { } Future navigateToAppointmentDetails(context, AppoitmentAllHistoryResultList appo) async { - projectViewModel.analytics.todoList.to_do_list_more_details(appo); GAnalytics.APPOINTMENT_DETAIL_FLOW_TYPE = 'todo list'; Navigator.push(context, FadePage(page: AppointmentDetails(appo: appo, parentIndex: appo.patientStatusType == 42 ? 1 : 0))).then((value) { getPatientAppointmentHistory(); }); + projectViewModel.analytics.todoList.to_do_list_more_details(appo); } getOBGyneOrdersList() { @@ -798,8 +798,8 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { DoctorsListService service = new DoctorsListService(); service.generateAppointmentQR(patientShareResponse, context).then((res) { GifLoaderDialogUtils.hideDialog(context); - projectViewModel.analytics.todoList.to_do_list_check_in(appo); navigateToQR(context, res['AppointmentQR'], patientShareResponse, appo); + projectViewModel.analytics.todoList.to_do_list_check_in(appo); }).catchError((err) { GifLoaderDialogUtils.hideDialog(context); print(err); @@ -813,7 +813,6 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { } openPaymentDialog(AppoitmentAllHistoryResultList appo, PatientShareResponse patientShareResponse) { - projectViewModel.analytics.todoList.to_do_list_pay_now(appo); showGeneralDialog( barrierColor: Colors.black.withOpacity(0.5), transitionBuilder: (context, a1, a2, widget) { @@ -833,12 +832,14 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { pageBuilder: (context, animation1, animation2) {}) .then((value) { if (value != null) { - projectViewModel.analytics.todoList.to_do_list_confirm_payment_details(appo); navigateToPaymentMethod(context, value, appo); + projectViewModel.analytics.todoList.to_do_list_confirm_payment_details(appo); } else { projectViewModel.analytics.todoList.to_do_list_cancel_payment_details(appo); } }); + + projectViewModel.analytics.todoList.to_do_list_pay_now(appo); } openPayment(List paymentMethod, AuthenticatedUser authenticatedUser, double amount, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appo) { @@ -959,8 +960,8 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { if (value != null) { final appType = appo.isLiveCareAppointment ? 'livecare' : 'regular'; - projectViewModel.analytics.appointment.payment_method(appointment_type: appType, clinic: appo.clinicName, payment_method: value[0], payment_type: 'appointment'); openPayment(value, projectViewModel.user, double.parse(patientShareResponse.patientShareWithTax.toString()), patientShareResponse, appo); + projectViewModel.analytics.appointment.payment_method(appointment_type: appType, clinic: appo.clinicName, payment_method: value[0], payment_type: 'appointment'); } }); } @@ -971,13 +972,13 @@ class _ToDoState extends State with SingleTickerProviderStateMixin { service.confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID, appo.isLiveCareAppointment, context).then((res) { GifLoaderDialogUtils.hideDialog(context); if (res['MessageStatus'] == 1) { - projectViewModel.analytics.todoList.to_do_list_confirm_appointment(appo); AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); if (appo.isLiveCareAppointment) { insertLiveCareVIDARequest(appo); } else { getPatientAppointmentHistory(); } + projectViewModel.analytics.todoList.to_do_list_confirm_appointment(appo); } else { AppToast.showErrorToast(message: res['ErrorEndUserMessage']); } diff --git a/lib/pages/landing/fragments/home_page_fragment2.dart b/lib/pages/landing/fragments/home_page_fragment2.dart index 6828b56f..1be3f6af 100644 --- a/lib/pages/landing/fragments/home_page_fragment2.dart +++ b/lib/pages/landing/fragments/home_page_fragment2.dart @@ -242,8 +242,8 @@ class _HomePageFragment2State extends State { ), FlatButton( onPressed: () { - projectViewModel.analytics.hmgServices.viewAll(); Navigator.push(context, FadePage(page: AllHabibMedicalSevicePage2())); + projectViewModel.analytics.hmgServices.viewAll(); }, child: Text( TranslationBase.of(context).viewAllServices, @@ -289,10 +289,10 @@ class _HomePageFragment2State extends State { flex: 1, child: InkWell( onTap: () { - projectViewModel.analytics.offerPackages.log(); AuthenticatedUser user = projectViewModel.user; if(projectViewModel.havePrivilege(82) || bypassPrivilageCheck) Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesOfferTabPage(user))); + projectViewModel.analytics.offerPackages.log(); }, child: Stack( children: [ diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart index 2389e92c..f6450f36 100644 --- a/lib/pages/landing/landing_page.dart +++ b/lib/pages/landing/landing_page.dart @@ -170,7 +170,6 @@ class _LandingPageState extends State with WidgetsBindingObserver { } changeCurrentTab(int tab) { - projectViewModel.analytics.bottomTabNavigation.log(tabIndex: tab, isLoggedIn: projectViewModel.isLogin); if (!projectViewModel.isLogin) { if (tab == 3) { List imagesInfo = []; @@ -246,6 +245,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { // currentTab = tab; } }); + + projectViewModel.analytics.bottomTabNavigation.log(tabIndex: tab, isLoggedIn: projectViewModel.isLogin); } getToDoCount() { @@ -653,8 +654,8 @@ class _LandingPageState extends State with WidgetsBindingObserver { ? FloatingButton( elevation: true, onTap: () { - projectViewModel.analytics.appointment.book_appointment(); changeCurrentTab(2); + projectViewModel.analytics.appointment.book_appointment(); }, ) : null); @@ -685,7 +686,6 @@ class _LandingPageState extends State with WidgetsBindingObserver { authService.selectDeviceImei(token).then((SelectDeviceIMEIRES value) => setUserValues(value)); if (authenticatedUserObject.isLogin) { var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE)); - projectViewModel.analytics.setUser(data); if (data != null) { authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {}); authService.getDashboard().then((value) => { @@ -699,6 +699,7 @@ class _LandingPageState extends State with WidgetsBindingObserver { }), }); } + projectViewModel.analytics.setUser(data); } else { projectViewModel.analytics.setUser(null); } diff --git a/lib/pages/landing/widgets/services_view.dart b/lib/pages/landing/widgets/services_view.dart index 9903835f..4f6af3f0 100644 --- a/lib/pages/landing/widgets/services_view.dart +++ b/lib/pages/landing/widgets/services_view.dart @@ -60,102 +60,102 @@ class ServicesView extends StatelessWidget { LiveCareHome.isLiveCareTypeSelected = false; }); } else if (index == 1) { - locator().hmgServices.logServiceName('covid-test drive-thru'); showCovidDialog(context); + locator().hmgServices.logServiceName('covid-test drive-thru'); } else if (index == 2) { - locator().hmgServices.logServiceName('online payments'); Navigator.push(context, FadePage(page: PaymentService())); + locator().hmgServices.logServiceName('online payments'); } else if (index == 3) { - locator().hmgServices.logServiceName('home health care'); Navigator.push(context, FadePage(page: HomeHealthCarePage())); + locator().hmgServices.logServiceName('home health care'); } else if (index == 4) { - locator().hmgServices.logServiceName('comprehensive medical checkup'); Navigator.push(context, FadePage(page: CMCPage())); + locator().hmgServices.logServiceName('comprehensive medical checkup'); } else if (index == 5) { - locator().hmgServices.logServiceName('emergency service'); Navigator.push(context, FadePage(page: ErOptions(isAppbar: true))); + locator().hmgServices.logServiceName('emergency service'); } else if (index == 6) { - locator().hmgServices.logServiceName('e-referral service'); Navigator.push(context, FadePage(page: EReferralPage())); + locator().hmgServices.logServiceName('e-referral service'); } else if (index == 7) { - locator().hmgServices.logServiceName('water consumption'); Navigator.push(context, FadePage(page: H2OPage())); + locator().hmgServices.logServiceName('water consumption'); } else if (index == 8) { - locator().hmgServices.logServiceName('find us reach us'); Navigator.push(context, FadePage(page: ContactUsPage())); + locator().hmgServices.logServiceName('find us reach us'); } else if (index == 9) { - locator().hmgServices.logServiceName('my medical details'); Navigator.push( context, FadePage( page: MedicalProfilePageNew(), ), ); + locator().hmgServices.logServiceName('my medical details'); } else if (index == 10) { - locator().hmgServices.logServiceName('book appointment'); Navigator.push( context, FadePage( page: Search(), ), ); + locator().hmgServices.logServiceName('book appointment'); } else if (index == 11) { - locator().hmgServices.logServiceName('al habib pharmacy'); getPharmacyToken(context); + locator().hmgServices.logServiceName('al habib pharmacy'); } else if (index == 12) { - locator().hmgServices.logServiceName('update insurance'); Navigator.push( context, FadePage( page: InsuranceUpdate(), ), ); + locator().hmgServices.logServiceName('update insurance'); } else if (index == 13) { - locator().hmgServices.logServiceName('my family files'); Navigator.push( context, FadePage( page: MyFamily(), ), ); + locator().hmgServices.logServiceName('my family files'); } else if (index == 14) { - locator().hmgServices.logServiceName('my child vaccines'); Navigator.push( context, FadePage(page: ChildInitialPage()), ); + locator().hmgServices.logServiceName('my child vaccines'); } else if (index == 15) { // Navigator.pop(context); - locator().hmgServices.logServiceName('todo list'); LandingPage.shared.switchToDoFromHMGServices(); + locator().hmgServices.logServiceName('todo list'); } else if (index == 16) { - locator().hmgServices.logServiceName('blood donation'); Navigator.push( context, FadePage(page: BloodDonationPage()), ); + locator().hmgServices.logServiceName('blood donation'); } else if (index == 17) { - locator().hmgServices.logServiceName('health calculator'); Navigator.push( context, FadePage( page: (HealthCalculators()), ), ); + locator().hmgServices.logServiceName('health calculator'); } else if (index == 18) { - locator().hmgServices.logServiceName('heath converters'); Navigator.push( context, FadePage( page: HealthConverter(), ), ); + locator().hmgServices.logServiceName('heath converters'); } else if (index == 19) { - locator().hmgServices.logServiceName('smart watches'); Navigator.push( context, FadePage(page: SmartWatchInstructions()), ); + locator().hmgServices.logServiceName('smart watches'); } else if (index == 20) { locator().hmgServices.logServiceName('car parcking service'); Navigator.push( @@ -165,10 +165,9 @@ class ServicesView extends StatelessWidget { ), ); } else if (index == 21) { - locator().hmgServices.logServiceName('virtual tour'); launch("https://hmgwebservices.com/vt_mobile/html/index.html"); + locator().hmgServices.logServiceName('virtual tour'); } else if (index == 22) { - locator().hmgServices.logServiceName('latest news'); Navigator.of(context).push( MaterialPageRoute( builder: (BuildContext context) => MyWebView( @@ -177,6 +176,7 @@ class ServicesView extends StatelessWidget { ), ), ); + locator().hmgServices.logServiceName('latest news'); } }, child: Container( diff --git a/lib/pages/livecare/live_care_payment_page.dart b/lib/pages/livecare/live_care_payment_page.dart index 4ae09885..3bd667d3 100644 --- a/lib/pages/livecare/live_care_payment_page.dart +++ b/lib/pages/livecare/live_care_payment_page.dart @@ -294,8 +294,8 @@ class _LiveCarePatmentPageState extends State { return false; }); } else { - projectViewModel.analytics.liveCare.livecare_immediate_consultation_TnC(clinic: widget.clinicName); Navigator.pop(context, true); + projectViewModel.analytics.liveCare.livecare_immediate_consultation_TnC(clinic: widget.clinicName); } } else { openPermissionsDialog(); diff --git a/lib/pages/livecare/livecare_type_select.dart b/lib/pages/livecare/livecare_type_select.dart index 4c350123..4c8fadce 100644 --- a/lib/pages/livecare/livecare_type_select.dart +++ b/lib/pages/livecare/livecare_type_select.dart @@ -114,11 +114,11 @@ class _LiveCareTypeSelectState extends State { return InkWell( onTap: () { if (_loginIndex == 1) { - projectViewModel.analytics.liveCare.livecare_immediate_consultation(); Navigator.pop(context, "immediate"); + projectViewModel.analytics.liveCare.livecare_immediate_consultation(); } else { - projectViewModel.analytics.liveCare.livecare_schedule_video_call(); Navigator.pop(context, "schedule"); + projectViewModel.analytics.liveCare.livecare_schedule_video_call(); } }, child: Container( diff --git a/lib/pages/livecare/widgets/clinic_card.dart b/lib/pages/livecare/widgets/clinic_card.dart index 99fa8610..d6fb745a 100644 --- a/lib/pages/livecare/widgets/clinic_card.dart +++ b/lib/pages/livecare/widgets/clinic_card.dart @@ -164,8 +164,6 @@ class _State extends State { getClinicTimings(PatientERGetClinicsList patientERGetClinicsList) { - locator().liveCare.livecare_clinic_schedule(clinic: patientERGetClinicsList.serviceName); - LiveCareService service = new LiveCareService(); GifLoaderDialogUtils.showMyDialog(context); service.getLivecareClinicTiming(patientERGetClinicsList.serviceID, context).then((res) { @@ -207,5 +205,7 @@ class _State extends State { GifLoaderDialogUtils.hideDialog(context); print(err); }); + + locator().liveCare.livecare_clinic_schedule(clinic: patientERGetClinicsList.serviceName); } } diff --git a/lib/pages/livecare/widgets/clinic_list.dart b/lib/pages/livecare/widgets/clinic_list.dart index 248fda75..7e759853 100644 --- a/lib/pages/livecare/widgets/clinic_list.dart +++ b/lib/pages/livecare/widgets/clinic_list.dart @@ -106,7 +106,6 @@ class _clinic_listState extends State { } void startLiveCare() { - projectViewModel.analytics.liveCare.livecare_immediate_consultation_clinic(clinic: selectedClinicName); bool isError = false; LiveCareService service = new LiveCareService(); @@ -128,6 +127,7 @@ class _clinic_listState extends State { isError = true; AppToast.showErrorToast(message: err); }); + projectViewModel.analytics.liveCare.livecare_immediate_consultation_clinic(clinic: selectedClinicName); } showLiveCareCancelDialog(String msg, res) { @@ -290,8 +290,8 @@ class _clinic_listState extends State { }))).then((value) { print(value); if (value != null) { - projectViewModel.analytics.liveCare.payment_method(appointment_type: 'livecare', clinic: selectedClinicName, payment_method: value[0], payment_type: 'appointment'); openPayment(value, authUser, double.parse(getERAppointmentFeesList.total), appo); + projectViewModel.analytics.liveCare.payment_method(appointment_type: 'livecare', clinic: selectedClinicName, payment_method: value[0], payment_type: 'appointment'); } }); } @@ -603,7 +603,6 @@ class _clinic_listState extends State { } void startScheduleLiveCare() { - projectViewModel.analytics.liveCare.livecare_schedule_video_call_clinic(clinic: selectedClinicName); List doctorsList = []; LiveCareService service = new LiveCareService(); @@ -642,6 +641,7 @@ class _clinic_listState extends State { AppToast.showErrorToast(message: err); print(err); }); + projectViewModel.analytics.liveCare.livecare_schedule_video_call_clinic(clinic: selectedClinicName); } Future navigateToSearchResults(context, List docList, List patientDoctorAppointmentListHospital) async { diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart index bde675ad..0e79e4c8 100644 --- a/lib/pages/login/confirm-login.dart +++ b/lib/pages/login/confirm-login.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/analytics/flows/login_registration.dart'; import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; @@ -274,8 +275,8 @@ class _ConfirmLogin extends State { DefaultButton( TranslationBase.of(context).useAnotherAccount, () { - projectViewModel.analytics.loginRegistration.login_with_other_account(); Navigator.of(context).pushNamed(LOGIN_TYPE); + projectViewModel.analytics.loginRegistration.login_with_other_account(); }, ), ], @@ -308,6 +309,9 @@ class _ConfirmLogin extends State { this.selectedOption = fingrePrintBefore != null ? fingrePrintBefore : type; login_method = type; + LoginRegistration.verificationMethod = type; + projectViewModel.analytics.loginRegistration.login_verfication(forRegistration: widget.fromRegistration); + switch (type) { case 1: this.loginWithSMS(type); @@ -579,11 +583,12 @@ class _ConfirmLogin extends State { else { // Navigator.of(context).pop(), - projectViewModel.analytics.errorTracking.log('otp_verification_at_confirm_login', error: result), GifLoaderDialogUtils.hideDialog(context), Future.delayed(Duration(seconds: 1), () { AppToast.showErrorToast(message: result); }), + projectViewModel.analytics.loginRegistration.login_fail(error: result), + projectViewModel.analytics.errorTracking.log('otp_verification_at_confirm_login', error: result), } }) .catchError((err) { @@ -609,7 +614,6 @@ class _ConfirmLogin extends State { } else { - projectViewModel.analytics.loginRegistration.login_successful(method: login_method), sharedPref.remove(FAMILY_FILE), result.list.isFamily = false, userData = result.list, @@ -622,6 +626,7 @@ class _ConfirmLogin extends State { sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID), sharedPref.setString(TOKEN, result.authenticationTokenID), checkIfUserAgreedBefore(result), + projectViewModel.analytics.loginRegistration.login_successful(), } } else @@ -629,10 +634,12 @@ class _ConfirmLogin extends State { // Navigator.of(context).pop(), GifLoaderDialogUtils.hideDialog(context), Future.delayed(Duration(seconds: 1), () { - projectViewModel.analytics.errorTracking.log('otp_verification_at_confirm_login', error: result); AppToast.showErrorToast(message: result); startSMSService(tempType); }), + + projectViewModel.analytics.loginRegistration.login_fail(error: result), + projectViewModel.analytics.errorTracking.log('otp_verification_at_confirm_login', error: result) } }) .catchError((err) { @@ -728,8 +735,8 @@ class _ConfirmLogin extends State { isMoreOption = true; }); } else { - projectViewModel.analytics.loginRegistration.verify_otp_method(method: _flag, forRegistration: widget.fromRegistration); authenticateUser(_flag, isActive: _loginIndex); + projectViewModel.analytics.loginRegistration.verify_otp_method(forRegistration: widget.fromRegistration); } }, child: Container( diff --git a/lib/pages/login/forgot-password.dart b/lib/pages/login/forgot-password.dart index 94ce51e5..051313cc 100644 --- a/lib/pages/login/forgot-password.dart +++ b/lib/pages/login/forgot-password.dart @@ -74,8 +74,8 @@ class _ForgotPassword extends State { width: double.infinity, child: FlatButton( onPressed: () { - locator().loginRegistration.recover_file_number(); sendPatientIDBySMS(); + locator().loginRegistration.recover_file_number(); }, child: Text( TranslationBase.of(context).submit, diff --git a/lib/pages/login/login-type.dart b/lib/pages/login/login-type.dart index af461044..61756ac8 100644 --- a/lib/pages/login/login-type.dart +++ b/lib/pages/login/login-type.dart @@ -1,3 +1,4 @@ +import 'package:diplomaticquarterapp/analytics/flows/login_registration.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/locator.dart'; @@ -63,8 +64,8 @@ class LoginType extends StatelessWidget { text: TranslationBase.of(context).forgotPassword, style: TextStyle(decoration: TextDecoration.underline, fontSize: 12, fontWeight: FontWeight.w600, color: Color(0xffC9272B), letterSpacing: -0.48, height: 18 / 12), recognizer: TapGestureRecognizer()..onTap = () { - locator().loginRegistration.forget_file_number(); Navigator.of(context).push(FadePage(page: ForgotPassword())); + locator().loginRegistration.forget_file_number(); }, ), ), @@ -76,8 +77,8 @@ class LoginType extends StatelessWidget { width: double.infinity, child: FlatButton( onPressed: () { - locator().loginRegistration.register_now(); Navigator.of(context).push(FadePage(page: RegisterNew())); + locator().loginRegistration.register_now(); }, child: Text( TranslationBase.of(context).registerNow, @@ -240,8 +241,9 @@ class LoginType extends StatelessWidget { return InkWell( onTap: () { LoginType.loginType = _flag; - locator().loginRegistration.login_start(method: type); + LoginRegistration.loginMethod = _flag; Navigator.of(_context).push(FadePage(page: Login())); + locator().loginRegistration.login_start(method: type); }, child: Container( padding: EdgeInsets.only(left: 20, right: 20, bottom: 15, top: 28), diff --git a/lib/pages/login/login.dart b/lib/pages/login/login.dart index 4a6efc5a..b504c77d 100644 --- a/lib/pages/login/login.dart +++ b/lib/pages/login/login.dart @@ -30,6 +30,7 @@ import 'package:flutter/rendering.dart'; import 'package:provider/provider.dart'; class Login extends StatefulWidget { + @override _Login createState() => _Login(); } @@ -282,7 +283,7 @@ class _Login extends State { }, cancelFunction: () => {}); dialog.showAlertDialog(context); - projectViewModel.analytics.loginRegistration.login_fail(method: this.loginType == 1 ? "national id" : "file number", error: err.toString()); + projectViewModel.analytics.loginRegistration.login_fail(error: err.toString()); }); } diff --git a/lib/pages/login/register.dart b/lib/pages/login/register.dart index 9e771f14..090f60fb 100644 --- a/lib/pages/login/register.dart +++ b/lib/pages/login/register.dart @@ -1,6 +1,8 @@ +import 'package:diplomaticquarterapp/analytics/flows/login_registration.dart'; import 'package:diplomaticquarterapp/analytics/google-analytics.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/size_config.dart'; +import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_user_status_reponse.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_user_status_req.dart'; @@ -165,8 +167,8 @@ class _Register extends State { child: Padding( padding: EdgeInsets.all(10), child: DefaultButton(TranslationBase.of(context).next, (){ - locator().loginRegistration.registration_enter_details(); startRegistration(); + locator().loginRegistration.registration_enter_details(); }, textColor: Colors.white, color: isButtonDisabled == true ? Colors.grey : Color(0xff359846))), ), ], @@ -341,6 +343,7 @@ class _Register extends State { okFunction: () { AlertDialogBox.closeAlertDialog(context); sharedPref.setObject(REGISTER_DATA_FOR_LOGIIN, nRequest); + LoginRegistration.loginMethod = 1; // 1=NationalID, by default from Registration Navigator.of(context).push(FadePage(page: Login())); }, cancelFunction: () {}) diff --git a/lib/pages/login/welcome.dart b/lib/pages/login/welcome.dart index b4845915..8b9e282f 100644 --- a/lib/pages/login/welcome.dart +++ b/lib/pages/login/welcome.dart @@ -81,8 +81,8 @@ class _WelcomeLogin extends State { child: DefaultButton( TranslationBase.of(context).no, () => { - locator().loginRegistration.visited_alhabib_group(false), Navigator.of(context).push(FadePage(page: RegisterNew())), + locator().loginRegistration.visited_alhabib_group(false), }, color: CustomColors.accentColor, textColor: Colors.white, @@ -93,8 +93,8 @@ class _WelcomeLogin extends State { child: DefaultButton( TranslationBase.of(context).yes, () => { - locator().loginRegistration.visited_alhabib_group(true), Navigator.of(context).push(FadePage(page: LoginType())), + locator().loginRegistration.visited_alhabib_group(true), }, color: CustomColors.green, ), diff --git a/lib/pages/medical/balance/advance_payment_page.dart b/lib/pages/medical/balance/advance_payment_page.dart index 520dfcef..ae45b3dc 100644 --- a/lib/pages/medical/balance/advance_payment_page.dart +++ b/lib/pages/medical/balance/advance_payment_page.dart @@ -316,7 +316,6 @@ class _AdvancePaymentPageState extends State { GifLoaderDialogUtils.showMyDialog(context); - projectViewModel.analytics.advancePayments.wallet_payment_details(); model.getPatientInfoByPatientIDAndMobileNumber(advanceModel).then((value) { GifLoaderDialogUtils.hideDialog(context); if (model.state != ViewState.Error && model.state != ViewState.ErrorLocal) { @@ -332,8 +331,6 @@ class _AdvancePaymentPageState extends State { ), ).then( (value) { - projectViewModel.analytics.advancePayments.payment_method(method: value[0].toString().toLowerCase(), type: 'wallet'); - Navigator.push( context, FadePage( @@ -346,10 +343,12 @@ class _AdvancePaymentPageState extends State { ), ), ); + projectViewModel.analytics.advancePayments.payment_method(method: value[0].toString().toLowerCase(), type: 'wallet'); }, ); } }); + projectViewModel.analytics.advancePayments.wallet_payment_details(); }, color: Color(0xffD02127), textColor: Colors.white, diff --git a/lib/pages/medical/balance/confirm_payment_page.dart b/lib/pages/medical/balance/confirm_payment_page.dart index fcb893a2..4d3c7718 100644 --- a/lib/pages/medical/balance/confirm_payment_page.dart +++ b/lib/pages/medical/balance/confirm_payment_page.dart @@ -209,7 +209,6 @@ class _ConfirmPaymentPageState extends State { child: DefaultButton( TranslationBase.of(context).confirm.toUpperCase(), () { - projectViewModel.analytics.advancePayments.payment_confirm(method: widget.selectedPaymentMethod.toLowerCase(), type: 'wallet'); if (widget.advanceModel.fileNumber == projectViewModel.user.patientID.toString()) { openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, double.parse(widget.advanceModel.amount), null); @@ -220,6 +219,7 @@ class _ConfirmPaymentPageState extends State { if (model.state != ViewState.ErrorLocal && model.state != ViewState.Error) showSMSDialog(model); }); } + projectViewModel.analytics.advancePayments.payment_confirm(method: widget.selectedPaymentMethod.toLowerCase(), type: 'wallet'); // startApplePay(); // if() diff --git a/lib/pages/medical/balance/my_balance_page.dart b/lib/pages/medical/balance/my_balance_page.dart index 70b81b02..a7a6d5d7 100644 --- a/lib/pages/medical/balance/my_balance_page.dart +++ b/lib/pages/medical/balance/my_balance_page.dart @@ -178,8 +178,8 @@ class MyBalancePage extends StatelessWidget { DefaultButton( TranslationBase.of(context).createAdvancedPayment, () { - projectViewModel.analytics.advancePayments.wallet_recharge(service_type: 'alhabib wallet'); Navigator.push(context, FadePage(page: AdvancePaymentPage())); + projectViewModel.analytics.advancePayments.wallet_recharge(service_type: 'alhabib wallet'); }, ).insideContainer, ], diff --git a/lib/pages/paymentService/payment_service.dart b/lib/pages/paymentService/payment_service.dart index 83dc69bc..da21d7f9 100644 --- a/lib/pages/paymentService/payment_service.dart +++ b/lib/pages/paymentService/payment_service.dart @@ -59,8 +59,8 @@ class PaymentService extends StatelessWidget { medical.add( InkWell( onTap: () { - projectViewModel.analytics.advancePayments.payment_services(service_type: 'payment service'); Navigator.push(context, FadePage(page: AdvancePaymentPage())); + projectViewModel.analytics.advancePayments.payment_services(service_type: 'payment service'); }, child: MedicalProfileItem( title: TranslationBase.of(context).payment, @@ -76,8 +76,8 @@ class PaymentService extends StatelessWidget { medical.add( InkWell( onTap: () { - projectViewModel.analytics.advancePayments.payment_services(service_type: 'online check-in appointment'); navigateToToDoPage(context); + projectViewModel.analytics.advancePayments.payment_services(service_type: 'online check-in appointment'); }, child: MedicalProfileItem( title: TranslationBase.of(context).onlineCheckIn, @@ -93,8 +93,8 @@ class PaymentService extends StatelessWidget { medical.add( InkWell( onTap: () { - projectViewModel.analytics.advancePayments.payment_services(service_type: 'alhabib wallet'); Navigator.push(context, FadePage(page: MyBalancePage())); + projectViewModel.analytics.advancePayments.payment_services(service_type: 'alhabib wallet'); }, child: MedicalProfileItem( title: TranslationBase.of(context).hmg, diff --git a/lib/pages/videocall-webrtc-rnd/webrtc/signaling.dart b/lib/pages/videocall-webrtc-rnd/webrtc/signaling.dart index 4ca87644..d6e0a071 100644 --- a/lib/pages/videocall-webrtc-rnd/webrtc/signaling.dart +++ b/lib/pages/videocall-webrtc-rnd/webrtc/signaling.dart @@ -404,7 +404,7 @@ class Signaling { 'to': session.remote_user?.id, 'from': session.local_user.id, 'candidate': { - 'sdpMLineIndex': candidate.sdpMLineIndex, + 'sdpMLineIndex': candidate.sdpMlineIndex, 'sdpMid': candidate.sdpMid, 'candidate': candidate.candidate, }, diff --git a/lib/widgets/drawer/app_drawer_widget.dart b/lib/widgets/drawer/app_drawer_widget.dart index 72a8dbed..f95241ed 100644 --- a/lib/widgets/drawer/app_drawer_widget.dart +++ b/lib/widgets/drawer/app_drawer_widget.dart @@ -404,8 +404,8 @@ class _AppDrawerState extends State { InkWell( child: DrawerItem(TranslationBase.of(context).rateApp, Icons.star, bottomLine: false, letterSpacing: -0.84, fontSize: 14, projectProvider: projectProvider), onTap: () { - locator().hamburgerMenu.logMenuItemClick('rate our app'); openAppReviewDialog(); + locator().hamburgerMenu.logMenuItemClick('rate our app'); // if (Platform.isIOS) { // launch("https://apps.apple.com/sa/app/dr-suliaman-alhabib/id733503978"); // } else { @@ -453,9 +453,9 @@ class _AppDrawerState extends State { InkWell( onTap: () { Navigator.push(context, FadePage(page: CallPage())); - locator().hamburgerMenu.logMenuItemClick('cloud solution logo tap'); GifLoaderDialogUtils.showMyDialog(context); HMGNetworkConnectivity(context).start(); + locator().hamburgerMenu.logMenuItemClick('cloud solution logo tap'); }, child: Row( crossAxisAlignment: CrossAxisAlignment.center, @@ -551,11 +551,9 @@ class _AppDrawerState extends State { } login() async { - locator().hamburgerMenu.logMenuItemClick('login'); var data = await sharedPref.getObject(IMEI_USER_DATA); sharedPref.remove(REGISTER_DATA_FOR_LOGIIN); - locator().loginRegistration.login_register_initiate(); if (data != null) { Navigator.of(context).pushNamed(CONFIRM_LOGIN); } else { @@ -577,6 +575,8 @@ class _AppDrawerState extends State { ); }); } + locator().loginRegistration.login_register_initiate(); + locator().hamburgerMenu.logMenuItemClick('login'); } Future getFamilyFiles() async {