diff --git a/assets/images/new/CS/Family_Files.svg b/assets/images/new/CS/Family_Files.svg
new file mode 100644
index 00000000..ce47d959
--- /dev/null
+++ b/assets/images/new/CS/Family_Files.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/images/new/CS/Help.svg b/assets/images/new/CS/Help.svg
new file mode 100644
index 00000000..31d49e71
--- /dev/null
+++ b/assets/images/new/CS/Help.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/images/new/CS/My_File.svg b/assets/images/new/CS/My_File.svg
new file mode 100644
index 00000000..fc5c0096
--- /dev/null
+++ b/assets/images/new/CS/My_File.svg
@@ -0,0 +1,7 @@
+
diff --git a/assets/images/new/CS/Todo.svg b/assets/images/new/CS/Todo.svg
new file mode 100644
index 00000000..98232af9
--- /dev/null
+++ b/assets/images/new/CS/Todo.svg
@@ -0,0 +1,3 @@
+
diff --git a/assets/images/new/CS/emergency_request_CS.svg b/assets/images/new/CS/emergency_request_CS.svg
new file mode 100644
index 00000000..1796a80c
--- /dev/null
+++ b/assets/images/new/CS/emergency_request_CS.svg
@@ -0,0 +1,24 @@
+
diff --git a/assets/images/new/CS/home_health_care_CS.svg b/assets/images/new/CS/home_health_care_CS.svg
new file mode 100644
index 00000000..8cf044b1
--- /dev/null
+++ b/assets/images/new/CS/home_health_care_CS.svg
@@ -0,0 +1,14 @@
+
diff --git a/assets/images/new/CS/livecare_CS.svg b/assets/images/new/CS/livecare_CS.svg
new file mode 100644
index 00000000..8af91e8a
--- /dev/null
+++ b/assets/images/new/CS/livecare_CS.svg
@@ -0,0 +1,10 @@
+
diff --git a/assets/images/new/CS/loader.gif b/assets/images/new/CS/loader.gif
new file mode 100644
index 00000000..3e343727
Binary files /dev/null and b/assets/images/new/CS/loader.gif differ
diff --git a/assets/images/new/CS/pharmacy_CS.svg b/assets/images/new/CS/pharmacy_CS.svg
new file mode 100644
index 00000000..a3ad2b0c
--- /dev/null
+++ b/assets/images/new/CS/pharmacy_CS.svg
@@ -0,0 +1,16 @@
+
diff --git a/assets/images/new/CoronaIcon.svg b/assets/images/new/CoronaIcon.svg
new file mode 100644
index 00000000..c02f907b
--- /dev/null
+++ b/assets/images/new/CoronaIcon.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/lib/analytics/flows/advance_payments.dart b/lib/analytics/flows/advance_payments.dart
new file mode 100644
index 00000000..db52eb59
--- /dev/null
+++ b/lib/analytics/flows/advance_payments.dart
@@ -0,0 +1,82 @@
+import 'package:flutter/cupertino.dart';
+
+import '../google-analytics.dart';
+
+class AdvancePayments{
+
+ final GALogger logger;
+ AdvancePayments(this.logger);
+
+ // R038
+ payment_services({@required String service_type}){
+ logger('payment_services', parameters: {
+ 'service_type' : service_type
+ });
+ }
+
+ // R039
+ wallet_recharge({@required String service_type}){
+ logger('wallet_recharge', parameters: {
+ 'service_type' : service_type
+ });
+ }
+
+ // R040
+ wallet_payment_details(){
+ logger('wallet_payment_details');
+ }
+
+ // R041
+ payment_method({@required String method,type}){
+ logger('payment_method', parameters: {
+ 'payment_method' : method,
+ 'payment_type' : type
+ });
+ }
+
+ // R042
+ payment_confirm({@required String method,type}){
+ logger('payment_confirm', parameters: {
+ 'payment_method' : method,
+ 'payment_type' : type
+ });
+ }
+
+ // R043
+ payment_otp_confirmation({@required String method,type}){
+ logger('payment_otp_confirmation', parameters: {
+ 'payment_method' : method,
+ 'payment_type' : type
+ });
+ }
+
+ // R044
+ payment_confirm_card_details({@required String method,type}){
+ logger('payment_confirm_card_details', parameters: {
+ 'payment_method' : method,
+ 'payment_type' : type
+ });
+ }
+
+ // R045
+ payment_pay({@required String method,type}){
+ logger('payment_pay', parameters: {
+ 'payment_method' : method,
+ 'payment_type' : type
+ });
+ }
+
+ // R046
+ payment_success({@required String appointment_type, clinic, hospital, payment_method, payment_type, txn_number, txn_amount, txn_currency}){
+ logger('payment_success', parameters: {
+ 'appointment_type' : appointment_type,
+ 'clinic_type_online' : clinic,
+ 'payment_method' : payment_method,
+ 'payment_type' : payment_type,
+ 'hospital_name' : hospital,
+ 'transaction_number' : txn_number,
+ 'transaction_amount' : txn_amount,
+ 'transaction_currency' : txn_currency
+ });
+ }
+}
\ No newline at end of file
diff --git a/lib/analytics/flows/app_nav.dart b/lib/analytics/flows/app_nav.dart
new file mode 100644
index 00000000..12601fcd
--- /dev/null
+++ b/lib/analytics/flows/app_nav.dart
@@ -0,0 +1,13 @@
+import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
+
+class AppNav{
+ final name = 'app_nav';
+ final GALogger logger;
+ AppNav(this.logger);
+
+ logNavName(String value){
+ logger(name, parameters: {
+ 'nav_name' : value
+ });
+ }
+}
\ No newline at end of file
diff --git a/lib/analytics/flows/appointments.dart b/lib/analytics/flows/appointments.dart
new file mode 100644
index 00000000..bd69769d
--- /dev/null
+++ b/lib/analytics/flows/appointments.dart
@@ -0,0 +1,222 @@
+import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
+import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
+import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
+
+import '../google-analytics.dart';
+
+class Appointment{
+
+ final GALogger logger;
+ Appointment(this.logger);
+
+ // R015
+ book_appointment(){
+ logger('book_appointment');
+ }
+
+ // R016.1, R017.2
+ book_appointment_by_clinic(){
+ logger('book_appointment_by_clinic');
+ }
+
+ // R016.2, R018.2
+ book_appointment_by_doctor(){
+ logger('book_appointment_by_doctor');
+ }
+
+ // R017.1
+ book_appointment_doctor_search({@required String query}){
+ // doctor_search_query : value
+ logger('book_appointment_doctor_search', parameters: {
+ 'doctor_search_query' : query
+ });
+ }
+
+ // R018.1
+ book_appointment_select_clinic({@required String appointment_type, clinic}){
+ // appointment_type: regular | livecare
+ // clinic_type : $clinic_type
+ logger('book_appointment_select_clinic', parameters: {
+ 'appointment_type' : appointment_type,
+ 'clinic_type' : clinic
+ });
+ }
+
+ // R019.1
+ book_appointment_livecare_accept(){
+ logger('book_appointment_livecare_accept');
+ }
+
+ // R019.2
+ book_appointment_livecare_decline(){
+ logger('book_appointment_livecare_decline');
+ }
+
+ // R020
+ book_appointment_chief_complaints({@required String appointment_type, clinic, hospital, treatment}){
+ logger('book_appointment_chief_complaints', parameters: {
+ 'appointment_type' : appointment_type,
+ 'clinic_type' : clinic,
+ 'hospital_name' : hospital,
+ 'treatment_type' : treatment,
+ });
+ }
+
+ // R021
+ book_appointment_select_doctor({@required String appointment_type, @required DoctorList doctor}){
+ // appointment_type, clinic_type, hospital_name, treatment_type, doctor_name, doctor_nationality, doctor_gender
+ logger('book_appointment_select_doctor', parameters: {
+ 'appointment_type' : appointment_type,
+ 'clinic_type' : doctor.clinicName,
+ 'hospital_name' : doctor.projectName,
+ 'treatment_type' : doctor.clinicName,
+ 'doctor_name' : doctor.name,
+ 'doctor_nationality' : doctor.nationalityName,
+ 'doctor_gender' : doctor.gender,
+ });
+ }
+
+ // R022
+ book_appointment_schedule({@required String appointment_type, @required DoctorList doctor}){
+ // appointment_type, clinic_type, hospital_name, treatment_type, doctor_name, doctor_nationality, doctor_gender
+ logger('book_appointment_schedule', parameters: {
+ 'appointment_type' : appointment_type,
+ 'clinic_type' : doctor.clinicName,
+ 'hospital_name' : doctor.projectName,
+ 'treatment_type' : doctor.clinicName,
+ 'doctor_name' : doctor.name,
+ 'doctor_nationality' : doctor.nationalityName,
+ 'doctor_gender' : doctor.gender,
+ });
+ }
+
+ // R023
+ book_appointment_date_selection({@required String appointment_type, @required day, @required DoctorList doctor}){
+ logger('book_appointment_date_selection', parameters: {
+ 'appointment_type' : appointment_type,
+ 'clinic_type' : doctor.clinicName,
+ 'hospital_name' : doctor.projectName,
+ 'treatment_type' : doctor.clinicName,
+ 'doctor_name' : doctor.name,
+ 'doctor_nationality' : doctor.nationalityName,
+ 'doctor_gender' : doctor.gender,
+ 'appointment_day' : day
+ });
+ }
+
+ // R024.1
+ book_appointment_time_selection({@required String appointment_type, @required DateTime dateTime, @required DoctorList doctor}){
+ final day = DateUtil.getWeekDay(dateTime.weekday);
+ final time = DateUtil.formatDateToTime(dateTime);
+ logger('book_appointment_time_selection', parameters: {
+ 'appointment_type' : appointment_type,
+ 'clinic_type' : doctor.clinicName,
+ 'hospital_name' : doctor.projectName,
+ 'treatment_type' : doctor.clinicName,
+ 'doctor_name' : doctor.name,
+ 'doctor_nationality' : doctor.nationalityName,
+ 'doctor_gender' : doctor.gender,
+ 'appointment_day' : day,
+ 'appointment_hour' : time
+ });
+ }
+
+ // R024.2
+ book_appointment_review({@required String appointment_type, @required DateTime dateTime, @required DoctorList doctor}){
+ final day = DateUtil.getWeekDay(dateTime.weekday);
+ final time = DateUtil.formatDateToTime(dateTime);
+ logger('book_appointment_review', parameters: {
+ 'appointment_type' : appointment_type,
+ 'clinic_type' : doctor.clinicName,
+ 'hospital_name' : doctor.projectName,
+ 'treatment_type' : doctor.clinicName,
+ 'doctor_name' : doctor.name,
+ 'doctor_nationality' : doctor.nationalityName,
+ 'doctor_gender' : doctor.gender,
+ 'appointment_day' : day,
+ 'appointment_hour' : time
+ });
+ }
+
+ // R025
+ book_appointment_click_confirm({@required String appointment_type, @required DateTime dateTime, @required DoctorList doctor}){
+ final day = DateUtil.getWeekDay(dateTime.weekday);
+ final time = DateUtil.formatDateToTime(dateTime);
+ logger('book_appointment_click_confirm', parameters: {
+ 'appointment_type' : appointment_type,
+ 'clinic_type' : doctor.clinicName,
+ 'hospital_name' : doctor.projectName,
+ 'treatment_type' : doctor.clinicName,
+ 'doctor_name' : doctor.name,
+ 'doctor_nationality' : doctor.nationalityName,
+ 'doctor_gender' : doctor.gender,
+ 'appointment_day' : day,
+ 'appointment_hour' : time
+ });
+ }
+
+ // R026
+ book_appointment_confirmation_success({@required String appointment_type, @required DateTime dateTime, @required DoctorList doctor}){
+ final day = DateUtil.getWeekDay(dateTime.weekday);
+ final time = DateUtil.formatDateToTime(dateTime);
+ logger('book_appointment_confirmation_success', parameters: {
+ 'appointment_type' : appointment_type,
+ 'clinic_type' : doctor.clinicName,
+ 'hospital_name' : doctor.projectName,
+ 'treatment_type' : doctor.clinicName,
+ 'doctor_name' : doctor.name,
+ 'doctor_nationality' : doctor.nationalityName,
+ 'doctor_gender' : doctor.gender,
+ 'appointment_day' : day,
+ 'appointment_hour' : time
+ });
+ }
+
+ // R027
+ appointment_reminder(bool value){
+ logger('appointment_reminder', parameters: {
+ 'reminder' : value ? 'yes' : 'no'
+ });
+ }
+
+ // R028
+ appointment_reminder_time({@required String reminde_before}){
+ logger('appointment_reminder_time', parameters: {
+ 'reminder_before' : reminde_before
+ });
+ }
+
+ // R053
+ // Note : - Payment flow beyond this step are same as listed under ‘Advance Payment’ section of this document
+ pay_now_for_appointment({@required String appointment_type, @required DoctorList doctorDetail, bool payNow = true}){
+ logger('pay_now_for_appointment', parameters: {
+ 'appointment_type' : appointment_type,
+ 'clinic_type' : doctorDetail.clinicName,
+ 'hospital_name' : doctorDetail.projectName,
+ 'doctor_name' : doctorDetail.name,
+ 'payment_type' : 'appointment'
+ });
+ }
+
+ // Note : - Payment flow beyond this step are same as listed under ‘Advance Payment’ section of this document
+ appointment_detail_action({@required AppoitmentAllHistoryResultList appointment, @required String action}){
+ logger('appointment_detail_action', parameters: {
+ });
+ }
+
+ // Note : - Payment flow beyond this step are same as listed under ‘Advance Payment’ section of this document
+ appointment_details_confirm({@required AppoitmentAllHistoryResultList appointment}){
+ logger('appointment_details_confirm', parameters: {
+ });
+ }
+
+ // R053
+ // Note : - Payment flow beyond this step are same as listed under ‘Advance Payment’ section of this document
+ appointment_details_cancel({@required AppoitmentAllHistoryResultList appointment}){
+ logger('appointment_details_cancel', parameters: {
+ });
+ }
+
+}
\ No newline at end of file
diff --git a/lib/analytics/flows/error_tracking.dart b/lib/analytics/flows/error_tracking.dart
new file mode 100644
index 00000000..1ceb2ab9
--- /dev/null
+++ b/lib/analytics/flows/error_tracking.dart
@@ -0,0 +1,8 @@
+import '../google-analytics.dart';
+
+class ErrorTracking{
+
+ final GALogger logger;
+ ErrorTracking(this.logger);
+
+}
\ No newline at end of file
diff --git a/lib/analytics/flows/hamburger_menu.dart b/lib/analytics/flows/hamburger_menu.dart
new file mode 100644
index 00000000..404cdbcf
--- /dev/null
+++ b/lib/analytics/flows/hamburger_menu.dart
@@ -0,0 +1,15 @@
+import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
+
+class HamburgerMenu{
+ final hamburger_menu = 'hamburger_menu';
+
+ final GALogger logger;
+ HamburgerMenu(this.logger);
+
+ logMenuItemClick(String value){
+ logger(hamburger_menu, parameters: {
+ 'menu_item' : value
+ });
+ }
+
+}
\ No newline at end of file
diff --git a/lib/analytics/flows/hmg_services.dart b/lib/analytics/flows/hmg_services.dart
new file mode 100644
index 00000000..357f81ab
--- /dev/null
+++ b/lib/analytics/flows/hmg_services.dart
@@ -0,0 +1,13 @@
+import '../google-analytics.dart';
+
+class HMGServices{
+ final hmg_services = 'hmg_services';
+
+ final GALogger logger;
+ HMGServices(this.logger);
+ logServiceName(String value){
+ logger('hmg_services', parameters: {
+ 'services_name' : value
+ });
+ }
+}
\ No newline at end of file
diff --git a/lib/analytics/flows/live_care.dart b/lib/analytics/flows/live_care.dart
new file mode 100644
index 00000000..fd7d03d4
--- /dev/null
+++ b/lib/analytics/flows/live_care.dart
@@ -0,0 +1,101 @@
+import 'package:flutter/cupertino.dart';
+
+import '../google-analytics.dart';
+
+class LiveCare{
+
+ final GALogger logger;
+ LiveCare(this.logger);
+
+ // R030.1
+ livecare_immediate_consultation(){
+ logger('livecare_immediate_consultation');
+ }
+
+ // R030.2
+ livecare_schedule_video_call(){
+ logger('livecare_schedule_video_call');
+ }
+
+ // R031.1
+ livecare_clinic_schedule({@required String clinic}){
+ logger('livecare_clinic_schedule', parameters: {
+ 'clinic_type_online' : clinic
+ });
+ }
+
+ // R031.2
+ livecare_immediate_consultation_clinic({@required String clinic}){
+ logger('livecare_immediate_consultation_clinic', parameters: {
+ 'clinic_type_online' : clinic
+ });
+ }
+
+ // R031.2
+ livecare_schedule_video_call_clinic({@required String clinic}){
+ logger('livecare_schedule_video_call_clinic', parameters: {
+ 'clinic_type_online' : clinic
+ });
+ }
+
+ // R032
+ livecare_immediate_consultation_TnC({@required String clinic}){
+ logger('livecare_immediate_consultation_TnC', parameters: {
+ 'clinic_type_online' : clinic
+ });
+ }
+
+ // R033
+ payment_method({@required String appointment_type, clinic, payment_method, payment_type}){
+ logger('payment_method', parameters: {
+ 'appointment_type' : appointment_type,
+ 'clinic_type_online' : clinic,
+ 'payment_method' : payment_method,
+ 'payment_type' : payment_type
+ });
+ }
+
+ // R034
+ payment_confirm({@required String appointment_type, clinic, payment_method, payment_type}){
+ logger('payment_confirm', parameters: {
+ 'appointment_type' : appointment_type,
+ 'clinic_type_online' : clinic,
+ 'payment_method' : payment_method,
+ 'payment_type' : payment_type
+ });
+ }
+
+ // R035
+ payment_pay({@required String appointment_type, clinic, hospital, payment_method, payment_type}){
+ // logger('payment_pay', parameters: {
+ // 'appointment_type' : appointment_type,
+ // 'clinic_type_online' : clinic,
+ // 'payment_method' : payment_method,
+ // 'payment_type' : payment_type,
+ // 'hospital_name' : hospital
+ // });
+ }
+
+ // R036
+ payment_success({@required String appointment_type, clinic, hospital, payment_method, payment_type, txn_number, txn_amount, txn_currency}){
+ // appointment_type
+ // clinic_type_online
+ // payment_method
+ // payment_type
+ // hospital_name
+ // transaction_number
+ // transaction_amount
+ // transaction_currency
+ }
+
+ // R037
+ livecare_immediate_consultation_payment_failed({@required String appointment_type, clinic, hospital, payment_method, payment_type, error_code, error_message}){
+ // appointment_type
+ // clinic_type_online
+ // payment_method
+ // payment_type
+ // hospital_name
+ // error_code
+ // error_message
+ }
+}
\ No newline at end of file
diff --git a/lib/analytics/flows/login_registration.dart b/lib/analytics/flows/login_registration.dart
new file mode 100644
index 00000000..cf123b62
--- /dev/null
+++ b/lib/analytics/flows/login_registration.dart
@@ -0,0 +1,103 @@
+import 'package:flutter/cupertino.dart';
+
+import '../google-analytics.dart';
+
+class LoginRegistration{
+
+ final GALogger logger;
+ LoginRegistration(this.logger);
+ // R004.1
+ login_register_initiate(){
+ logger('login_register_initiate');
+ }
+
+ // R005.1
+ visited_alhabib_group(bool value){
+ // selection_type: yes/no
+ logger('visited_alhabib_group', parameters: {
+ 'selection_type' : value ? 'yes' : 'no'
+ });
+ }
+
+ // R006.1, R007.1, R008.1, R009.1
+ registration_cancel({@required String step}){
+ // registration_step : enter details
+ // registration_step : personal info
+ // registration_step : patient info
+ // fourth (verification)
+ logger('registration_cancel', parameters: {
+ 'registration_step' : step
+ });
+ }
+
+ // R006.2
+ registration_enter_details(){
+ logger('registration_enter_details');
+ }
+
+ // R007.2
+ registration_personal_info(){
+ logger('registration_personal_info');
+ }
+
+ // R008.2
+ registration_patient_info(){
+ logger('registration_patient_info');
+ }
+
+ // R009.2
+ registration_verification_option(){
+ logger('registration_verification_option');
+ }
+
+ // R010
+ registration_confirmation({@required String by}){
+ // verification_method: by
+ logger('registration_confirmation', parameters: {
+ 'verification_method' : by
+ });
+ }
+
+ // R011.1
+ login_start({@required String method}){
+ logger('login_start', parameters: {
+ 'login_method' : method
+ });
+ }
+
+ // R011.2
+ forget_file_number(){
+ logger('forget_file_number');
+ }
+
+ // R011.3
+ register_now({@required String method}){
+ logger('register_now', parameters: {
+ 'login_method' : method
+ });
+ }
+
+ // R012.1, R014.1
+ login_successful({@required String method}){
+ logger('login_successful', parameters: {
+ 'login_method' : method
+ });
+ }
+
+ // R012.4
+ login_unsuccessful({@required String method, error}){
+ logger('login_unsuccessful', parameters: {
+ 'login_method' : method
+ });
+ }
+
+ // R013
+ recover_file_number(){
+ logger('recover_file_number');
+ }
+
+ // R014.2
+ login_with_other_account(){
+ logger('login_with_other_account');
+ }
+}
\ No newline at end of file
diff --git a/lib/analytics/flows/offers_promotions.dart b/lib/analytics/flows/offers_promotions.dart
new file mode 100644
index 00000000..eea90b15
--- /dev/null
+++ b/lib/analytics/flows/offers_promotions.dart
@@ -0,0 +1,9 @@
+import '../google-analytics.dart';
+
+class OfferAndPromotion{
+
+ final GALogger logger;
+ OfferAndPromotion(this.logger);
+
+ final offers_and_promotion = 'offers_&_promotion';
+}
\ No newline at end of file
diff --git a/lib/analytics/flows/todo_list.dart b/lib/analytics/flows/todo_list.dart
new file mode 100644
index 00000000..bfcde052
--- /dev/null
+++ b/lib/analytics/flows/todo_list.dart
@@ -0,0 +1,119 @@
+import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
+
+import '../google-analytics.dart';
+
+class TodoList{
+
+ final GALogger logger;
+ TodoList(this.logger);
+
+ // R047.1
+ to_do_list_pay_now(AppoitmentAllHistoryResultList appointment){
+ logger('to_do_list_pay_now', parameters: {
+ 'appointment_type' : appointment.appointmentType,
+ 'clinic_type_online' : appointment.clinicName,
+ 'hospital_name' : appointment.projectName,
+ 'doctor_name' : appointment.doctorName,
+ 'payment_type' : appointment.patientType,
+ });
+ }
+
+ // R047.2
+ to_do_list_more_details(AppoitmentAllHistoryResultList appointment){
+ logger('to_do_list_more_details', parameters: {
+ 'appointment_type' : appointment.appointmentType,
+ 'clinic_type_online' : appointment.clinicName,
+ 'hospital_name' : appointment.projectName,
+ 'doctor_name' : appointment.doctorName,
+ 'payment_type' : appointment.patientType,
+ });
+ }
+
+ // R048
+ to_do_list_confirm_payment_details(AppoitmentAllHistoryResultList appointment){
+ logger('to_do_list_confirm_payment_details', parameters: {
+ 'appointment_type' : appointment.appointmentType,
+ 'clinic_type_online' : appointment.clinicName,
+ 'hospital_name' : appointment.projectName,
+ 'doctor_name' : appointment.doctorName,
+ 'payment_type' : appointment.patientType,
+ });
+ }
+
+ // R048
+ to_do_list_cancel_payment_details(AppoitmentAllHistoryResultList appointment){
+ logger('to_do_list_cancel_payment_details', parameters: {
+ 'appointment_type' : appointment.appointmentType,
+ 'clinic_type_online' : appointment.clinicName,
+ 'hospital_name' : appointment.projectName,
+ 'doctor_name' : appointment.doctorName,
+ 'payment_type' : appointment.patientType,
+ });
+ }
+
+ // R049.1 // should be for appointment flow
+ // to_do_list_appointment_actions(AppoitmentAllHistoryResultList appointment, action){
+ // logger('to_do_list_pay_now', parameters: {
+ // 'appointment_type' : appointment.appointmentType,
+ // 'clinic_type_online' : appointment.clinicName,
+ // 'hospital_name' : appointment.projectName,
+ // 'doctor_name' : appointment.doctorName,
+ // 'payment_type' : appointment.patientType,
+ // });
+ // }
+
+ // R049.2
+ to_do_list_cancel_appointment(AppoitmentAllHistoryResultList appointment){
+ logger('to_do_list_cancel_appointment', parameters: {
+ 'appointment_type' : appointment.appointmentType,
+ 'clinic_type_online' : appointment.clinicName,
+ 'hospital_name' : appointment.projectName,
+ 'doctor_name' : appointment.doctorName,
+ 'payment_type' : appointment.patientType,
+ });
+ }
+
+ // R049.3
+ to_do_list_confirm_appointment(AppoitmentAllHistoryResultList appointment){
+ logger('to_do_list_confirm_appointment', parameters: {
+ 'appointment_type' : appointment.appointmentType,
+ 'clinic_type_online' : appointment.clinicName,
+ 'hospital_name' : appointment.projectName,
+ 'doctor_name' : appointment.doctorName,
+ 'payment_type' : appointment.patientType,
+ });
+ }
+
+ // R050
+ to_do_list_check_in(AppoitmentAllHistoryResultList appointment){
+ logger('to_do_list_check_in', parameters: {
+ 'appointment_type' : appointment.appointmentType,
+ 'clinic_type_online' : appointment.clinicName,
+ 'hospital_name' : appointment.projectName,
+ 'doctor_name' : appointment.doctorName,
+ 'payment_type' : appointment.patientType,
+ });
+ }
+
+ // R051
+ to_do_list_nfc(AppoitmentAllHistoryResultList appointment){
+ logger('to_do_list_nfc', parameters: {
+ 'appointment_type' : appointment.appointmentType,
+ 'clinic_type_online' : appointment.clinicName,
+ 'hospital_name' : appointment.projectName,
+ 'doctor_name' : appointment.doctorName,
+ 'payment_type' : appointment.patientType,
+ });
+ }
+
+ // R052
+ to_do_list_nfc_cancel(AppoitmentAllHistoryResultList appointment){
+ logger('to_do_list_nfc_cancel', parameters: {
+ 'appointment_type' : appointment.appointmentType,
+ 'clinic_type_online' : appointment.clinicName,
+ 'hospital_name' : appointment.projectName,
+ 'doctor_name' : appointment.doctorName,
+ 'payment_type' : appointment.patientType,
+ });
+ }
+}
\ No newline at end of file
diff --git a/lib/analytics/google-analytics.dart b/lib/analytics/google-analytics.dart
index 93a67811..f4142bf5 100644
--- a/lib/analytics/google-analytics.dart
+++ b/lib/analytics/google-analytics.dart
@@ -1,4 +1,13 @@
import 'package:diplomaticquarterapp/analytics/analytic-events.dart';
+import 'package:diplomaticquarterapp/analytics/flows/advance_payments.dart';
+import 'package:diplomaticquarterapp/analytics/flows/appointments.dart';
+import 'package:diplomaticquarterapp/analytics/flows/error_tracking.dart';
+import 'package:diplomaticquarterapp/analytics/flows/hamburger_menu.dart';
+import 'package:diplomaticquarterapp/analytics/flows/live_care.dart';
+import 'package:diplomaticquarterapp/analytics/flows/login_registration.dart';
+import 'package:diplomaticquarterapp/analytics/flows/offers_promotions.dart';
+import 'package:diplomaticquarterapp/analytics/flows/todo_list.dart';
+import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
@@ -6,29 +15,61 @@ import 'package:firebase_analytics/observer.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
-class Singleton {
- const Singleton(); //Constant constructor
+import 'flows/app_nav.dart';
+import 'flows/hmg_services.dart';
- void hello() {
- print('Hello world');
+
+typedef GALogger = Function(String name, {Map parameters});
+
+var _analytics = FirebaseAnalytics();
+_logger(String name, {Map parameters}) async {
+ if (name != null && name.isNotEmpty) {
+ if(name.contains(' '))
+ name = name.replaceAll(' ','_');
+
+ _analytics
+ .logEvent(name: name.trim(), parameters: parameters)
+ .then((value) {
+ debugPrint('SUCCESS: Google analytics event "$name" sent');
+ }).catchError((error) {
+ debugPrint('ERROR: Google analytics event "$name" sent failed');
+ });
}
}
-var analytics = FirebaseAnalytics();
class GAnalytics {
- const GAnalytics();
- static GAnalytics shared = const GAnalytics();
+ setUser(AuthenticatedUser user){
+ if(user != null){
+ _analytics.setUserProperty(name: 'user_country', value: user.iSOCountryID);
+ _analytics.setUserProperty(name: 'user_language', value: user.preferredLanguage);
+ _analytics.setUserProperty(name: 'userid', value: user.patientID.toString() );
+ _analytics.setUserProperty(name: 'login_status', value: 'yes');
+ }
+ }
+
NavObserver navObserver() => NavObserver();
+ final hamburgerMenu = HamburgerMenu(_logger);
+ final bottomTabNavigation = AppNav(_logger);
+ final hmgServices = HMGServices(_logger);
+ final loginRegistration = LoginRegistration(_logger);
+ final appointment = Appointment(_logger);
+ final liveCare = LiveCare(_logger);
+ final todoList = TodoList(_logger);
+ final advancePayments = AdvancePayments(_logger);
+ final offerPackages = OfferAndPromotion(_logger);
+ final errorTracking = ErrorTracking(_logger);
}
+
+
// adb shell setprop debug.firebase.analytics.app com.ejada.hmg -> Android
class NavObserver extends RouteObserver> {
_sendScreenView(PageRoute route) async {
log(String className) {
var event = AnalyticEvents.get(className);
if (event.active != null) {
- analytics
+ _analytics
.setCurrentScreen(
screenName: event.flutterName(), screenClassOverride: className)
.catchError(
diff --git a/lib/config/config.dart b/lib/config/config.dart
index d71b0620..e1177a58 100644
--- a/lib/config/config.dart
+++ b/lib/config/config.dart
@@ -259,7 +259,13 @@ const GET_PATIENT_SHARE =
//URL to get patient appointment history
const GET_PATIENT_APPOINTMENT_HISTORY =
- "Services/Doctors.svc/REST/PateintHasAppoimentHistory_Async";
+ "Services/Doctors.svc/REST/PateintHasAppoimentHistory";
+
+const GET_OBGYNE_ORDERS_LIST =
+ "services/Patients.svc/REST/HIS_OBGYNEProcedureGet";
+
+const GET_OBGYNE_DOCTORS_LIST =
+ "services/Doctors.svc/REST/HIS_ObgyneUltrasoundDoctors";
const DOCTOR_SCHEDULE_URL =
'Services/Doctors.svc/REST/GetDoctorWorkingHoursTable';
diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart
index 626b7c7f..69c2b10d 100644
--- a/lib/config/localized_values.dart
+++ b/lib/config/localized_values.dart
@@ -53,7 +53,7 @@ const Map localizedValues = {
'noResultFound': {'en': 'No Result Found', 'ar': 'لم يتم العثور على نتائج '},
'noSearchResultFound': {'en': 'No Result Found', 'ar': 'لم يتم العثور على نتائج الرجاء تغيير لغة البحث'},
'pleaseEnterProductName': {'en': 'Please Enter Product Name', 'ar': 'ادخل اسم المنتج'},
- 'bookNow': {'en': 'BOOK NOW', 'ar': 'احجز الآن'},
+ 'bookNow': {'en': 'Book Now', 'ar': 'احجز الآن'},
'docInfo': {'en': 'Doctor Information', 'ar': 'معلومات الطبيب'},
'appoInfo': {'en': 'Appointment Information', 'ar': 'معلومات الموعد'},
'availableAppo': {'en': 'Available Appointments', 'ar': 'المواعيد المتاحة'},
@@ -1751,5 +1751,5 @@ const Map localizedValues = {
"covidTestTodo": {"en": "Covid-19 Test", "ar": "فحص كورونا"},
"ancillaryOrdersPaymentConfirm": {"en": "Are you sure you want to make payment for selected orders?", "ar": "هل أنت متأكد أنك تريد سداد قيمة الطلبات المختارة؟"},
"successRegister": {"en": "Your account has been created.", "ar": "لقد تم إنشاء حسابك."},
- "ancillaryOrderPaymentSuccess": {"en": "Your payment has been successfully made. Your invoice no. is: ", "ar": "تم الدفع الخاص بك بنجاح. فاتورتك لا. يكون: "},
+ "pharmacyLiveCare": {"en": "Pharmacy LiveCare", "ar": "لايف كير صيدلية"},
};
diff --git a/lib/core/model/pharmacies/LakumInquiryInformationObjVersion.dart b/lib/core/model/pharmacies/LakumInquiryInformationObjVersion.dart
index e7948d7d..f1b64b1e 100644
--- a/lib/core/model/pharmacies/LakumInquiryInformationObjVersion.dart
+++ b/lib/core/model/pharmacies/LakumInquiryInformationObjVersion.dart
@@ -13,6 +13,7 @@ class LakumInquiryInformationObjVersion {
num expiredPoints;
String expiryDate;
num gainedPoints;
+ num gainedPointsAmount;
List gainedPointsAmountPerYear;
List gainedPointsDetails;
String lakumMessageStatus;
@@ -44,6 +45,7 @@ class LakumInquiryInformationObjVersion {
this.expiredPoints,
this.expiryDate,
this.gainedPoints,
+ this.gainedPointsAmount,
this.gainedPointsAmountPerYear,
this.gainedPointsDetails,
this.lakumMessageStatus,
@@ -85,6 +87,7 @@ class LakumInquiryInformationObjVersion {
expiredPoints = json['ExpiredPoints'];
expiryDate = json['ExpiryDate'];
gainedPoints = json['GainedPoints'];
+ gainedPointsAmount = json['GainedPointsAmount'];
if (json['GainedPointsAmountPerYear'] != null) {
gainedPointsAmountPerYear = new List();
json['GainedPointsAmountPerYear'].forEach((v) {
@@ -144,6 +147,7 @@ class LakumInquiryInformationObjVersion {
data['ExpiredPoints'] = this.expiredPoints;
data['ExpiryDate'] = this.expiryDate;
data['GainedPoints'] = this.gainedPoints;
+ data['GainedPointsAmount'] = this.gainedPointsAmount;
if (this.gainedPointsAmountPerYear != null) {
data['GainedPointsAmountPerYear'] =
this.gainedPointsAmountPerYear.map((v) => v).toList();
diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart
index 01050271..967e03c4 100644
--- a/lib/core/service/client/base_app_client.dart
+++ b/lib/core/service/client/base_app_client.dart
@@ -124,12 +124,12 @@ class BaseAppClient {
// body['IdentificationNo'] = 2076117163;
// body['MobileNo'] = "966503109207";
- // body['PatientID'] = 3648586; //3844083
- // body['TokenID'] = "@dm!n";
+ body['PatientID'] = 2380476; //3844083
+ body['TokenID'] = "@dm!n";
- // Patient ID: 2478442
- // Mobile no.: 0503109207
- // ID: 2076117163
+ // Patient ID: 3027574
+ // Mobile no.: 0502303285
+ // ID: 119116817
body.removeWhere((key, value) => key == null || value == null);
diff --git a/lib/core/service/parmacyModule/lacum-service.dart b/lib/core/service/parmacyModule/lacum-service.dart
index c7117303..d94632c2 100644
--- a/lib/core/service/parmacyModule/lacum-service.dart
+++ b/lib/core/service/parmacyModule/lacum-service.dart
@@ -12,12 +12,12 @@ class LacumService extends BaseService{
LacumAccountInformation lacumInformation;
LacumAccountInformation lacumGroupInformation;
- Future getLacumAccountInformation() async {
+ Future getLacumAccountInformation(String identificationNo) async {
hasError = false;
super.error = "";
Map body = Map();
- body['IdentificationNo'] = user.patientIdentificationNo;
+ body['IdentificationNo'] = identificationNo;
try {
await baseAppClient.post(GET_LACUM_ACCOUNT_INFORMATION,
@@ -32,12 +32,12 @@ class LacumService extends BaseService{
}
}
- Future getLacumGroupInformation() async {
+ Future getLacumGroupInformation(String identificationNo) async {
hasError = false;
super.error = "";
Map body = Map();
- body['IdentificationNo'] = user.patientIdentificationNo;
+ body['IdentificationNo'] = identificationNo;
body['AccountNumber'] = "${lacumInformation.yahalaAccountNo}";
body['IsDetailsRequired'] = true;
diff --git a/lib/core/viewModels/pharmacyModule/lacum-viewmodel.dart b/lib/core/viewModels/pharmacyModule/lacum-viewmodel.dart
index 1bd0d542..9f624ae5 100644
--- a/lib/core/viewModels/pharmacyModule/lacum-viewmodel.dart
+++ b/lib/core/viewModels/pharmacyModule/lacum-viewmodel.dart
@@ -22,14 +22,14 @@ class LacumViewModel extends BaseViewModel {
String get successMsg =>
_lacumService.successMsg;
- Future getLacumData() async {
- await getLacumAccountData();
- getLacumGroupData();
+ Future getLacumData(String identificationNo) async {
+ await getLacumAccountData(identificationNo);
+ getLacumGroupData(identificationNo);
}
- Future getLacumAccountData() async {
+ Future getLacumAccountData(String identificationNo) async {
setState(ViewState.Busy);
- await _lacumService.getLacumAccountInformation();
+ await _lacumService.getLacumAccountInformation(identificationNo);
if (_lacumService.hasError) {
error = _lacumService.error;
setState(ViewState.Error);
@@ -38,9 +38,9 @@ class LacumViewModel extends BaseViewModel {
}
}
- Future getLacumGroupData() async {
+ Future getLacumGroupData(String identificationNo) async {
setState(ViewState.Busy);
- await _lacumService.getLacumGroupInformation();
+ await _lacumService.getLacumGroupInformation(identificationNo);
if (_lacumService.hasError) {
error = _lacumService.error;
setState(ViewState.Error);
@@ -49,7 +49,7 @@ class LacumViewModel extends BaseViewModel {
}
}
- Future makeAccountActivate() async {
+ Future makeAccountActivate(String identificationNo) async {
setState(ViewState.Busy);
await _lacumService.makeAccountActivate();
if (_lacumService.hasError) {
@@ -57,11 +57,11 @@ class LacumViewModel extends BaseViewModel {
setState(ViewState.Error);
} else {
lacumGroupInformation.lakumInquiryInformationObjVersion.accountStatus = "Active";
- getLacumAccountData();
+ getLacumAccountData(identificationNo);
}
}
- Future makeAccountDeactivate() async {
+ Future makeAccountDeactivate(String identificationNo) async {
setState(ViewState.Busy);
await _lacumService.makeAccountDeactivate();
if (_lacumService.hasError) {
@@ -69,7 +69,7 @@ class LacumViewModel extends BaseViewModel {
setState(ViewState.Error);
} else {
lacumGroupInformation.lakumInquiryInformationObjVersion.accountStatus = "Cancelled";
- getLacumAccountData();
+ getLacumAccountData(identificationNo);
}
}
diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart
index ab2f931b..78ed83b4 100644
--- a/lib/core/viewModels/project_view_model.dart
+++ b/lib/core/viewModels/project_view_model.dart
@@ -1,9 +1,11 @@
import 'dart:async';
import 'package:connectivity/connectivity.dart';
+import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
+import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/cupertino.dart';
@@ -11,6 +13,9 @@ import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
var isAppArabic = false;
class ProjectViewModel extends BaseViewModel {
+
+ GAnalytics get analytics => locator();
+
// Platform Bridge
PlatformBridge platformBridge() {
return PlatformBridge.shared();
diff --git a/lib/locator.dart b/lib/locator.dart
index c0a8bd51..df0561fd 100644
--- a/lib/locator.dart
+++ b/lib/locator.dart
@@ -24,6 +24,7 @@ import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:get_it/get_it.dart';
+import 'analytics/google-analytics.dart';
import 'core/service/AlHabibMedicalService/cmc_service.dart';
import 'core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'core/service/AlHabibMedicalService/e_referral_service.dart';
@@ -325,4 +326,10 @@ void setupLocator() {
() => GeofencingServices()); // Geofencing Services
locator.registerFactory(() => TermsConditionsViewModel());
locator.registerFactory(() => AnciallryOrdersViewModel());
+
+
+ // Google/Firebase Analytics
+ // ---------------------------
+ locator.registerFactory(() => GAnalytics());
+
}
diff --git a/lib/main.dart b/lib/main.dart
index a3175350..12789f28 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -77,10 +77,10 @@ class _MyApp extends State {
LocalNotification.getInstance().showNow(title: "Payload", subtitle: payload, payload: payload);
});
- SystemChrome.setPreferredOrientations([
- DeviceOrientation.portraitUp,
- DeviceOrientation.portraitDown,
- ]);
+ // SystemChrome.setPreferredOrientations([
+ // DeviceOrientation.portraitUp,
+ // DeviceOrientation.portraitDown,
+ // ]);
// final themeNotifier = Provider.of(context);
precacheImage(AssetImage('assets/images/powerd-by.jpg'), context);
return LayoutBuilder(
diff --git a/lib/models/Appointments/DoctorListResponse.dart b/lib/models/Appointments/DoctorListResponse.dart
index d43dceb3..122f560f 100644
--- a/lib/models/Appointments/DoctorListResponse.dart
+++ b/lib/models/Appointments/DoctorListResponse.dart
@@ -1,22 +1,22 @@
class DoctorList {
- int clinicID;
+ num clinicID;
String clinicName;
String doctorTitle;
- int iD;
+ num iD;
String name;
- int projectID;
+ num projectID;
String projectName;
- int actualDoctorRate;
- int clinicRoomNo;
+ num actualDoctorRate;
+ num clinicRoomNo;
dynamic date;
dynamic appointmentDate;
dynamic dayName;
- int doctorID;
+ num doctorID;
String doctorImageURL;
dynamic doctorProfile;
dynamic doctorProfileInfo;
- int doctorRate;
- int gender;
+ num doctorRate;
+ num gender;
String genderDescription;
bool isAppointmentAllowed;
bool isDoctorAllowVedioCall;
@@ -30,13 +30,13 @@ class DoctorList {
String nationalityID;
String nationalityName;
dynamic nearestFreeSlot;
- int noOfPatientsRate;
- int originalClinicID;
- int personRate;
+ num noOfPatientsRate;
+ num originalClinicID;
+ num personRate;
dynamic projectDistanceInKiloMeters;
String qR;
dynamic qRString;
- int rateNumber;
+ num rateNumber;
dynamic serviceID;
String setupID;
List speciality;
diff --git a/lib/models/Appointments/OBGyneProcedureListResponse.dart b/lib/models/Appointments/OBGyneProcedureListResponse.dart
new file mode 100644
index 00000000..ca45583a
--- /dev/null
+++ b/lib/models/Appointments/OBGyneProcedureListResponse.dart
@@ -0,0 +1,136 @@
+class OBGyneProcedureListResponse {
+ String setupID;
+ int projectID;
+ int episodeID;
+ int appointmentNo;
+ int orderNo;
+ String procedureId;
+ int lineItemNo;
+ String orderDate;
+ int orderType;
+ int patientType;
+ int patientID;
+ int price;
+ int orderStatus;
+ bool isApprovalRequired;
+ bool isApprovalCreated;
+ bool isInvoiced;
+ bool isReferralInvoiced;
+ bool isEROrder;
+ bool isCash;
+ int uniqueRowID;
+ int status;
+ int clinicID;
+ int doctorID;
+ String procedureName;
+ String procedureNameN;
+ String clinicDescription;
+ String clinicDescriptionN;
+ String doctorName;
+ String doctorNameN;
+ String projectDescription;
+ String projectDescriptionN;
+
+ OBGyneProcedureListResponse(
+ {this.setupID,
+ this.projectID,
+ this.episodeID,
+ this.appointmentNo,
+ this.orderNo,
+ this.procedureId,
+ this.lineItemNo,
+ this.orderDate,
+ this.orderType,
+ this.patientType,
+ this.patientID,
+ this.price,
+ this.orderStatus,
+ this.isApprovalRequired,
+ this.isApprovalCreated,
+ this.isInvoiced,
+ this.isReferralInvoiced,
+ this.isEROrder,
+ this.isCash,
+ this.uniqueRowID,
+ this.status,
+ this.clinicID,
+ this.doctorID,
+ this.procedureName,
+ this.procedureNameN,
+ this.clinicDescription,
+ this.clinicDescriptionN,
+ this.doctorName,
+ this.doctorNameN,
+ this.projectDescription,
+ this.projectDescriptionN});
+
+ OBGyneProcedureListResponse.fromJson(Map json) {
+ setupID = json['SetupID'];
+ projectID = json['ProjectID'];
+ episodeID = json['EpisodeID'];
+ appointmentNo = json['AppointmentNo'];
+ orderNo = json['OrderNo'];
+ procedureId = json['ProcedureId'];
+ lineItemNo = json['LineItemNo'];
+ orderDate = json['OrderDate'];
+ orderType = json['OrderType'];
+ patientType = json['PatientType'];
+ patientID = json['PatientID'];
+ price = json['Price'];
+ orderStatus = json['OrderStatus'];
+ isApprovalRequired = json['IsApprovalRequired'];
+ isApprovalCreated = json['IsApprovalCreated'];
+ isInvoiced = json['IsInvoiced'];
+ isReferralInvoiced = json['IsReferralInvoiced'];
+ isEROrder = json['IsEROrder'];
+ isCash = json['IsCash'];
+ uniqueRowID = json['UniqueRowID'];
+ status = json['Status'];
+ clinicID = json['ClinicID'];
+ doctorID = json['DoctorID'];
+ procedureName = json['ProcedureName'];
+ procedureNameN = json['ProcedureNameN'];
+ clinicDescription = json['ClinicDescription'];
+ clinicDescriptionN = json['ClinicDescriptionN'];
+ doctorName = json['DoctorName'];
+ doctorNameN = json['DoctorNameN'];
+ projectDescription = json['ProjectDescription'];
+ projectDescriptionN = json['ProjectDescriptionN'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['SetupID'] = this.setupID;
+ data['ProjectID'] = this.projectID;
+ data['EpisodeID'] = this.episodeID;
+ data['AppointmentNo'] = this.appointmentNo;
+ data['OrderNo'] = this.orderNo;
+ data['ProcedureId'] = this.procedureId;
+ data['LineItemNo'] = this.lineItemNo;
+ data['OrderDate'] = this.orderDate;
+ data['OrderType'] = this.orderType;
+ data['PatientType'] = this.patientType;
+ data['PatientID'] = this.patientID;
+ data['Price'] = this.price;
+ data['OrderStatus'] = this.orderStatus;
+ data['IsApprovalRequired'] = this.isApprovalRequired;
+ data['IsApprovalCreated'] = this.isApprovalCreated;
+ data['IsInvoiced'] = this.isInvoiced;
+ data['IsReferralInvoiced'] = this.isReferralInvoiced;
+ data['IsEROrder'] = this.isEROrder;
+ data['IsCash'] = this.isCash;
+ data['UniqueRowID'] = this.uniqueRowID;
+ data['Status'] = this.status;
+ data['ClinicID'] = this.clinicID;
+ data['DoctorID'] = this.doctorID;
+ data['ProcedureName'] = this.procedureName;
+ data['ProcedureNameN'] = this.procedureNameN;
+ data['ClinicDescription'] = this.clinicDescription;
+ data['ClinicDescriptionN'] = this.clinicDescriptionN;
+ data['DoctorName'] = this.doctorName;
+ data['DoctorNameN'] = this.doctorNameN;
+ data['ProjectDescription'] = this.projectDescription;
+ data['ProjectDescriptionN'] = this.projectDescriptionN;
+ return data;
+ }
+}
diff --git a/lib/models/Clinics/ClinicListResponse.dart b/lib/models/Clinics/ClinicListResponse.dart
index 1aa4065e..6aadabc0 100644
--- a/lib/models/Clinics/ClinicListResponse.dart
+++ b/lib/models/Clinics/ClinicListResponse.dart
@@ -1,7 +1,7 @@
class ListClinicCentralized {
int clinicID;
String clinicDescription;
- Null clinicDescriptionN;
+ String clinicDescriptionN;
int age;
int gender;
bool isLiveCareClinicAndOnline;
diff --git a/lib/models/apple_pay_request.dart b/lib/models/apple_pay_request.dart
index 88e16316..4cb6a9e8 100644
--- a/lib/models/apple_pay_request.dart
+++ b/lib/models/apple_pay_request.dart
@@ -5,8 +5,8 @@ class ApplePayRequest {
dynamic customerEmail;
String orderdescription;
String liveServiceid;
- String longitude;
- String latitude;
+ dynamic longitude;
+ dynamic latitude;
String devicetoken;
String clientrequestid;
String projectid;
diff --git a/lib/pages/BookAppointment/BookConfirm.dart b/lib/pages/BookAppointment/BookConfirm.dart
index 105bb4db..04f50198 100644
--- a/lib/pages/BookAppointment/BookConfirm.dart
+++ b/lib/pages/BookAppointment/BookConfirm.dart
@@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
+import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
@@ -26,6 +27,7 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'book_reminder_page.dart';
+import 'components/DocAvailableAppointments.dart';
class BookConfirm extends StatefulWidget {
DoctorList doctor;
@@ -47,6 +49,7 @@ class BookConfirm extends StatefulWidget {
}
class _BookConfirmState extends State {
+ ProjectViewModel projectViewModel;
ToDoCountProviderModel toDoProvider;
AppSharedPreferences sharedPref = new AppSharedPreferences();
@@ -63,6 +66,7 @@ class _BookConfirmState extends State {
@override
Widget build(BuildContext context) {
toDoProvider = Provider.of(context);
+ projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: widget.doctor.doctorTitle + " " + widget.doctor.name,
isShowDecPage: false,
@@ -266,10 +270,14 @@ class _BookConfirmState extends State {
}
insertAppointment(context, DoctorList docObject) {
+ 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, context).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), () {
@@ -307,10 +315,14 @@ class _BookConfirmState extends State {
}
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']);
diff --git a/lib/pages/BookAppointment/BookSuccess.dart b/lib/pages/BookAppointment/BookSuccess.dart
index 04086ee3..15906851 100644
--- a/lib/pages/BookAppointment/BookSuccess.dart
+++ b/lib/pages/BookAppointment/BookSuccess.dart
@@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
+import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
@@ -20,6 +21,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
+import 'package:provider/provider.dart';
import 'QRCode.dart';
@@ -43,8 +45,11 @@ class _BookSuccessState extends State {
AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser;
+ ProjectViewModel projectViewModel;
+
@override
Widget build(BuildContext context) {
+ projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: widget.docObject.doctorTitle + " " + widget.docObject.name,
isShowDecPage: false,
@@ -182,6 +187,7 @@ 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();
},
child: Text(TranslationBase.of(context).payNow.toUpperCase(), style: TextStyle(fontSize: 18.0)),
@@ -203,6 +209,7 @@ 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);
},
child: Text(TranslationBase.of(context).payLater.toUpperCase(), style: TextStyle(fontSize: 18.0)),
@@ -388,6 +395,7 @@ class _BookSuccessState extends State {
}
confirmAppointment(AppoitmentAllHistoryResultList appo) {
+
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service.confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID, appo.isLiveCareAppointment, context).then((res) {
diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart
index 87941ed5..033d360b 100644
--- a/lib/pages/BookAppointment/DoctorProfile.dart
+++ b/lib/pages/BookAppointment/DoctorProfile.dart
@@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
+import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.dart';
@@ -20,6 +21,7 @@ import 'package:diplomaticquarterapp/widgets/new_design/doctor_header.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart';
import 'BookConfirm.dart';
@@ -59,8 +61,11 @@ class _DoctorProfileState extends State with TickerProviderStateM
super.initState();
}
+ ProjectViewModel projectViewModel;
+
@override
Widget build(BuildContext context) {
+ projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: widget.doctor.doctorTitle + " " + widget.doctor.name,
isShowAppBar: true,
@@ -122,6 +127,7 @@ 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(
@@ -490,6 +496,8 @@ class _DoctorProfileState extends State with TickerProviderStateM
void goToBookConfirm() async {
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);
} else {
ConfirmDialog dialog = new ConfirmDialog(
diff --git a/lib/pages/BookAppointment/QRCode.dart b/lib/pages/BookAppointment/QRCode.dart
index 4c89cf81..0b5356a0 100644
--- a/lib/pages/BookAppointment/QRCode.dart
+++ b/lib/pages/BookAppointment/QRCode.dart
@@ -2,6 +2,9 @@ import 'dart:convert';
import 'dart:typed_data';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
+import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
+import 'package:diplomaticquarterapp/locator.dart';
+import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
@@ -21,11 +24,12 @@ import 'package:flutter_nfc_kit/flutter_nfc_kit.dart';
class QRCode extends StatefulWidget {
PatientShareResponse patientShareResponse;
+ AppoitmentAllHistoryResultList appointment;
String appoQR;
AuthenticatedUser authUser;
AppSharedPreferences sharedPref = AppSharedPreferences();
- QRCode({@required this.patientShareResponse, @required this.appoQR});
+ QRCode({@required this.patientShareResponse, @required this.appoQR, @required this.appointment});
@override
_QRCodeState createState() => _QRCodeState();
@@ -43,12 +47,8 @@ class _QRCodeState extends State {
_bytes = base64.decode(widget.appoQR.split(',').last);
widget.authUser = new AuthenticatedUser();
- WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
- FlutterNfcKit.nfcAvailability.then((value) {
- setState(() {
- _supportsNFC = (value == NFCAvailability.available);
- });
- });
+ FlutterNfcKit.nfcAvailability.then((value) {
+ _supportsNFC = (value == NFCAvailability.available);
});
super.initState();
@@ -73,7 +73,7 @@ class _QRCodeState extends State {
height: MediaQuery.of(context).size.width / 3,
child: Row(
children: [
- widget.patientShareResponse.clinicID != 265
+ _supportsNFC
? Expanded(
flex: 1,
child: Row(
@@ -92,10 +92,13 @@ class _QRCodeState extends State {
child: Image.asset("assets/images/nfc/ic_nfc.png"),
),
onTap: () {
+ locator().analytics.todoList.to_do_list_nfc(widget.appointment);
showNfcReader(context, onNcfScan: (String nfcId) {
Future.delayed(const Duration(milliseconds: 100), () {
sendNfcCheckInRequest(nfcId);
});
+ }, onCancel: (){
+ locator().analytics.todoList.to_do_list_nfc_cancel(widget.appointment);
});
},
),
diff --git a/lib/pages/BookAppointment/QRCode.dart.orig b/lib/pages/BookAppointment/QRCode.dart.orig
new file mode 100644
index 00000000..83249dee
--- /dev/null
+++ b/lib/pages/BookAppointment/QRCode.dart.orig
@@ -0,0 +1,355 @@
+import 'dart:convert';
+import 'dart:typed_data';
+
+import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
+import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
+import 'package:diplomaticquarterapp/locator.dart';
+import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
+import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
+import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
+import 'package:diplomaticquarterapp/routes.dart';
+import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
+import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
+import 'package:diplomaticquarterapp/uitl/app_toast.dart';
+import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
+import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
+import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
+import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
+import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
+import 'package:diplomaticquarterapp/widgets/nfc/nfc_reader_sheet.dart';
+import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
+import 'package:flutter/material.dart';
+import 'package:flutter_nfc_kit/flutter_nfc_kit.dart';
+
+class QRCode extends StatefulWidget {
+ PatientShareResponse patientShareResponse;
+ String appoQR;
+ AuthenticatedUser authUser;
+ AppSharedPreferences sharedPref = AppSharedPreferences();
+
+ QRCode({@required this.patientShareResponse, @required this.appoQR});
+
+ @override
+ _QRCodeState createState() => _QRCodeState();
+}
+
+class _QRCodeState extends State {
+ Uint8List _bytes;
+ bool _supportsNFC = false;
+ BuildContext _context;
+
+ @override
+ void initState() {
+ // TODO: implement initState
+
+ _bytes = base64.decode(widget.appoQR.split(',').last);
+ widget.authUser = new AuthenticatedUser();
+
+ WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
+ FlutterNfcKit.nfcAvailability.then((value) {
+ setState(() {
+ _supportsNFC = (value == NFCAvailability.available);
+ });
+ });
+ });
+
+ super.initState();
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ _context = context;
+ return AppScaffold(
+ appBarTitle: TranslationBase.of(context).attendRegisterCode,
+ isShowAppBar: true,
+ showNewAppBar: true,
+ showNewAppBarTitle: true,
+ body: SingleChildScrollView(
+ child: Container(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisSize: MainAxisSize.max,
+ children: [
+ Container(
+ width: double.infinity,
+ height: MediaQuery.of(context).size.width / 3,
+ child: Row(
+ children: [
+<<<<<<< HEAD
+ _supportsNFC
+ ? Expanded(
+ flex: 1,
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ InkWell(
+ child: Container(
+ margin: EdgeInsets.only(top: 30.0),
+ alignment: Alignment.center,
+ padding: EdgeInsets.all(8),
+ decoration: BoxDecoration(
+ border: Border.all(color: Colors.black),
+ borderRadius: BorderRadius.circular(10),
+ ),
+ child: Image.asset("assets/images/nfc/ic_nfc.png"),
+ ),
+ onTap: () {
+ locator().analytics.todoList.to_do_list_nfc();
+ showNfcReader(context, onNcfScan: (String nfcId) {
+ Future.delayed(const Duration(milliseconds: 100), () {
+ sendNfcCheckInRequest(nfcId);
+ });
+ }, onCancel: (){
+ locator().analytics.todoList.to_do_list_nfc_cancel();
+ });
+ },
+ ),
+ ],
+=======
+ // _supportsNFC
+ // ?
+ Expanded(
+ flex: 1,
+ child: Row(
+ crossAxisAlignment: CrossAxisAlignment.center,
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ InkWell(
+ child: Container(
+ margin: EdgeInsets.only(top: 30.0),
+ alignment: Alignment.center,
+ padding: EdgeInsets.all(8),
+ decoration: BoxDecoration(
+ border: Border.all(color: Colors.black),
+ borderRadius: BorderRadius.circular(10),
+ ),
+ child: Image.asset("assets/images/nfc/ic_nfc.png"),
+>>>>>>> 259e27d4a7e8d7ddf751de88de36fe901df0e2da
+ ),
+ onTap: () {
+ showNfcReader(context, onNcfScan: (String nfcId) {
+ Future.delayed(const Duration(milliseconds: 100), () {
+ sendNfcCheckInRequest(nfcId);
+ });
+ });
+ },
+ ),
+ ],
+ ),
+ ),
+ // : Container(),
+ Expanded(
+ flex: 1,
+ child: Container(
+ margin: EdgeInsets.only(top: 30.0),
+ alignment: Alignment.center,
+ child: Image.memory(
+ _bytes,
+ ),
+ ),
+ ),
+ ],
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(top: 20.0, left: 20.0, right: 20.0),
+ child: Divider(
+ color: Colors.red[700],
+ thickness: 0.8,
+ ),
+ ),
+ Container(
+ child: Row(
+ children: [
+ Container(
+ margin: EdgeInsets.only(top: 10.0, left: 40.0, bottom: 10.0),
+ child: Image.asset("assets/images/new-design/device_icon.png", width: MediaQuery.of(context).size.width / 3.4, height: MediaQuery.of(context).size.width / 3.4),
+ ),
+ Expanded(
+ child: Container(
+ width: double.infinity,
+ margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
+ child: Text(TranslationBase.of(context).scanQRHospital, style: TextStyle(color: Colors.red[700], fontSize: 18.0, fontWeight: FontWeight.bold)),
+ ),
+ ),
+ ],
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(top: 10.0, left: 20.0, right: 20.0),
+ child: Divider(
+ color: Colors.red[700],
+ thickness: 0.8,
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
+ child: Text(TranslationBase.of(context).appoInfo, style: TextStyle(fontSize: 18.0, color: Colors.grey[700], fontWeight: FontWeight.bold)),
+ ),
+ Container(
+ margin: EdgeInsets.only(left: 20.0, bottom: 20.0, right: 20.0),
+ decoration: BoxDecoration(
+ borderRadius: BorderRadius.circular(10),
+ color: Colors.grey[200],
+ boxShadow: [
+ BoxShadow(color: Colors.grey, spreadRadius: 2),
+ ],
+ ),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Container(
+ margin: EdgeInsets.only(top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
+ child: Text(widget.patientShareResponse.doctorNameObj, style: TextStyle(fontSize: 18.0, color: Colors.grey[700], fontWeight: FontWeight.bold)),
+ ),
+ if (getDoctorSpeciality(widget.patientShareResponse.doctorSpeciality) != "null\n")
+ Container(
+ margin: EdgeInsets.only(bottom: 10.0, left: 20.0, right: 20.0),
+ child: Text(getDoctorSpeciality(widget.patientShareResponse.doctorSpeciality), style: TextStyle(fontSize: 18.0, color: Colors.grey[700])),
+ ),
+ Container(
+ margin: EdgeInsets.only(top: 0.0, bottom: 10.0, left: 20.0, right: 20.0),
+ child: Text(widget.patientShareResponse.projectName, style: TextStyle(fontSize: 18.0, color: Colors.grey[700])),
+ ),
+ Container(
+ margin: EdgeInsets.only(top: 0.0, bottom: 10.0, left: 20.0, right: 20.0),
+ child: Text(getDate(widget.patientShareResponse.appointmentDate), style: TextStyle(fontSize: 18.0, color: Colors.grey[700])),
+ ),
+ ],
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.only(left: 20.0, right: 20.0, top: 15.0),
+ alignment: Alignment.bottomCenter,
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.end,
+ children: [
+ DefaultButton(TranslationBase.of(context).sendEmail.toUpperCase(), () => {sendEmail()})
+ ],
+ ),
+ ),
+ ],
+ ),
+ ),
+ ),
+ );
+ }
+
+ sendEmail() async {
+ DoctorsListService service = new DoctorsListService();
+
+ if (await widget.sharedPref.getObject(USER_PROFILE) != null) {
+ var data = AuthenticatedUser.fromJson(await widget.sharedPref.getObject(USER_PROFILE));
+ setState(() {
+ widget.authUser = data;
+ });
+ }
+
+ ConfirmDialog dialog = new ConfirmDialog(
+ context: context,
+ confirmMessage: "Send a copy of this QR to the email " + widget.authUser.emailAddress + "?",
+ okText: TranslationBase.of(context).confirm,
+ cancelText: TranslationBase.of(context).cancel_nocaps,
+ okFunction: () {
+ GifLoaderDialogUtils.showMyDialog(context);
+ service
+ .sendAppointmentQREmail(widget.authUser.emailAddress, widget.patientShareResponse.appointmentDate, widget.patientShareResponse.appointmentNo.toString(),
+ widget.patientShareResponse.doctorNameObj, widget.patientShareResponse.projectName, widget.appoQR, getDoctorSpeciality(widget.patientShareResponse.doctorSpeciality), context)
+ .then((res) {
+ GifLoaderDialogUtils.hideDialog(context);
+ ConfirmDialog.closeAlertDialog(context);
+ }).catchError((err) {
+ ConfirmDialog.closeAlertDialog(context);
+ GifLoaderDialogUtils.hideDialog(context);
+ AppToast.showErrorToast(message: err);
+ print(err);
+ });
+ },
+ cancelFunction: () => {});
+ dialog.showAlertDialog(context);
+ }
+
+ Future navigateToHome(context) async {
+ Navigator.of(context).pushNamed(HOME);
+ }
+
+ getPatientShare(context, String appointmentNo, int clinicID, int projectID, DoctorList docObject) {}
+
+ String getDate(String appoDate) {
+ var appoDateFormatted = "";
+
+ var dateObj = DateUtil.convertStringToDate(appoDate);
+
+ setState(() {
+ appoDateFormatted = DateUtil.getWeekDay(dateObj.weekday) +
+ ", " +
+ dateObj.day.toString() +
+ " " +
+ DateUtil.getMonth(dateObj.month) +
+ " " +
+ dateObj.year.toString() +
+ ", " +
+ dateObj.hour.toString() +
+ ":" +
+ dateObj.minute.toString() +
+ ":00";
+ });
+
+ return appoDateFormatted;
+ }
+
+ String getDoctorSpeciality(List docSpecial) {
+ String docSpeciality = "";
+ if (docSpecial != null && docSpecial.length != 0) {
+ docSpecial.forEach((v) {
+ docSpeciality = docSpeciality + v + "\n";
+ });
+ }
+ return docSpeciality;
+ }
+
+ sendNfcCheckInRequest(String nfcId) {
+ GifLoaderDialogUtils.showMyDialog(context);
+
+ DoctorsListService service = new DoctorsListService();
+
+ service.sendCheckinNfcRequest(widget.patientShareResponse.appointmentNo, nfcId, widget.patientShareResponse.projectID, context).then((res) {
+ print(res);
+
+ GifLoaderDialogUtils.hideDialog(context);
+ _showMyDialog(res["SuccessMsg"], this.context);
+ }).catchError((err) {
+ GifLoaderDialogUtils.hideDialog(context);
+ print(err);
+ _showMyDialog(err, this.context);
+ });
+ }
+
+ Future _showMyDialog(String message, BuildContext context) async {
+ return showDialog(
+ context: context,
+ barrierDismissible: true, // user must tap button!
+ builder: (BuildContext context) {
+ return AlertDialog(
+ title: const Text('Alert'),
+ content: SingleChildScrollView(
+ child: ListBody(
+ children: [
+ Text(message),
+ ],
+ ),
+ ),
+ actions: [
+ TextButton(
+ child: const Text('OK'),
+ onPressed: () {
+ Navigator.of(context).pop();
+ },
+ ),
+ ],
+ );
+ },
+ );
+ }
+}
diff --git a/lib/pages/BookAppointment/Search.dart b/lib/pages/BookAppointment/Search.dart
index d4942ccf..e10e3258 100644
--- a/lib/pages/BookAppointment/Search.dart
+++ b/lib/pages/BookAppointment/Search.dart
@@ -26,7 +26,6 @@ class _SearchState extends State with TickerProviderStateMixin {
@override
void initState() {
_tabController = new TabController(length: 2, vsync: this, initialIndex: widget.type);
-
super.initState();
}
@@ -64,6 +63,12 @@ class _SearchState extends State with TickerProviderStateMixin {
letterSpacing: -0.48,
),
tabs: [Text(TranslationBase.of(context).clinicName), Text(TranslationBase.of(context).doctorName)],
+ onTap: (idx){
+ if(idx == 0)
+ projectViewModel.analytics.appointment.book_appointment_by_clinic();
+ else
+ projectViewModel.analytics.appointment.book_appointment_by_doctor();
+ },
),
Expanded(
child: TabBarView(
diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart
index e4744c4e..b29fa825 100644
--- a/lib/pages/BookAppointment/SearchResults.dart
+++ b/lib/pages/BookAppointment/SearchResults.dart
@@ -1,29 +1,34 @@
+import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
+import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
-// import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
class SearchResults extends StatefulWidget {
List doctorsList = [];
List patientDoctorAppointmentListHospital;
bool isLiveCareAppointment;
+ bool isObGyneAppointment;
+ OBGyneProcedureListResponse obGyneProcedureListResponse;
- SearchResults({@required this.doctorsList, this.patientDoctorAppointmentListHospital, @required this.isLiveCareAppointment});
+ SearchResults({@required this.doctorsList, this.patientDoctorAppointmentListHospital, this.isObGyneAppointment = false, @required this.isLiveCareAppointment, this.obGyneProcedureListResponse});
@override
_SearchResultsState createState() => _SearchResultsState();
}
class _SearchResultsState extends State {
- // var event = RobotProvider();
List tempList = [];
+ ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
+ projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo,
isShowDecPage: false,
@@ -37,23 +42,28 @@ class _SearchResultsState extends State {
return Container(
height: 12,
margin: EdgeInsets.only(left: 21, right: 21),
- // color: Color(0xffD9D9D9),
);
},
itemBuilder: (context, index) {
return AppExpandableNotifier(
- title: (widget.patientDoctorAppointmentListHospital[index].distanceInKMs != "0") ? widget.patientDoctorAppointmentListHospital[index].filterName + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km : widget.patientDoctorAppointmentListHospital[index].filterName,
+ title: (widget.patientDoctorAppointmentListHospital[index].distanceInKMs != "0")
+ ? widget.patientDoctorAppointmentListHospital[index].filterName + " - " + widget.patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km
+ : widget.patientDoctorAppointmentListHospital[index].filterName,
isTitleSingleLine: false,
bodyWidget: ListView.separated(
shrinkWrap: true,
physics: NeverScrollableScrollPhysics(),
padding: EdgeInsets.only(bottom: 10, top: 10, left: 21, right: 21),
itemBuilder: (context, _index) {
- //widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index].speciality = null;
+ final doctor = widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index];
return DoctorView(
- doctor: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index],
- isLiveCareAppointment: widget.isLiveCareAppointment ?? widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index].isLiveCare,
- );
+ doctor: doctor,
+ isLiveCareAppointment: widget.isLiveCareAppointment,
+ isObGyneAppointment: widget.isObGyneAppointment,
+ obGyneProcedureListResponse: widget.obGyneProcedureListResponse,
+ onTap: () {
+ projectViewModel.analytics.appointment.book_appointment_select_doctor(appointment_type: 'regular', doctor: doctor);
+ });
},
separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.length),
diff --git a/lib/pages/BookAppointment/book_reminder_page.dart b/lib/pages/BookAppointment/book_reminder_page.dart
index 39f1648f..ddf741f1 100644
--- a/lib/pages/BookAppointment/book_reminder_page.dart
+++ b/lib/pages/BookAppointment/book_reminder_page.dart
@@ -1,4 +1,5 @@
import 'package:auto_size_text/auto_size_text.dart';
+import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/header_model.dart';
@@ -14,6 +15,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:permission_handler/permission_handler.dart';
+import 'package:provider/provider.dart';
import 'BookSuccess.dart';
@@ -52,8 +54,10 @@ class _BookReminderPageState extends State {
});
}
+ ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
+ projectViewModel = Provider.of(context);
// print("selectedTime "+selectedTime??"");
print("appointmentNo1 " + widget.patientShareResponse.appointmentNo.toString() ?? "");
return AppScaffold(
@@ -173,6 +177,7 @@ class _BookReminderPageState extends State {
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFEAEAEA),
onPressed: () {
+ projectViewModel.analytics.appointment.appointment_reminder(false);
navigateToBookSuccess(context);
},
child: Text(TranslationBase.of(context).no, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48)),
@@ -194,6 +199,7 @@ class _BookReminderPageState extends State {
disabledTextColor: Colors.white,
disabledColor: CustomColors.green,
onPressed: () async {
+ projectViewModel.analytics.appointment.appointment_reminder(true);
print(widget.patientShareResponse.appointmentNo);
showReminderDialog(
context,
diff --git a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart
index 47e14629..0e7a3dc6 100644
--- a/lib/pages/BookAppointment/components/DocAvailableAppointments.dart
+++ b/lib/pages/BookAppointment/components/DocAvailableAppointments.dart
@@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
+import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart';
import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart';
@@ -12,6 +13,7 @@ import 'package:diplomaticquarterapp/uitl/utils_new.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:intl/intl.dart';
+import 'package:provider/provider.dart';
import 'package:syncfusion_flutter_calendar/calendar.dart';
import '../../../uitl/date_uitl.dart';
@@ -112,8 +114,11 @@ class _DocAvailableAppointmentsState extends State wit
});
}
+ ProjectViewModel projectViewModel;
+
@override
Widget build(BuildContext context) {
+ projectViewModel = Provider.of(context);
return SingleChildScrollView(
child: Container(
child: Column(
@@ -248,6 +253,10 @@ class _DocAvailableAppointmentsState extends State wit
elevation: 0,
textColor: new Color(0xFF60686b),
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;
@@ -284,8 +293,6 @@ class _DocAvailableAppointmentsState extends State wit
if (res['FreeTimeSlots'].length != 0) {
DocAvailableAppointments.areAppointmentsAvailable = true;
freeSlotsResponse = res['FreeTimeSlots'];
- print("res['FreeTimeSlots']");
- print(res['FreeTimeSlots'].length);
_getJSONSlots().then((value) {
setState(() => {
diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart
index d2fd68c9..12553388 100644
--- a/lib/pages/BookAppointment/components/SearchByClinic.dart
+++ b/lib/pages/BookAppointment/components/SearchByClinic.dart
@@ -228,6 +228,7 @@ class _SearchByClinicState extends State {
: InkWell(
onTap: () {
showClickListDialog(context, clinicsList, onSelection: (ListClinicCentralized clincs) {
+ projectViewModel.analytics.appointment.book_appointment_select_clinic(appointment_type: 'regular', clinic: clincs.clinicDescription);
Navigator.pop(context);
setState(() {
dropdownTitle = clincs.clinicDescription;
@@ -503,6 +504,7 @@ class _SearchByClinicState extends State {
} else {
isProjectLoaded = false;
}
+ }).catchError((err) {
}).catchError((err) {
print(err);
});
diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart
index 6bfac9a7..836bae7d 100644
--- a/lib/pages/BookAppointment/components/SearchByDoctor.dart
+++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart
@@ -1,3 +1,4 @@
+import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
@@ -6,6 +7,7 @@ import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
import '../SearchResults.dart';
@@ -17,6 +19,7 @@ class SearchByDoctor extends StatefulWidget {
class _SearchByDoctorState extends State {
TextEditingController doctorNameController = new TextEditingController();
bool _isButtonDisabled;
+ ProjectViewModel projectViewModel;
@override
void initState() {
@@ -26,6 +29,7 @@ class _SearchByDoctorState extends State {
@override
Widget build(BuildContext context) {
+ projectViewModel = Provider.of(context);
return Column(
children: [
Expanded(
@@ -143,6 +147,7 @@ class _SearchByDoctorState extends State {
}
_searchDoctor(BuildContext context) {
+ projectViewModel.analytics.appointment.book_appointment_doctor_search(query: doctorNameController.text);
getDoctorsList(context);
}
diff --git a/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart b/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart
index 3c56aa24..e5935ff3 100644
--- a/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart
+++ b/lib/pages/BookAppointment/widgets/DentalComplaintCard.dart
@@ -93,6 +93,6 @@ class _DentalComplaintCardState extends State {
}
Future navigateToSearchResults(context, List docList, List patientDoctorAppointmentListHospital) async {
- Navigator.push(context, FadePage(page: SearchResults(doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital)));
+ Navigator.push(context, FadePage(page: SearchResults(doctorsList: docList, patientDoctorAppointmentListHospital: patientDoctorAppointmentListHospital, isLiveCareAppointment: false)));
}
}
diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart
index 7ebc26ca..ae781cb3 100644
--- a/lib/pages/BookAppointment/widgets/DoctorView.dart
+++ b/lib/pages/BookAppointment/widgets/DoctorView.dart
@@ -1,6 +1,8 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
+import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResponse.dart';
+import 'package:diplomaticquarterapp/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
@@ -18,10 +20,12 @@ import '../DoctorProfile.dart';
class DoctorView extends StatelessWidget {
final DoctorList doctor;
bool isLiveCareAppointment;
+ bool isObGyneAppointment;
bool isShowFlag;
+ OBGyneProcedureListResponse obGyneProcedureListResponse;
final VoidCallback onTap;
- DoctorView({@required this.doctor, @required this.isLiveCareAppointment, this.isShowFlag = true, this.onTap});
+ DoctorView({@required this.doctor, @required this.isLiveCareAppointment, this.isObGyneAppointment = false, this.isShowFlag = true, this.onTap, this.obGyneProcedureListResponse});
ProjectViewModel projectViewModel;
@@ -29,10 +33,14 @@ class DoctorView extends StatelessWidget {
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return InkWell(
- onTap: onTap ??
- () {
- if (isShowFlag) getDoctorsProfile(context, doctor, isAppo: true);
- },
+ onTap: () {
+ if (isObGyneAppointment) {
+ next(context);
+ } else {
+ if (isShowFlag) getDoctorsProfile(context, doctor, isAppo: true);
+ (onTap ?? () {})(); // For log analytics of doctor click from book appointment
+ }
+ },
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
@@ -85,7 +93,7 @@ class DoctorView extends StatelessWidget {
children: [
if (doctor.clinicName != null) MyRichText(TranslationBase.of(context).clinic + ":", doctor.clinicName, projectViewModel.isArabic),
if (doctor.projectName != null) MyRichText(TranslationBase.of(context).branch, doctor.projectName, projectViewModel.isArabic),
- if (doctor.speciality != null)
+ if (doctor.speciality != null && doctor.speciality.length > 0)
Text(
this.doctor.speciality[0].trim(),
// getDoctorSpeciality(this.doctor.speciality).trim(),
@@ -184,6 +192,10 @@ class DoctorView extends StatelessWidget {
}
}
+ void next(BuildContext context) {
+ Navigator.push(context, FadePage(page: ObGyneTimeSlots(projectID: doctor.projectID, selectedClinicID: doctor.clinicID, selectedDoctorID: doctor.doctorID, obGyneProcedureListResponse: obGyneProcedureListResponse)));
+ }
+
Future navigateToDoctorProfile(context, docObject, docProfile, {isAppo}) async {
Navigator.push(
context,
diff --git a/lib/pages/BookAppointment/widgets/reminder_dialog.dart b/lib/pages/BookAppointment/widgets/reminder_dialog.dart
index 6fcab59a..eece4d9f 100644
--- a/lib/pages/BookAppointment/widgets/reminder_dialog.dart
+++ b/lib/pages/BookAppointment/widgets/reminder_dialog.dart
@@ -1,3 +1,5 @@
+import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
+import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@@ -41,23 +43,30 @@ Future _showReminderDialog(BuildContext context, DateTime dateTime, String
insetPadding: EdgeInsets.all(21),
child: ReminderDialog(
onClick: (int i) async {
+ String text = "";
if (i == 0) {
// Before 30 mints
dateTime = Jiffy(dateTime).subtract(minutes: 30).dateTime;
+ text = "30 minutes";
// dateTime.add(new Duration(minutes: -30));
} else if (i == 1) {
// Before 1 hour
// dateTime.add(new Duration(minutes: -60));
dateTime = Jiffy(dateTime).subtract(hours: 1).dateTime;
+ text = "1 hours";
} else if (i == 2) {
// Before 1 hour and 30 mints
// dateTime.add(new Duration(minutes: -90));
dateTime = Jiffy(dateTime).subtract(hours: 1, minutes: 30).dateTime;
+ text = "1 hours 30 minutes";
} else if (i == 3) {
// Before 2 hours
// dateTime.add(new Duration(minutes: -120));
dateTime = Jiffy(dateTime).subtract(hours: 2).dateTime;
+ text = "2 hours";
}
+
+ locator().appointment.appointment_reminder_time(reminde_before: text);
if (onMultiDateSuccess == null) {
CalendarUtils calendarUtils = await CalendarUtils.getInstance();
calendarUtils
diff --git a/lib/pages/MyAppointments/AppointmentDetails.dart b/lib/pages/MyAppointments/AppointmentDetails.dart
index 06710183..901e6c6c 100644
--- a/lib/pages/MyAppointments/AppointmentDetails.dart
+++ b/lib/pages/MyAppointments/AppointmentDetails.dart
@@ -551,6 +551,7 @@ 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();
} else {
@@ -567,6 +568,8 @@ 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) {
getToDoCount();
diff --git a/lib/pages/MyAppointments/SchedulePage.dart b/lib/pages/MyAppointments/SchedulePage.dart
index 92fbeedf..17cae84e 100644
--- a/lib/pages/MyAppointments/SchedulePage.dart
+++ b/lib/pages/MyAppointments/SchedulePage.dart
@@ -97,6 +97,8 @@ class _SchedulePageState extends State {
itemCount: weeks[index].length,
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]);
},
child: Row(
diff --git a/lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart b/lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart
new file mode 100644
index 00000000..2a5339bb
--- /dev/null
+++ b/lib/pages/ToDoList/ObGyne/ObGyne-TimeSlots.dart
@@ -0,0 +1,543 @@
+import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
+import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
+import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
+import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart';
+import 'package:diplomaticquarterapp/models/Appointments/OBGyneProcedureListResponse.dart';
+import 'package:diplomaticquarterapp/models/Appointments/timeSlot.dart';
+import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
+import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
+import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
+import 'package:diplomaticquarterapp/theme/colors.dart';
+import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
+import 'package:diplomaticquarterapp/uitl/app_toast.dart';
+import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
+import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
+import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
+import 'package:diplomaticquarterapp/uitl/utils_new.dart';
+import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
+import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
+import 'package:flutter/material.dart';
+import 'package:intl/intl.dart';
+import 'package:provider/provider.dart';
+import 'package:syncfusion_flutter_calendar/calendar.dart';
+
+class ObGyneTimeSlots extends StatefulWidget {
+ int projectID;
+ static bool areSlotsAvailable = false;
+ static DateTime selectedAppoDateTime;
+ static String selectedDate;
+ static String selectedTime;
+
+ int selectedClinicID;
+ int selectedDoctorID;
+
+ OBGyneProcedureListResponse obGyneProcedureListResponse;
+
+ var language;
+
+ ObGyneTimeSlots({@required this.projectID, this.selectedClinicID, this.selectedDoctorID, this.obGyneProcedureListResponse});
+
+ @override
+ _CovidTimeSlotsState createState() => _CovidTimeSlotsState();
+}
+
+class _CovidTimeSlotsState extends State with TickerProviderStateMixin {
+ Map _events;
+ AnimationController _animationController;
+ CalendarController _calendarController;
+
+ AppSharedPreferences sharedPref = new AppSharedPreferences();
+
+ var selectedDate = "";
+ dynamic selectedDateJSON;
+ dynamic jsonFreeSlots;
+
+ List docFreeSlots = [];
+ List dayEvents = [];
+
+ int selectedButtonIndex = 0;
+
+ dynamic freeSlotsResponse;
+
+ ScrollController _scrollController;
+
+ ToDoCountProviderModel toDoProvider;
+ ProjectViewModel projectViewModel;
+
+ @override
+ void initState() {
+ final _selectedDay = DateTime.now();
+
+ _scrollController = new ScrollController();
+
+ _events = {
+ _selectedDay: ['Event A0']
+ };
+
+ WidgetsBinding.instance.addPostFrameCallback((_) => getCovidFreeSlots(context, widget.projectID));
+
+ _calendarController = CalendarController();
+ _animationController = AnimationController(
+ vsync: this,
+ duration: const Duration(milliseconds: 50),
+ );
+
+ _animationController.forward();
+ super.initState();
+ }
+
+ @override
+ void dispose() {
+ _animationController.dispose();
+ _calendarController.dispose();
+ super.dispose();
+ }
+
+ void _onDaySelected(DateTime day, ProjectViewModel projectViewModel) {
+ final DateFormat formatter = DateFormat('yyyy-MM-dd');
+ setState(() {
+ this.selectedDate = DateUtil.getWeekDayMonthDayYearDateFormatted(day, projectViewModel.isArabic ? "ar" : "en");
+ openTimeSlotsPickerForDate(day, docFreeSlots);
+ ObGyneTimeSlots.selectedDate = formatter.format(day);
+ _calendarController.selectedDate = day;
+ print(ObGyneTimeSlots.selectedDate);
+ });
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ projectViewModel = Provider.of(context);
+ toDoProvider = Provider.of(context);
+ return AppScaffold(
+ appBarTitle: TranslationBase.of(context).bookAppo,
+ isShowAppBar: true,
+ showNewAppBar: true,
+ showNewAppBarTitle: true,
+ backgroundColor: CustomColors.appBackgroudGrey2Color,
+ body: Column(
+ children: [
+ Expanded(
+ child: SingleChildScrollView(
+ child: Container(
+ margin: EdgeInsets.fromLTRB(15.0, 15.0, 15.0, 0.0),
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Container(
+ child: Column(
+ crossAxisAlignment: CrossAxisAlignment.start,
+ mainAxisSize: MainAxisSize.max,
+ children: [
+ Text(
+ TranslationBase.of(context).selectAppo,
+ style: TextStyle(
+ color: Colors.black,
+ fontSize: 16.0,
+ letterSpacing: -0.64,
+ fontWeight: FontWeight.w600,
+ ),
+ ),
+ mHeight(12),
+ Container(
+ decoration: cardRadius(12),
+ child: _buildTableCalendarWithBuilders(projectViewModel),
+ ),
+ mHeight(12),
+ Text(
+ selectedDate,
+ style: TextStyle(
+ fontSize: 16.0,
+ fontWeight: FontWeight.bold,
+ letterSpacing: -0.64,
+ ),
+ ),
+ mHeight(8),
+ ObGyneTimeSlots.areSlotsAvailable
+ ? Container(
+ height: 40,
+ child: ListView.builder(
+ controller: _scrollController,
+ scrollDirection: Axis.horizontal,
+ itemCount: dayEvents.length,
+ itemBuilder: (context, index) {
+ return Container(
+ margin: EdgeInsets.only(right: (index == dayEvents.length - 1) ? 0 : 5.0, left: index == 0 ? 0 : 5),
+ child: ButtonTheme(
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(5.0),
+ side: BorderSide(
+ color: index == selectedButtonIndex ? CustomColors.green : Colors.black, //Color of the border
+ style: BorderStyle.solid, //Style of the border
+ width: 1.5, //width of the border
+ ),
+ ),
+ minWidth: MediaQuery.of(context).size.width * 0.2,
+ child: index == selectedButtonIndex ? getSelectedButton(index) : getNormalButton(index)),
+ );
+ },
+ ),
+ )
+ : Center(
+ child: Padding(
+ padding: const EdgeInsets.only(left: 12.0, right: 12.0),
+ child: Text(TranslationBase.of(context).noSlotsError, style: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: CustomColors.grey)),
+ )),
+ ],
+ ),
+ ),
+ SizedBox(
+ height: 100.0,
+ ),
+ ],
+ ),
+ ),
+ ),
+ ),
+ Container(
+ margin: EdgeInsets.zero,
+ decoration: cardRadius(0),
+ child: Container(
+ width: double.infinity,
+ padding: EdgeInsets.all(12),
+ child: ButtonTheme(
+ shape: RoundedRectangleBorder(
+ borderRadius: BorderRadius.circular(10.0),
+ ),
+ minWidth: MediaQuery.of(context).size.width * 0.7,
+ height: 45.0,
+ child: RaisedButton(
+ color: CustomColors.green,
+ textColor: Colors.white,
+ disabledTextColor: Colors.white,
+ elevation: 0,
+ disabledColor: Colors.grey[500],
+ onPressed: () {
+ bookCovidTestAppointment();
+ },
+ child: Text(
+ TranslationBase.of(context).bookAppo,
+ style: TextStyle(
+ fontSize: 16.0,
+ letterSpacing: -0.64,
+ ),
+ ),
+ ),
+ ),
+ ),
+ )
+ ],
+ ),
+ );
+ }
+
+ Widget _buildTableCalendarWithBuilders(ProjectViewModel projectViewModel) {
+ return SfCalendar(
+ controller: _calendarController,
+ minDate: DateTime.now(),
+ showNavigationArrow: true,
+ headerStyle: CalendarHeaderStyle(textAlign: TextAlign.center, textStyle: TextStyle(fontSize: 14.0, fontWeight: FontWeight.w600, letterSpacing: -0.46)),
+ viewHeaderStyle: ViewHeaderStyle(dayTextStyle: TextStyle(fontSize: 12.0, fontWeight: FontWeight.w600, letterSpacing: -0.46, color: CustomColors.black)),
+ view: CalendarView.month,
+ todayHighlightColor: CustomColors.green,
+ selectionDecoration: containerColorRadiusBorderWidthCircular(Colors.transparent, 4, CustomColors.green, 2.5),
+ cellBorderColor: Colors.white,
+ dataSource: MeetingDataSource(_getDataSource()),
+ monthViewSettings: const MonthViewSettings(appointmentDisplayMode: MonthAppointmentDisplayMode.indicator, showTrailingAndLeadingDates: false, appointmentDisplayCount: 1),
+ onTap: (CalendarTapDetails details) {
+ _calendarController.selectedDate = details.date;
+ _onDaySelected(details.date, projectViewModel);
+ },
+ );
+ }
+
+ List _getDataSource() {
+ final List meetings = [];
+ _events.forEach((key, value) {
+ final DateTime startTime = DateTime(key.year, key.month, key.day, 9, 0, 0);
+ final DateTime endTime = startTime.add(const Duration(minutes: 20));
+ meetings.add(Meeting("", startTime, endTime, CustomColors.green, false));
+ });
+ return meetings;
+ }
+
+ openTimeSlotsPickerForDate(DateTime dateStart, List freeSlots) {
+ dayEvents.clear();
+ DateTime dateStartObj = new DateTime(dateStart.year, dateStart.month, dateStart.day, 0, 0, 0, 0, 0);
+
+ freeSlots.forEach((v) {
+ if (v.start == dateStartObj) dayEvents.add(v);
+ });
+
+ setState(() {
+ if (dayEvents.length != 0) {
+ ObGyneTimeSlots.areSlotsAvailable = true;
+ selectedButtonIndex = 0;
+ ObGyneTimeSlots.selectedTime = dayEvents[selectedButtonIndex].isoTime;
+ } else
+ ObGyneTimeSlots.areSlotsAvailable = false;
+ });
+ }
+
+ Future