Merge branch 'zik_new_design_flutter_v2.5' into 'development_v2.5'

Zik new design flutter v2.5

See merge request Cloud_Solution/diplomatic-quarter!586
merge-update-with-lab-changes
haroon amjad 4 years ago
commit 9852811983

@ -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
});
}
}

@ -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
});
}
}

@ -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: {
});
}
}

@ -0,0 +1,8 @@
import '../google-analytics.dart';
class ErrorTracking{
final GALogger logger;
ErrorTracking(this.logger);
}

@ -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
});
}
}

@ -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
});
}
}

@ -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
}
}

@ -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');
}
}

@ -0,0 +1,9 @@
import '../google-analytics.dart';
class OfferAndPromotion{
final GALogger logger;
OfferAndPromotion(this.logger);
final offers_and_promotion = 'offers_&_promotion';
}

@ -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,
});
}
}

@ -1,4 +1,13 @@
import 'package:diplomaticquarterapp/analytics/analytic-events.dart'; 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/routes.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:firebase_analytics/firebase_analytics.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/material.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
class Singleton { import 'flows/app_nav.dart';
const Singleton(); //Constant constructor import 'flows/hmg_services.dart';
void hello() {
print('Hello world'); typedef GALogger = Function(String name, {Map<String,dynamic> parameters});
var _analytics = FirebaseAnalytics();
_logger(String name, {Map<String,dynamic> 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 { class GAnalytics {
const GAnalytics(); setUser(AuthenticatedUser user){
static GAnalytics shared = const GAnalytics(); 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(); 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 // adb shell setprop debug.firebase.analytics.app com.ejada.hmg -> Android
class NavObserver extends RouteObserver<PageRoute<dynamic>> { class NavObserver extends RouteObserver<PageRoute<dynamic>> {
_sendScreenView(PageRoute route) async { _sendScreenView(PageRoute route) async {
log(String className) { log(String className) {
var event = AnalyticEvents.get(className); var event = AnalyticEvents.get(className);
if (event.active != null) { if (event.active != null) {
analytics _analytics
.setCurrentScreen( .setCurrentScreen(
screenName: event.flutterName(), screenClassOverride: className) screenName: event.flutterName(), screenClassOverride: className)
.catchError( .catchError(

@ -1,9 +1,11 @@
import 'dart:async'; import 'dart:async';
import 'package:connectivity/connectivity.dart'; import 'package:connectivity/connectivity.dart';
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart'; import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.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/PlatformBridge.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -11,6 +13,9 @@ import 'package:flutter_datetime_picker/flutter_datetime_picker.dart';
var isAppArabic = false; var isAppArabic = false;
class ProjectViewModel extends BaseViewModel { class ProjectViewModel extends BaseViewModel {
GAnalytics get analytics => locator<GAnalytics>();
// Platform Bridge // Platform Bridge
PlatformBridge platformBridge() { PlatformBridge platformBridge() {
return PlatformBridge.shared(); return PlatformBridge.shared();

@ -24,6 +24,7 @@ import 'package:diplomaticquarterapp/uitl/navigation_service.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:get_it/get_it.dart'; import 'package:get_it/get_it.dart';
import 'analytics/google-analytics.dart';
import 'core/service/AlHabibMedicalService/cmc_service.dart'; import 'core/service/AlHabibMedicalService/cmc_service.dart';
import 'core/service/AlHabibMedicalService/customer_addresses_service.dart'; import 'core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'core/service/AlHabibMedicalService/e_referral_service.dart'; import 'core/service/AlHabibMedicalService/e_referral_service.dart';
@ -325,4 +326,10 @@ void setupLocator() {
() => GeofencingServices()); // Geofencing Services () => GeofencingServices()); // Geofencing Services
locator.registerFactory(() => TermsConditionsViewModel()); locator.registerFactory(() => TermsConditionsViewModel());
locator.registerFactory(() => AnciallryOrdersViewModel()); locator.registerFactory(() => AnciallryOrdersViewModel());
// Google/Firebase Analytics
// ---------------------------
locator.registerFactory(() => GAnalytics());
} }

@ -1,7 +1,7 @@
class ListClinicCentralized { class ListClinicCentralized {
int clinicID; int clinicID;
String clinicDescription; String clinicDescription;
Null clinicDescriptionN; String clinicDescriptionN;
int age; int age;
int gender; int gender;
bool isLiveCareClinicAndOnline; bool isLiveCareClinicAndOnline;

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; 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/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.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 'package:provider/provider.dart';
import 'book_reminder_page.dart'; import 'book_reminder_page.dart';
import 'components/DocAvailableAppointments.dart';
class BookConfirm extends StatefulWidget { class BookConfirm extends StatefulWidget {
DoctorList doctor; DoctorList doctor;
@ -47,6 +49,7 @@ class BookConfirm extends StatefulWidget {
} }
class _BookConfirmState extends State<BookConfirm> { class _BookConfirmState extends State<BookConfirm> {
ProjectViewModel projectViewModel;
ToDoCountProviderModel toDoProvider; ToDoCountProviderModel toDoProvider;
AppSharedPreferences sharedPref = new AppSharedPreferences(); AppSharedPreferences sharedPref = new AppSharedPreferences();
@ -63,6 +66,7 @@ class _BookConfirmState extends State<BookConfirm> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
toDoProvider = Provider.of<ToDoCountProviderModel>(context); toDoProvider = Provider.of<ToDoCountProviderModel>(context);
projectViewModel = Provider.of<ProjectViewModel>(context);
return AppScaffold( return AppScaffold(
appBarTitle: widget.doctor.doctorTitle + " " + widget.doctor.name, appBarTitle: widget.doctor.doctorTitle + " " + widget.doctor.name,
isShowDecPage: false, isShowDecPage: false,
@ -266,10 +270,14 @@ class _BookConfirmState extends State<BookConfirm> {
} }
insertAppointment(context, DoctorList docObject) { 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); GifLoaderDialogUtils.showMyDialog(context);
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
widget.service.insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, widget.selectedTime, widget.selectedDate, context).then((res) { widget.service.insertAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, widget.selectedTime, widget.selectedDate, context).then((res) {
if (res['MessageStatus'] == 1) { 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); AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
Future.delayed(new Duration(milliseconds: 500), () { Future.delayed(new Duration(milliseconds: 500), () {
@ -307,10 +315,14 @@ class _BookConfirmState extends State<BookConfirm> {
} }
insertLiveCareScheduledAppointment(context, DoctorList docObject) { 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); GifLoaderDialogUtils.showMyDialog(context);
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
widget.service.insertLiveCareScheduleAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, docObject.serviceID, widget.selectedTime, widget.selectedDate, context).then((res) { widget.service.insertLiveCareScheduleAppointment(docObject.doctorID, docObject.clinicID, docObject.projectID, docObject.serviceID, widget.selectedTime, widget.selectedDate, context).then((res) {
if (res['MessageStatus'] == 1) { 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); AppToast.showSuccessToast(message: TranslationBase.of(context).bookedSuccess);
print(res['AppointmentNo']); print(res['AppointmentNo']);

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; 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/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.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:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:provider/provider.dart';
import 'QRCode.dart'; import 'QRCode.dart';
@ -43,8 +45,11 @@ class _BookSuccessState extends State<BookSuccess> {
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser; AuthenticatedUser authUser;
ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of<ProjectViewModel>(context);
return AppScaffold( return AppScaffold(
appBarTitle: widget.docObject.doctorTitle + " " + widget.docObject.name, appBarTitle: widget.docObject.doctorTitle + " " + widget.docObject.name,
isShowDecPage: false, isShowDecPage: false,
@ -182,6 +187,7 @@ class _BookSuccessState extends State<BookSuccess> {
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4), disabledColor: new Color(0xFFbcc2c4),
onPressed: () { onPressed: () {
projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: true);
startPaymentProcess(); startPaymentProcess();
}, },
child: Text(TranslationBase.of(context).payNow.toUpperCase(), style: TextStyle(fontSize: 18.0)), child: Text(TranslationBase.of(context).payNow.toUpperCase(), style: TextStyle(fontSize: 18.0)),
@ -203,6 +209,7 @@ class _BookSuccessState extends State<BookSuccess> {
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4), disabledColor: new Color(0xFFbcc2c4),
onPressed: () { onPressed: () {
projectViewModel.analytics.appointment.pay_now_for_appointment(appointment_type: 'regular', doctorDetail: widget.docObject, payNow: false);
navigateToHome(context); navigateToHome(context);
}, },
child: Text(TranslationBase.of(context).payLater.toUpperCase(), style: TextStyle(fontSize: 18.0)), child: Text(TranslationBase.of(context).payLater.toUpperCase(), style: TextStyle(fontSize: 18.0)),
@ -388,6 +395,7 @@ class _BookSuccessState extends State<BookSuccess> {
} }
confirmAppointment(AppoitmentAllHistoryResultList appo) { confirmAppointment(AppoitmentAllHistoryResultList appo) {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID, appo.isLiveCareAppointment, context).then((res) { service.confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID, appo.isLiveCareAppointment, context).then((res) {

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; 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/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorRateDetails.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/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import 'BookConfirm.dart'; import 'BookConfirm.dart';
@ -59,8 +61,11 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
super.initState(); super.initState();
} }
ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
appBarTitle: widget.doctor.doctorTitle + " " + widget.doctor.name, appBarTitle: widget.doctor.doctorTitle + " " + widget.doctor.name,
isShowAppBar: true, isShowAppBar: true,
@ -122,6 +127,7 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
showConfirmMessageDialog: false, showConfirmMessageDialog: false,
isNeedToShowButton: !widget.isLiveCareAppointment, isNeedToShowButton: !widget.isLiveCareAppointment,
onTap: () { onTap: () {
projectViewModel.analytics.appointment.book_appointment_schedule(appointment_type: 'regular', doctor: widget.doctor);
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -490,6 +496,8 @@ class _DoctorProfileState extends State<DoctorProfile> with TickerProviderStateM
void goToBookConfirm() async { void goToBookConfirm() async {
if (DocAvailableAppointments.areSlotsAvailable) { if (DocAvailableAppointments.areSlotsAvailable) {
if (await sharedPref.getObject(USER_PROFILE) != null) { 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); navigateToBookConfirm(context);
} else { } else {
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(

@ -2,6 +2,9 @@ import 'dart:convert';
import 'dart:typed_data'; import 'dart:typed_data';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; 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/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.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 { class QRCode extends StatefulWidget {
PatientShareResponse patientShareResponse; PatientShareResponse patientShareResponse;
AppoitmentAllHistoryResultList appointment;
String appoQR; String appoQR;
AuthenticatedUser authUser; AuthenticatedUser authUser;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
QRCode({@required this.patientShareResponse, @required this.appoQR}); QRCode({@required this.patientShareResponse, @required this.appoQR, @required this.appointment});
@override @override
_QRCodeState createState() => _QRCodeState(); _QRCodeState createState() => _QRCodeState();
@ -43,12 +47,8 @@ class _QRCodeState extends State<QRCode> {
_bytes = base64.decode(widget.appoQR.split(',').last); _bytes = base64.decode(widget.appoQR.split(',').last);
widget.authUser = new AuthenticatedUser(); widget.authUser = new AuthenticatedUser();
WidgetsBinding.instance.addPostFrameCallback((timeStamp) { FlutterNfcKit.nfcAvailability.then((value) {
FlutterNfcKit.nfcAvailability.then((value) { _supportsNFC = (value == NFCAvailability.available);
setState(() {
_supportsNFC = (value == NFCAvailability.available);
});
});
}); });
super.initState(); super.initState();
@ -73,7 +73,7 @@ class _QRCodeState extends State<QRCode> {
height: MediaQuery.of(context).size.width / 3, height: MediaQuery.of(context).size.width / 3,
child: Row( child: Row(
children: [ children: [
widget.patientShareResponse.clinicID != 265 _supportsNFC
? Expanded( ? Expanded(
flex: 1, flex: 1,
child: Row( child: Row(
@ -92,10 +92,13 @@ class _QRCodeState extends State<QRCode> {
child: Image.asset("assets/images/nfc/ic_nfc.png"), child: Image.asset("assets/images/nfc/ic_nfc.png"),
), ),
onTap: () { onTap: () {
locator<ProjectViewModel>().analytics.todoList.to_do_list_nfc(widget.appointment);
showNfcReader(context, onNcfScan: (String nfcId) { showNfcReader(context, onNcfScan: (String nfcId) {
Future.delayed(const Duration(milliseconds: 100), () { Future.delayed(const Duration(milliseconds: 100), () {
sendNfcCheckInRequest(nfcId); sendNfcCheckInRequest(nfcId);
}); });
}, onCancel: (){
locator<ProjectViewModel>().analytics.todoList.to_do_list_nfc_cancel(widget.appointment);
}); });
}, },
), ),

@ -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<QRCode> {
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: <Widget>[
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<ProjectViewModel>().analytics.todoList.to_do_list_nfc();
showNfcReader(context, onNcfScan: (String nfcId) {
Future.delayed(const Duration(milliseconds: 100), () {
sendNfcCheckInRequest(nfcId);
});
}, onCancel: (){
locator<ProjectViewModel>().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: <Widget>[
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: <Widget>[
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: <Widget>[
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<String> 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<void> _showMyDialog(String message, BuildContext context) async {
return showDialog<void>(
context: context,
barrierDismissible: true, // user must tap button!
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Alert'),
content: SingleChildScrollView(
child: ListBody(
children: <Widget>[
Text(message),
],
),
),
actions: <Widget>[
TextButton(
child: const Text('OK'),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
},
);
}
}

@ -26,7 +26,6 @@ class _SearchState extends State<Search> with TickerProviderStateMixin {
@override @override
void initState() { void initState() {
_tabController = new TabController(length: 2, vsync: this, initialIndex: widget.type); _tabController = new TabController(length: 2, vsync: this, initialIndex: widget.type);
super.initState(); super.initState();
} }
@ -64,6 +63,12 @@ class _SearchState extends State<Search> with TickerProviderStateMixin {
letterSpacing: -0.48, letterSpacing: -0.48,
), ),
tabs: [Text(TranslationBase.of(context).clinicName), Text(TranslationBase.of(context).doctorName)], 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( Expanded(
child: TabBarView( child: TabBarView(

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
@ -6,6 +7,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart'; import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class SearchResults extends StatefulWidget { class SearchResults extends StatefulWidget {
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
@ -21,9 +23,11 @@ class SearchResults extends StatefulWidget {
class _SearchResultsState extends State<SearchResults> { class _SearchResultsState extends State<SearchResults> {
// var event = RobotProvider(); // var event = RobotProvider();
List<DoctorList> tempList = []; List<DoctorList> tempList = [];
ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo, appBarTitle: TranslationBase.of(context).bookAppo,
isShowDecPage: false, isShowDecPage: false,
@ -50,9 +54,13 @@ class _SearchResultsState extends State<SearchResults> {
padding: EdgeInsets.only(bottom: 10, top: 10, left: 21, right: 21), padding: EdgeInsets.only(bottom: 10, top: 10, left: 21, right: 21),
itemBuilder: (context, _index) { itemBuilder: (context, _index) {
//widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index].speciality = null; //widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index].speciality = null;
final doctor = widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index];
return DoctorView( return DoctorView(
doctor: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index], doctor: doctor,
isLiveCareAppointment: widget.isLiveCareAppointment ?? widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index].isLiveCare, isLiveCareAppointment: widget.isLiveCareAppointment,
onTap: (){
projectViewModel.analytics.appointment.book_appointment_select_doctor(appointment_type: 'regular', doctor: doctor);
}
); );
}, },
separatorBuilder: (context, index) => SizedBox(height: 14), separatorBuilder: (context, index) => SizedBox(height: 14),

@ -0,0 +1,74 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.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<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital;
bool isLiveCareAppointment;
SearchResults({@required this.doctorsList, this.patientDoctorAppointmentListHospital, @required this.isLiveCareAppointment});
@override
_SearchResultsState createState() => _SearchResultsState();
}
class _SearchResultsState extends State<SearchResults> {
// var event = RobotProvider();
List<DoctorList> tempList = [];
ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo,
isShowDecPage: false,
isShowAppBar: true,
showNewAppBarTitle: true,
showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: ListView.separated(
physics: BouncingScrollPhysics(),
separatorBuilder: (context, index) {
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,
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: doctor,
isLiveCareAppointment: widget.isLiveCareAppointment,
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),
);
},
itemCount: widget.patientDoctorAppointmentListHospital.length,
),
);
}
}

@ -0,0 +1,66 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.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';
class SearchResults extends StatefulWidget {
List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital;
bool isLiveCareAppointment;
SearchResults({@required this.doctorsList, this.patientDoctorAppointmentListHospital, @required this.isLiveCareAppointment});
@override
_SearchResultsState createState() => _SearchResultsState();
}
class _SearchResultsState extends State<SearchResults> {
// var event = RobotProvider();
List<DoctorList> tempList = [];
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo,
isShowDecPage: false,
isShowAppBar: true,
showNewAppBarTitle: true,
showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: ListView.separated(
physics: BouncingScrollPhysics(),
separatorBuilder: (context, index) {
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,
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;
return DoctorView(
doctor: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index],
isLiveCareAppointment: widget.isLiveCareAppointment,
);
},
separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.length),
);
},
itemCount: widget.patientDoctorAppointmentListHospital.length,
),
);
}
}

@ -0,0 +1,74 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.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<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital;
bool isLiveCareAppointment;
SearchResults({@required this.doctorsList, this.patientDoctorAppointmentListHospital, @required this.isLiveCareAppointment});
@override
_SearchResultsState createState() => _SearchResultsState();
}
class _SearchResultsState extends State<SearchResults> {
// var event = RobotProvider();
List<DoctorList> tempList = [];
ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo,
isShowDecPage: false,
isShowAppBar: true,
showNewAppBarTitle: true,
showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: ListView.separated(
physics: BouncingScrollPhysics(),
separatorBuilder: (context, index) {
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,
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: doctor,
isLiveCareAppointment: widget.isLiveCareAppointment,
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),
);
},
itemCount: widget.patientDoctorAppointmentListHospital.length,
),
);
}
}

@ -0,0 +1,66 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.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';
class SearchResults extends StatefulWidget {
List<DoctorList> doctorsList = [];
List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital;
bool isLiveCareAppointment;
SearchResults({@required this.doctorsList, this.patientDoctorAppointmentListHospital, @required this.isLiveCareAppointment});
@override
_SearchResultsState createState() => _SearchResultsState();
}
class _SearchResultsState extends State<SearchResults> {
// var event = RobotProvider();
List<DoctorList> tempList = [];
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).bookAppo,
isShowDecPage: false,
isShowAppBar: true,
showNewAppBarTitle: true,
showNewAppBar: true,
backgroundColor: CustomColors.appBackgroudGrey2Color,
body: ListView.separated(
physics: BouncingScrollPhysics(),
separatorBuilder: (context, index) {
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,
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;
return DoctorView(
doctor: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index],
isLiveCareAppointment: widget.isLiveCareAppointment ?? widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList[_index].isLiveCare,
);
},
separatorBuilder: (context, index) => SizedBox(height: 14),
itemCount: widget.patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.length),
);
},
itemCount: widget.patientDoctorAppointmentListHospital.length,
),
);
}
}

@ -1,4 +1,5 @@
import 'package:auto_size_text/auto_size_text.dart'; 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/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/models/header_model.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/material.dart';
import 'package:flutter_inappwebview/flutter_inappwebview.dart'; import 'package:flutter_inappwebview/flutter_inappwebview.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'BookSuccess.dart'; import 'BookSuccess.dart';
@ -52,8 +54,10 @@ class _BookReminderPageState extends State<BookReminderPage> {
}); });
} }
ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of<ProjectViewModel>(context);
// print("selectedTime "+selectedTime??""); // print("selectedTime "+selectedTime??"");
print("appointmentNo1 " + widget.patientShareResponse.appointmentNo.toString() ?? ""); print("appointmentNo1 " + widget.patientShareResponse.appointmentNo.toString() ?? "");
return AppScaffold( return AppScaffold(
@ -173,6 +177,7 @@ class _BookReminderPageState extends State<BookReminderPage> {
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: new Color(0xFFEAEAEA), disabledColor: new Color(0xFFEAEAEA),
onPressed: () { onPressed: () {
projectViewModel.analytics.appointment.appointment_reminder(false);
navigateToBookSuccess(context); navigateToBookSuccess(context);
}, },
child: Text(TranslationBase.of(context).no, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48)), child: Text(TranslationBase.of(context).no, style: TextStyle(fontSize: 16.0, letterSpacing: -0.48)),
@ -194,6 +199,7 @@ class _BookReminderPageState extends State<BookReminderPage> {
disabledTextColor: Colors.white, disabledTextColor: Colors.white,
disabledColor: CustomColors.green, disabledColor: CustomColors.green,
onPressed: () async { onPressed: () async {
projectViewModel.analytics.appointment.appointment_reminder(true);
print(widget.patientShareResponse.appointmentNo); print(widget.patientShareResponse.appointmentNo);
showReminderDialog( showReminderDialog(
context, context,

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; 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/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart'; import 'package:diplomaticquarterapp/models/Appointments/FreeSlot.dart';
import 'package:diplomaticquarterapp/models/Appointments/timeSlot.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/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:intl/intl.dart'; import 'package:intl/intl.dart';
import 'package:provider/provider.dart';
import 'package:syncfusion_flutter_calendar/calendar.dart'; import 'package:syncfusion_flutter_calendar/calendar.dart';
import '../../../uitl/date_uitl.dart'; import '../../../uitl/date_uitl.dart';
@ -112,8 +114,11 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
}); });
} }
ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return SingleChildScrollView( return SingleChildScrollView(
child: Container( child: Container(
child: Column( child: Column(
@ -248,6 +253,10 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments> wit
elevation: 0, elevation: 0,
textColor: new Color(0xFF60686b), textColor: new Color(0xFF60686b),
onPressed: () { 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(() { setState(() {
selectedButtonIndex = index; selectedButtonIndex = index;
DocAvailableAppointments.selectedTime = dayEvents[index].isoTime; DocAvailableAppointments.selectedTime = dayEvents[index].isoTime;

@ -228,6 +228,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
: InkWell( : InkWell(
onTap: () { onTap: () {
showClickListDialog(context, clinicsList, onSelection: (ListClinicCentralized clincs) { showClickListDialog(context, clinicsList, onSelection: (ListClinicCentralized clincs) {
projectViewModel.analytics.appointment.book_appointment_select_clinic(appointment_type: 'regular', clinic: clincs.clinicDescription);
Navigator.pop(context); Navigator.pop(context);
setState(() { setState(() {
dropdownTitle = clincs.clinicDescription; dropdownTitle = clincs.clinicDescription;
@ -503,6 +504,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
} else { } else {
isProjectLoaded = false; isProjectLoaded = false;
} }
}).catchError((err) {
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}); });

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/theme/colors.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/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../SearchResults.dart'; import '../SearchResults.dart';
@ -17,6 +19,7 @@ class SearchByDoctor extends StatefulWidget {
class _SearchByDoctorState extends State<SearchByDoctor> { class _SearchByDoctorState extends State<SearchByDoctor> {
TextEditingController doctorNameController = new TextEditingController(); TextEditingController doctorNameController = new TextEditingController();
bool _isButtonDisabled; bool _isButtonDisabled;
ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
@ -26,6 +29,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return Column( return Column(
children: [ children: [
Expanded( Expanded(
@ -143,6 +147,7 @@ class _SearchByDoctorState extends State<SearchByDoctor> {
} }
_searchDoctor(BuildContext context) { _searchDoctor(BuildContext context) {
projectViewModel.analytics.appointment.book_appointment_doctor_search(query: doctorNameController.text);
getDoctorsList(context); getDoctorsList(context);
} }

@ -29,9 +29,9 @@ class DoctorView extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
return InkWell( return InkWell(
onTap: onTap ?? onTap: () {
() {
if (isShowFlag) getDoctorsProfile(context, doctor, isAppo: true); if (isShowFlag) getDoctorsProfile(context, doctor, isAppo: true);
(onTap ?? (){})(); // For log analytics of doctor click from book appointment
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(

@ -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/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart'; import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -41,23 +43,30 @@ Future<void> _showReminderDialog(BuildContext context, DateTime dateTime, String
insetPadding: EdgeInsets.all(21), insetPadding: EdgeInsets.all(21),
child: ReminderDialog( child: ReminderDialog(
onClick: (int i) async { onClick: (int i) async {
String text = "";
if (i == 0) { if (i == 0) {
// Before 30 mints // Before 30 mints
dateTime = Jiffy(dateTime).subtract(minutes: 30).dateTime; dateTime = Jiffy(dateTime).subtract(minutes: 30).dateTime;
text = "30 minutes";
// dateTime.add(new Duration(minutes: -30)); // dateTime.add(new Duration(minutes: -30));
} else if (i == 1) { } else if (i == 1) {
// Before 1 hour // Before 1 hour
// dateTime.add(new Duration(minutes: -60)); // dateTime.add(new Duration(minutes: -60));
dateTime = Jiffy(dateTime).subtract(hours: 1).dateTime; dateTime = Jiffy(dateTime).subtract(hours: 1).dateTime;
text = "1 hours";
} else if (i == 2) { } else if (i == 2) {
// Before 1 hour and 30 mints // Before 1 hour and 30 mints
// dateTime.add(new Duration(minutes: -90)); // dateTime.add(new Duration(minutes: -90));
dateTime = Jiffy(dateTime).subtract(hours: 1, minutes: 30).dateTime; dateTime = Jiffy(dateTime).subtract(hours: 1, minutes: 30).dateTime;
text = "1 hours 30 minutes";
} else if (i == 3) { } else if (i == 3) {
// Before 2 hours // Before 2 hours
// dateTime.add(new Duration(minutes: -120)); // dateTime.add(new Duration(minutes: -120));
dateTime = Jiffy(dateTime).subtract(hours: 2).dateTime; dateTime = Jiffy(dateTime).subtract(hours: 2).dateTime;
text = "2 hours";
} }
locator<GAnalytics>().appointment.appointment_reminder_time(reminde_before: text);
if (onMultiDateSuccess == null) { if (onMultiDateSuccess == null) {
CalendarUtils calendarUtils = await CalendarUtils.getInstance(); CalendarUtils calendarUtils = await CalendarUtils.getInstance();
calendarUtils calendarUtils

@ -551,6 +551,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
service.confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID, widget.appo.projectID, widget.appo.isLiveCareAppointment, context).then((res) { service.confirmAppointment(widget.appo.appointmentNo, widget.appo.clinicID, widget.appo.projectID, widget.appo.isLiveCareAppointment, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
projectViewModel.analytics.appointment.appointment_details_confirm(appointment: widget.appo);
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
Navigator.of(context).pop(); Navigator.of(context).pop();
} else { } else {
@ -567,6 +568,8 @@ class _AppointmentDetailsState extends State<AppointmentDetails> with SingleTick
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.cancelAppointment(widget.appo, context).then((res) { service.cancelAppointment(widget.appo, context).then((res) {
projectViewModel.analytics.appointment.appointment_details_cancel(appointment: widget.appo);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
getToDoCount(); getToDoCount();

@ -97,6 +97,8 @@ class _SchedulePageState extends State<SchedulePage> {
itemCount: weeks[index].length, itemCount: weeks[index].length,
itemBuilder: (context, index2) => InkWell( itemBuilder: (context, index2) => InkWell(
onTap: () { 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]); openBookAppointment(weeks[index][index2]);
}, },
child: Row( child: Row(

@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart';
import 'package:diplomaticquarterapp/pages/feedback/appointment_history.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart'; import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
@ -484,6 +485,7 @@ class _ToDoState extends State<ToDo> {
} }
Future navigateToAppointmentDetails(context, AppoitmentAllHistoryResultList appo) async { Future navigateToAppointmentDetails(context, AppoitmentAllHistoryResultList appo) async {
projectViewModel.analytics.todoList.to_do_list_more_details(appo);
Navigator.push(context, FadePage(page: AppointmentDetails(appo: appo, parentIndex: appo.patientStatusType == 42 ? 1 : 0))).then((value) { Navigator.push(context, FadePage(page: AppointmentDetails(appo: appo, parentIndex: appo.patientStatusType == 42 ? 1 : 0))).then((value) {
getPatientAppointmentHistory(); getPatientAppointmentHistory();
}); });
@ -563,26 +565,29 @@ class _ToDoState extends State<ToDo> {
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.generateAppointmentQR(patientShareResponse, context).then((res) { service.generateAppointmentQR(patientShareResponse, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
navigateToQR(context, res['AppointmentQR'], patientShareResponse); projectViewModel.analytics.todoList.to_do_list_check_in(appo);
navigateToQR(context, res['AppointmentQR'], patientShareResponse, appo);
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);
}); });
} }
Future navigateToQR(context, String appoQR, PatientShareResponse patientShareResponse) async { Future navigateToQR(context, String appoQR, PatientShareResponse patientShareResponse, AppoitmentAllHistoryResultList appintment) async {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: QRCode( page: QRCode(
patientShareResponse: patientShareResponse, patientShareResponse: patientShareResponse,
appoQR: appoQR, appoQR: appoQR,
appointment: appintment
))).then((value) { ))).then((value) {
getPatientAppointmentHistory(); getPatientAppointmentHistory();
}); });
} }
openPaymentDialog(AppoitmentAllHistoryResultList appo, PatientShareResponse patientShareResponse) { openPaymentDialog(AppoitmentAllHistoryResultList appo, PatientShareResponse patientShareResponse) {
projectViewModel.analytics.todoList.to_do_list_pay_now(appo);
showGeneralDialog( showGeneralDialog(
barrierColor: Colors.black.withOpacity(0.5), barrierColor: Colors.black.withOpacity(0.5),
transitionBuilder: (context, a1, a2, widget) { transitionBuilder: (context, a1, a2, widget) {
@ -603,7 +608,10 @@ class _ToDoState extends State<ToDo> {
.then((value) { .then((value) {
if (value != null) { if (value != null) {
projectViewModel.analytics.todoList.to_do_list_confirm_payment_details(appo);
navigateToPaymentMethod(context, value, appo); navigateToPaymentMethod(context, value, appo);
}else{
projectViewModel.analytics.todoList.to_do_list_cancel_payment_details(appo);
} }
}); });
} }
@ -729,11 +737,13 @@ class _ToDoState extends State<ToDo> {
} }
confirmAppointment(AppoitmentAllHistoryResultList appo) { confirmAppointment(AppoitmentAllHistoryResultList appo) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService(); DoctorsListService service = new DoctorsListService();
service.confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID, appo.isLiveCareAppointment, context).then((res) { service.confirmAppointment(appo.appointmentNo, appo.clinicID, appo.projectID, appo.isLiveCareAppointment, context).then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
projectViewModel.analytics.todoList.to_do_list_confirm_appointment(appo);
AppToast.showSuccessToast(message: res['ErrorEndUserMessage']); AppToast.showSuccessToast(message: res['ErrorEndUserMessage']);
if (appo.isLiveCareAppointment) { if (appo.isLiveCareAppointment) {
insertLiveCareVIDARequest(appo); insertLiveCareVIDARequest(appo);

@ -1,3 +1,5 @@
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/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart'; import 'package:diplomaticquarterapp/models/Appointments/PatientShareResposne.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';

@ -102,6 +102,7 @@ class _HomePageFragment2State extends State<HomePageFragment2> {
child: SliderView( child: SliderView(
onLoginClick: () { onLoginClick: () {
widget.onLoginClick(); widget.onLoginClick();
projectViewModel.analytics.loginRegistration.login_register_initiate();
// navigateTo(context, CallHomePage()); // navigateTo(context, CallHomePage());
}, },
), ),

@ -135,6 +135,8 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/1.png', imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/1.png',
imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/1.png'), imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/1.png'),
); );
projectViewModel.analytics.bottomTabNavigation.logNavName('my family');
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
@ -154,6 +156,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
imagesInfo.add( imagesInfo.add(
ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/ar/0.png')); ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/ar/0.png'));
projectViewModel.analytics.bottomTabNavigation.logNavName('todo list');
Navigator.push( Navigator.push(
context, context,
MaterialPageRoute( MaterialPageRoute(
@ -174,6 +177,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
if (tab == 5) { if (tab == 5) {
IS_VOICE_COMMAND_CLOSED = false; IS_VOICE_COMMAND_CLOSED = false;
triggerRobot(); triggerRobot();
projectViewModel.analytics.bottomTabNavigation.logNavName('help robot');
// pageController.jumpToPage(tab); // pageController.jumpToPage(tab);
} else { } else {
@ -234,10 +238,10 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
}); });
// HMG (Guest/Internet) Wifi Access [Zohaib Kambrani] // HMG (Guest/Internet) Wifi Access [Zohaib Kambrani]
//for now commented to reduce this call will enable it when needed //for now commented to reduce this call will enable it when needed
HMGNetworkConnectivity(context, () { // HMGNetworkConnectivity(context, () {
GifLoaderDialogUtils.showMyDialog(context); // GifLoaderDialogUtils.showMyDialog(context);
PlatformBridge.shared().connectHMGGuestWifi().then((value) => {GifLoaderDialogUtils.hideDialog(context)}); // PlatformBridge.shared().connectHMGGuestWifi().then((value) => {GifLoaderDialogUtils.hideDialog(context)});
}).checkAndConnectIfNoInternet(); // }).checkAndConnectIfNoInternet();
requestPermissions().then((results) { requestPermissions().then((results) {
locationUtils.getCurrentLocation(); locationUtils.getCurrentLocation();
@ -463,6 +467,9 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
PageView( PageView(
physics: NeverScrollableScrollPhysics(), physics: NeverScrollableScrollPhysics(),
controller: pageController, controller: pageController,
onPageChanged: (idx){
projectViewModel.analytics.bottomTabNavigation.logNavName('');
},
children: [ children: [
HomePage2( HomePage2(
goToMyProfile: () { goToMyProfile: () {
@ -472,6 +479,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
login(); login();
}, },
onMedicalFileClick: () { onMedicalFileClick: () {
projectViewModel.analytics.bottomTabNavigation.logNavName('medical file');
changeCurrentTab(1); changeCurrentTab(1);
}, },
), ),
@ -510,6 +518,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
? FloatingButton( ? FloatingButton(
elevation: true, elevation: true,
onTap: () { onTap: () {
projectViewModel.analytics.appointment.book_appointment();
changeCurrentTab(2); changeCurrentTab(2);
}, },
) )

@ -1,4 +1,5 @@
import 'package:auto_size_text/auto_size_text.dart'; import 'package:auto_size_text/auto_size_text.dart';
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
@ -52,26 +53,36 @@ class ServicesView extends StatelessWidget {
return InkWell( return InkWell(
onTap: () { onTap: () {
if (index == 0) { if (index == 0) {
locator<GAnalytics>().hmgServices.logServiceName('live care service');
Navigator.push(context, FadePage(page: LiveCareHome())).then((value) { Navigator.push(context, FadePage(page: LiveCareHome())).then((value) {
LiveCareHome.isLiveCareTypeSelected = false; LiveCareHome.isLiveCareTypeSelected = false;
}); });
} else if (index == 1) { } else if (index == 1) {
locator<GAnalytics>().hmgServices.logServiceName('covid-test drive-thru');
Navigator.push(context, FadePage(page: CovidDrivethruLocation())); Navigator.push(context, FadePage(page: CovidDrivethruLocation()));
} else if (index == 2) { } else if (index == 2) {
locator<GAnalytics>().hmgServices.logServiceName('online payments');
Navigator.push(context, FadePage(page: PaymentService())); Navigator.push(context, FadePage(page: PaymentService()));
} else if (index == 3) { } else if (index == 3) {
locator<GAnalytics>().hmgServices.logServiceName('home health care');
Navigator.push(context, FadePage(page: HomeHealthCarePage())); Navigator.push(context, FadePage(page: HomeHealthCarePage()));
} else if (index == 4) { } else if (index == 4) {
locator<GAnalytics>().hmgServices.logServiceName('comprehensive medical checkup');
Navigator.push(context, FadePage(page: CMCPage())); Navigator.push(context, FadePage(page: CMCPage()));
} else if (index == 5) { } else if (index == 5) {
locator<GAnalytics>().hmgServices.logServiceName('emergency service');
Navigator.push(context, FadePage(page: ErOptions(isAppbar: true))); Navigator.push(context, FadePage(page: ErOptions(isAppbar: true)));
} else if (index == 6) { } else if (index == 6) {
locator<GAnalytics>().hmgServices.logServiceName('e-referral service');
Navigator.push(context, FadePage(page: EReferralPage())); Navigator.push(context, FadePage(page: EReferralPage()));
} else if (index == 7) { } else if (index == 7) {
locator<GAnalytics>().hmgServices.logServiceName('water consumption');
Navigator.push(context, FadePage(page: H2OPage())); Navigator.push(context, FadePage(page: H2OPage()));
} else if (index == 8) { } else if (index == 8) {
locator<GAnalytics>().hmgServices.logServiceName('find us reach us');
Navigator.push(context, FadePage(page: ContactUsPage())); Navigator.push(context, FadePage(page: ContactUsPage()));
} else if (index == 9) { } else if (index == 9) {
locator<GAnalytics>().hmgServices.logServiceName('my medical details');
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -79,6 +90,7 @@ class ServicesView extends StatelessWidget {
), ),
); );
} else if (index == 10) { } else if (index == 10) {
locator<GAnalytics>().hmgServices.logServiceName('book appointment');
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -86,8 +98,10 @@ class ServicesView extends StatelessWidget {
), ),
); );
} else if (index == 11) { } else if (index == 11) {
locator<GAnalytics>().hmgServices.logServiceName('al habib pharmacy');
getPharmacyToken(context); getPharmacyToken(context);
} else if (index == 12) { } else if (index == 12) {
locator<GAnalytics>().hmgServices.logServiceName('update insurance');
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -95,6 +109,7 @@ class ServicesView extends StatelessWidget {
), ),
); );
} else if (index == 13) { } else if (index == 13) {
locator<GAnalytics>().hmgServices.logServiceName('my family files');
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -102,19 +117,23 @@ class ServicesView extends StatelessWidget {
), ),
); );
} else if (index == 14) { } else if (index == 14) {
locator<GAnalytics>().hmgServices.logServiceName('my child vaccines');
Navigator.push( Navigator.push(
context, context,
FadePage(page: ChildInitialPage()), FadePage(page: ChildInitialPage()),
); );
} else if (index == 15) { } else if (index == 15) {
// Navigator.pop(context); // Navigator.pop(context);
locator<GAnalytics>().hmgServices.logServiceName('todo list');
LandingPage.shared.switchToDoFromHMGServices(); LandingPage.shared.switchToDoFromHMGServices();
} else if (index == 16) { } else if (index == 16) {
locator<GAnalytics>().hmgServices.logServiceName('blood donation');
Navigator.push( Navigator.push(
context, context,
FadePage(page: BloodDonationPage()), FadePage(page: BloodDonationPage()),
); );
} else if (index == 17) { } else if (index == 17) {
locator<GAnalytics>().hmgServices.logServiceName('health calculator');
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -122,6 +141,7 @@ class ServicesView extends StatelessWidget {
), ),
); );
} else if (index == 18) { } else if (index == 18) {
locator<GAnalytics>().hmgServices.logServiceName('heath converters');
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -129,11 +149,13 @@ class ServicesView extends StatelessWidget {
), ),
); );
} else if (index == 19) { } else if (index == 19) {
locator<GAnalytics>().hmgServices.logServiceName('smart watches');
Navigator.push( Navigator.push(
context, context,
FadePage(page: SmartWatchInstructions()), FadePage(page: SmartWatchInstructions()),
); );
} else if (index == 20) { } else if (index == 20) {
locator<GAnalytics>().hmgServices.logServiceName('car parcking service');
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
@ -141,8 +163,10 @@ class ServicesView extends StatelessWidget {
), ),
); );
} else if (index == 21) { } else if (index == 21) {
locator<GAnalytics>().hmgServices.logServiceName('virtual tour');
launch("https://hmgwebservices.com/vt_mobile/html/index.html"); launch("https://hmgwebservices.com/vt_mobile/html/index.html");
} else if (index == 22) { } else if (index == 22) {
locator<GAnalytics>().hmgServices.logServiceName('latest news');
Navigator.of(context).push(MaterialPageRoute( Navigator.of(context).push(MaterialPageRoute(
builder: (BuildContext context) => MyWebView( builder: (BuildContext context) => MyWebView(
title: "HMG News", title: "HMG News",

@ -279,6 +279,7 @@ class _LiveCarePatmentPageState extends State<LiveCarePatmentPage> {
if (_selected == 0) { if (_selected == 0) {
AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms); AppToast.showErrorToast(message: TranslationBase.of(context).pleaseAcceptTerms);
} else { } else {
projectViewModel.analytics.liveCare.livecare_immediate_consultation_TnC(clinic: widget.clinicName);
Navigator.pop(context, true); Navigator.pop(context, true);
} }
}, },

@ -1,10 +1,12 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart'; import 'package:flutter_svg/flutter_svg.dart';
import 'package:provider/provider.dart';
class LiveCareTypeSelect extends StatefulWidget { class LiveCareTypeSelect extends StatefulWidget {
@override @override
@ -15,6 +17,8 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
var languageID; var languageID;
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
getLanguageID(); getLanguageID();
@ -23,6 +27,7 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of<ProjectViewModel>(context);
return AppScaffold( return AppScaffold(
isShowDecPage: true, isShowDecPage: true,
isShowAppBar: true, isShowAppBar: true,
@ -109,8 +114,10 @@ class _LiveCareTypeSelectState extends State<LiveCareTypeSelect> {
return InkWell( return InkWell(
onTap: () { onTap: () {
if (_loginIndex == 1) { if (_loginIndex == 1) {
projectViewModel.analytics.liveCare.livecare_immediate_consultation();
Navigator.pop(context, "immediate"); Navigator.pop(context, "immediate");
} else { } else {
projectViewModel.analytics.liveCare.livecare_schedule_video_call();
Navigator.pop(context, "schedule"); Navigator.pop(context, "schedule");
} }
}, },

@ -1,4 +1,6 @@
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/LiveCare/ClinicsServiceTimingsResponse.dart'; import 'package:diplomaticquarterapp/models/LiveCare/ClinicsServiceTimingsResponse.dart';
import 'package:diplomaticquarterapp/models/LiveCare/LiveCareClinicsListResponse.dart'; import 'package:diplomaticquarterapp/models/LiveCare/LiveCareClinicsListResponse.dart';
import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart'; import 'package:diplomaticquarterapp/services/livecare_services/livecare_provider.dart';
@ -21,7 +23,9 @@ class ClinicCard extends StatefulWidget {
var languageID; var languageID;
int isOnline; int isOnline;
ClinicCard({this.isSelected, this.languageID, this.isOnline, @required this.patientERGetClinicsList}); ClinicCard({this.isSelected, this.languageID, this.isOnline, @required this.patientERGetClinicsList}){
}
@override @override
_State createState() => _State(); _State createState() => _State();
@ -126,7 +130,7 @@ class _State extends State<ClinicCard> {
), ),
), ),
InkWell( InkWell(
onTap: (){ getClinicTimings(widget.patientERGetClinicsList);}, onTap: () => getClinicTimings(widget.patientERGetClinicsList),
child: Container( child: Container(
padding: EdgeInsets.only(left: 8,right: 8,top: 4,bottom: 4), padding: EdgeInsets.only(left: 8,right: 8,top: 4,bottom: 4),
decoration: containerRadius(CustomColors.devider, 100), decoration: containerRadius(CustomColors.devider, 100),
@ -159,6 +163,9 @@ class _State extends State<ClinicCard> {
} }
getClinicTimings(PatientERGetClinicsList patientERGetClinicsList) { getClinicTimings(PatientERGetClinicsList patientERGetClinicsList) {
locator<GAnalytics>().liveCare.livecare_clinic_schedule(clinic: patientERGetClinicsList.serviceName);
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getLivecareClinicTiming(patientERGetClinicsList.serviceID, context).then((res) { service.getLivecareClinicTiming(patientERGetClinicsList.serviceID, context).then((res) {

@ -1,6 +1,7 @@
import 'dart:io'; import 'dart:io';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; 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/AppoimentAllHistoryResultList.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
@ -32,6 +33,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import '../live_care_payment_page.dart'; import '../live_care_payment_page.dart';
@ -69,6 +71,8 @@ class _clinic_listState extends State<ClinicList> {
String liveCareClinicIDs; String liveCareClinicIDs;
ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
liveCareClinicsListResponse = new LiveCareClinicsListResponse(); liveCareClinicsListResponse = new LiveCareClinicsListResponse();
@ -95,12 +99,15 @@ class _clinic_listState extends State<ClinicList> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return Container( return Container(
child: currentSelectedLiveCareType == "immediate" ? getLiveCareImmediateClinicList() : getLiveCareScheduleClinicList(), child: currentSelectedLiveCareType == "immediate" ? getLiveCareImmediateClinicList() : getLiveCareScheduleClinicList(),
); );
} }
void startLiveCare() { void startLiveCare() {
projectViewModel.analytics.liveCare.livecare_immediate_consultation_clinic(clinic: selectedClinicName);
bool isError = false; bool isError = false;
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
@ -277,6 +284,7 @@ class _clinic_listState extends State<ClinicList> {
}))).then((value) { }))).then((value) {
print(value); print(value);
if (value != null) { if (value != null) {
projectViewModel.analytics.liveCare.payment_method(appointment_type: 'livecare', clinic: selectedClinicName, payment_method: value, payment_type: 'appointment');
openPayment(value, authUser, double.parse(getERAppointmentFeesList.total), appo); openPayment(value, authUser, double.parse(getERAppointmentFeesList.total), appo);
} }
}); });
@ -588,6 +596,8 @@ class _clinic_listState extends State<ClinicList> {
} }
void startScheduleLiveCare() { void startScheduleLiveCare() {
projectViewModel.analytics.liveCare.livecare_schedule_video_call_clinic(clinic: selectedClinicName);
List<DoctorList> doctorsList = []; List<DoctorList> doctorsList = [];
LiveCareService service = new LiveCareService(); LiveCareService service = new LiveCareService();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);

@ -1,3 +1,7 @@
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
@ -276,13 +280,25 @@ class _RegisterInfo extends State<RegisterInfo> {
children: [ children: [
Expanded( Expanded(
child: Padding( child: Padding(
padding: EdgeInsets.all(10), child: DefaultButton(TranslationBase.of(context).cancel, () => {Navigator.of(context).pop()}, textColor: Colors.white, color: Color(0xffD02127))), padding: EdgeInsets.all(10), child: DefaultButton(TranslationBase.of(context).cancel, () {
Navigator.of(context).pop();
locator<GAnalytics>().loginRegistration.registration_cancel(step: page == 1 ? 'personal info' : 'patient info');
}, textColor: Colors.white, color: Color(0xffD02127))),
), ),
Expanded( Expanded(
child: Padding( child: Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: DefaultButton(page == 1 ? TranslationBase.of(context).next : TranslationBase.of(context).register, () => {nextPage()}, child: DefaultButton(
textColor: Colors.white, color: isValid() == true && page == 2 || page == 1 ? Color(0xff359846) : Colors.grey)), page == 1 ? TranslationBase.of(context).next : TranslationBase.of(context).register,
(){
nextPage();
page == 1
? locator<GAnalytics>().loginRegistration.registration_personal_info()
: locator<GAnalytics>().loginRegistration.registration_patient_info();
},
textColor: Colors.white, color: isValid() == true && page == 2 || page == 1 ? Color(0xff359846) : Colors.grey)
),
), ),
], ],
))); )));

@ -1,5 +1,7 @@
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_user_status_reponse.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_user_status_reponse.dart';
import 'package:diplomaticquarterapp/models/Authentication/check_user_status_req.dart'; import 'package:diplomaticquarterapp/models/Authentication/check_user_status_req.dart';
import 'package:diplomaticquarterapp/models/Authentication/checkpatient_for_registration.dart'; import 'package:diplomaticquarterapp/models/Authentication/checkpatient_for_registration.dart';
@ -159,12 +161,18 @@ class _Register extends State<Register> {
children: [ children: [
Expanded( Expanded(
child: Padding( child: Padding(
padding: EdgeInsets.all(10), child: DefaultButton(TranslationBase.of(context).cancel, () => {Navigator.of(context).pop()}, textColor: Colors.white, color: Color(0xffD02127))), padding: EdgeInsets.all(10), child: DefaultButton(TranslationBase.of(context).cancel, () {
Navigator.of(context).pop();
locator<GAnalytics>().loginRegistration.registration_cancel(step: 'enter details');
}, textColor: Colors.white, color: Color(0xffD02127))),
), ),
Expanded( Expanded(
child: Padding( child: Padding(
padding: EdgeInsets.all(10), padding: EdgeInsets.all(10),
child: DefaultButton(TranslationBase.of(context).next, () => {startRegistration()}, textColor: Colors.white, color: isButtonDisabled == true ? Colors.grey : Color(0xff359846))), child: DefaultButton(TranslationBase.of(context).next, (){
startRegistration();
locator<GAnalytics>().loginRegistration.registration_enter_details();
}, textColor: Colors.white, color: isButtonDisabled == true ? Colors.grey : Color(0xff359846))),
), ),
], ],
))); )));

@ -1,3 +1,5 @@
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/login/login-type.dart'; import 'package:diplomaticquarterapp/pages/login/login-type.dart';
import 'package:diplomaticquarterapp/pages/login/register.dart'; import 'package:diplomaticquarterapp/pages/login/register.dart';
import 'package:diplomaticquarterapp/pages/login/register_new.dart'; import 'package:diplomaticquarterapp/pages/login/register_new.dart';
@ -79,6 +81,7 @@ class _WelcomeLogin extends State<WelcomeLogin> {
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).no, TranslationBase.of(context).no,
() => { () => {
locator<GAnalytics>().loginRegistration.visited_alhabib_group(false),
Navigator.of(context).push(FadePage(page: RegisterNew())), Navigator.of(context).push(FadePage(page: RegisterNew())),
}, },
color: CustomColors.accentColor, color: CustomColors.accentColor,
@ -90,6 +93,7 @@ class _WelcomeLogin extends State<WelcomeLogin> {
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).yes, TranslationBase.of(context).yes,
() => { () => {
locator<GAnalytics>().loginRegistration.visited_alhabib_group(true),
Navigator.of(context).push(FadePage(page: LoginType())), Navigator.of(context).push(FadePage(page: LoginType())),
}, },
color: CustomColors.green, color: CustomColors.green,

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart'; import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart'; import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
@ -20,6 +21,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import '../../../core/model/my_balance/AdvanceModel.dart'; import '../../../core/model/my_balance/AdvanceModel.dart';
import 'confirm_payment_page.dart'; import 'confirm_payment_page.dart';
@ -49,6 +51,8 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
List<ImagesInfo> imagesInfo = List(); List<ImagesInfo> imagesInfo = List();
ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
super.initState(); super.initState();
@ -60,6 +64,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
return BaseView<MyBalanceViewModel>( return BaseView<MyBalanceViewModel>(
onModelReady: (model) { onModelReady: (model) {
model.getHospitals(); model.getHospitals();
@ -309,6 +314,9 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
advanceModel.mobileNumber = mobileNum; advanceModel.mobileNumber = mobileNum;
advanceModel.patientName = patientName; advanceModel.patientName = patientName;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
projectViewModel.analytics.advancePayments.wallet_payment_details();
model.getPatientInfoByPatientIDAndMobileNumber(advanceModel).then((value) { model.getPatientInfoByPatientIDAndMobileNumber(advanceModel).then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (model.state != ViewState.Error && model.state != ViewState.ErrorLocal) { if (model.state != ViewState.Error && model.state != ViewState.ErrorLocal) {
@ -324,6 +332,8 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
), ),
).then( ).then(
(value) { (value) {
projectViewModel.analytics.advancePayments.payment_method(method: value.toString().toLowerCase(), type: 'wallet');
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/AdvanceModel.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_info_and_mobile_number.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
@ -23,9 +24,9 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart'; import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:pay/pay.dart'; import 'package:pay/pay.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'new_text_Field.dart'; import 'new_text_Field.dart';
class ConfirmPaymentPage extends StatefulWidget { class ConfirmPaymentPage extends StatefulWidget {
@ -63,6 +64,7 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
if (widget.selectedPaymentMethod == "ApplePay") { if (widget.selectedPaymentMethod == "ApplePay") {
startApplePay(); startApplePay();
} else { } else {
projectViewModel.analytics.advancePayments.payment_otp_confirmation(method: widget.selectedPaymentMethod.toLowerCase(), type: 'wallet');
openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, double.parse(widget.advanceModel.amount), null); openPayment(widget.selectedPaymentMethod, widget.authenticatedUser, double.parse(widget.advanceModel.amount), null);
} }
}); });
@ -85,6 +87,7 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
).displayDialog(context); ).displayDialog(context);
} }
projectViewModel = Provider.of(context);
return BaseView<MyBalanceViewModel>( return BaseView<MyBalanceViewModel>(
builder: (_, model, w) => AppScaffold( builder: (_, model, w) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
@ -194,8 +197,20 @@ class _ConfirmPaymentPageState extends State<ConfirmPaymentPage> {
child: DefaultButton( child: DefaultButton(
TranslationBase.of(context).confirm.toUpperCase(), TranslationBase.of(context).confirm.toUpperCase(),
() { () {
// if() projectViewModel.analytics.advancePayments.payment_confirm(method: widget.selectedPaymentMethod.toLowerCase(), type: 'wallet');
GifLoaderDialogUtils.showMyDialog(context);
model
.sendActivationCodeForAdvancePayment(
patientID: int.parse(widget.advanceModel.fileNumber),
projectID: widget.advanceModel.hospitalsModel.iD)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state != ViewState.ErrorLocal &&
model.state != ViewState.Error) showSMSDialog(model);
});
startApplePay(); startApplePay();
// if()
// GifLoaderDialogUtils.showMyDialog(context); // GifLoaderDialogUtils.showMyDialog(context);
// model.sendActivationCodeForAdvancePayment(patientID: int.parse(widget.advanceModel.fileNumber), projectID: widget.advanceModel.hospitalsModel.iD).then((value) { // model.sendActivationCodeForAdvancePayment(patientID: int.parse(widget.advanceModel.fileNumber), projectID: widget.advanceModel.hospitalsModel.iD).then((value) {
// GifLoaderDialogUtils.hideDialog(context); // GifLoaderDialogUtils.hideDialog(context);

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart'; import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_advance_balance_amount.dart'; import 'package:diplomaticquarterapp/core/model/my_balance/patient_advance_balance_amount.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/theme/colors.dart'; import 'package:diplomaticquarterapp/theme/colors.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -11,14 +12,19 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:flutter_svg/svg.dart'; import 'package:flutter_svg/svg.dart';
import 'package:provider/provider.dart';
import 'advance_payment_page.dart'; import 'advance_payment_page.dart';
class MyBalancePage extends StatelessWidget { class MyBalancePage extends StatelessWidget {
List<ImagesInfo> imagesInfo = List(); List<ImagesInfo> imagesInfo = List();
ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
imagesInfo.add(ImagesInfo( imagesInfo.add(ImagesInfo(
imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/ar/0.png')); imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/ar/0.png'));
return BaseView<MyBalanceViewModel>( return BaseView<MyBalanceViewModel>(
@ -172,6 +178,7 @@ class MyBalancePage extends StatelessWidget {
DefaultButton( DefaultButton(
TranslationBase.of(context).createAdvancedPayment, TranslationBase.of(context).createAdvancedPayment,
() { () {
projectViewModel.analytics.advancePayments.wallet_recharge(service_type: 'alhabib wallet');
Navigator.push(context, FadePage(page: AdvancePaymentPage())); Navigator.push(context, FadePage(page: AdvancePaymentPage()));
}, },
).insideContainer, ).insideContainer,

@ -59,6 +59,7 @@ class PaymentService extends StatelessWidget {
medical.add( medical.add(
InkWell( InkWell(
onTap: () { onTap: () {
projectViewModel.analytics.advancePayments.payment_services(service_type: 'payment service');
Navigator.push(context, FadePage(page: AdvancePaymentPage())); Navigator.push(context, FadePage(page: AdvancePaymentPage()));
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
@ -75,6 +76,7 @@ class PaymentService extends StatelessWidget {
medical.add( medical.add(
InkWell( InkWell(
onTap: () { onTap: () {
projectViewModel.analytics.advancePayments.payment_services(service_type: 'online check-in appointment');
navigateToToDoPage(context); navigateToToDoPage(context);
}, },
child: MedicalProfileItem( child: MedicalProfileItem(
@ -91,6 +93,7 @@ class PaymentService extends StatelessWidget {
medical.add( medical.add(
InkWell( InkWell(
onTap: () { onTap: () {
projectViewModel.analytics.advancePayments.payment_services(service_type: 'alhabib wallet');
Navigator.push(context, FadePage(page: MyBalancePage())); Navigator.push(context, FadePage(page: MyBalancePage()));
}, },
child: MedicalProfileItem( child: MedicalProfileItem(

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
@ -165,8 +166,10 @@ class _AppDrawerState extends State<AppDrawer> {
sharedPref.remove(CLINICS_LIST); sharedPref.remove(CLINICS_LIST);
if (projectProvider.isArabic) { if (projectProvider.isArabic) {
projectProvider.changeLanguage('en'); projectProvider.changeLanguage('en');
locator<GAnalytics>().hamburgerMenu.logMenuItemClick('change language to english');
} else { } else {
projectProvider.changeLanguage('ar'); projectProvider.changeLanguage('ar');
locator<GAnalytics>().hamburgerMenu.logMenuItemClick('change language to arabic');
} }
var themeNotifier = Provider.of<ThemeNotifier>(context, listen: false); var themeNotifier = Provider.of<ThemeNotifier>(context, listen: false);
themeNotifier.setTheme(defaultTheme(fontName: projectProvider.isArabic ? 'Cairo' : 'Poppins')); themeNotifier.setTheme(defaultTheme(fontName: projectProvider.isArabic ? 'Cairo' : 'Poppins'));
@ -191,6 +194,8 @@ class _AppDrawerState extends State<AppDrawer> {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
MY_FAMILIY, MY_FAMILIY,
); );
locator<GAnalytics>().hamburgerMenu.logMenuItemClick('my family');
}, },
) )
: SizedBox(), : SizedBox(),
@ -317,8 +322,10 @@ class _AppDrawerState extends State<AppDrawer> {
sharedPref.setBool(IS_ROBOT_INIT, null); sharedPref.setBool(IS_ROBOT_INIT, null);
if (projectProvider.isArabic) { if (projectProvider.isArabic) {
projectProvider.changeLanguage('en'); projectProvider.changeLanguage('en');
locator<GAnalytics>().hamburgerMenu.logMenuItemClick('change language to english');
} else { } else {
projectProvider.changeLanguage('ar'); projectProvider.changeLanguage('ar');
locator<GAnalytics>().hamburgerMenu.logMenuItemClick('change language to arabic');
} }
}, },
), ),
@ -363,6 +370,7 @@ class _AppDrawerState extends State<AppDrawer> {
//NotificationsPage //NotificationsPage
// Navigator.of(context).pop(); // Navigator.of(context).pop();
if (!projectProvider.isLoginChild) Navigator.push(context, FadePage(page: NotificationsPage())); if (!projectProvider.isLoginChild) Navigator.push(context, FadePage(page: NotificationsPage()));
locator<GAnalytics>().hamburgerMenu.logMenuItemClick('notifications');
}, },
), ),
if (projectProvider.havePrivilege(3)) if (projectProvider.havePrivilege(3))
@ -373,11 +381,13 @@ class _AppDrawerState extends State<AppDrawer> {
Navigator.of(context).pushNamed( Navigator.of(context).pushNamed(
SETTINGS, SETTINGS,
); );
locator<GAnalytics>().hamburgerMenu.logMenuItemClick('app settings');
}, },
), ),
InkWell( InkWell(
child: DrawerItem(TranslationBase.of(context).rateApp, Icons.star, bottomLine: false, letterSpacing: -0.84, fontSize: 14, projectProvider: projectProvider), child: DrawerItem(TranslationBase.of(context).rateApp, Icons.star, bottomLine: false, letterSpacing: -0.84, fontSize: 14, projectProvider: projectProvider),
onTap: () { onTap: () {
locator<GAnalytics>().hamburgerMenu.logMenuItemClick('rate our app');
openAppReviewDialog(); openAppReviewDialog();
// if (Platform.isIOS) { // if (Platform.isIOS) {
// launch("https://apps.apple.com/sa/app/dr-suliaman-alhabib/id733503978"); // launch("https://apps.apple.com/sa/app/dr-suliaman-alhabib/id733503978");
@ -390,6 +400,7 @@ class _AppDrawerState extends State<AppDrawer> {
child: DrawerItem(TranslationBase.of(context).logout, SvgPicture.asset("assets/images/new/logout.svg"), child: DrawerItem(TranslationBase.of(context).logout, SvgPicture.asset("assets/images/new/logout.svg"),
isImageIcon: true, bottomLine: false, letterSpacing: -0.84, fontSize: 14, projectProvider: projectProvider), isImageIcon: true, bottomLine: false, letterSpacing: -0.84, fontSize: 14, projectProvider: projectProvider),
onTap: () { onTap: () {
locator<GAnalytics>().hamburgerMenu.logMenuItemClick('logout');
logout(); logout();
}, },
) )
@ -420,7 +431,17 @@ class _AppDrawerState extends State<AppDrawer> {
mHeight(12), mHeight(12),
InkWell( InkWell(
onTap: () { onTap: () {
Navigator.push(context, FadePage(page: CallPage())); // Navigator.push(context, FadePage(page: CallPage()));
locator<GAnalytics>().hamburgerMenu.logMenuItemClick('cloud solution logo tap');
String patientID = '2001273';
GifLoaderDialogUtils.showMyDialog(context);
projectProvider
.platformBridge()
.connectHMGInternetWifi(patientID)
.then((value) => {GifLoaderDialogUtils.hideDialog(context)})
.catchError((err) {
print(err.toString());
});
}, },
child: Row( child: Row(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -504,6 +525,8 @@ class _AppDrawerState extends State<AppDrawer> {
login() async { login() async {
var data = await sharedPref.getObject(IMEI_USER_DATA); var data = await sharedPref.getObject(IMEI_USER_DATA);
sharedPref.remove(REGISTER_DATA_FOR_LOGIIN); sharedPref.remove(REGISTER_DATA_FOR_LOGIIN);
locator<GAnalytics>().loginRegistration.login_register_initiate();
if (data != null) { if (data != null) {
Navigator.of(context).pushNamed(CONFIRM_LOGIN); Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else { } else {
@ -544,6 +567,7 @@ class _AppDrawerState extends State<AppDrawer> {
// GifLoaderDialogUtils.hideDialog(context); // GifLoaderDialogUtils.hideDialog(context);
// Navigator.of(context).pop(); // Navigator.of(context).pop();
loginAfter(value, context, user is AuthenticatedUser); loginAfter(value, context, user is AuthenticatedUser);
locator<GAnalytics>().hamburgerMenu.logMenuItemClick('switch to my family account');
}).catchError((err) { }).catchError((err) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
print(err); print(err);

@ -1,7 +1,7 @@
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_nfc_kit/flutter_nfc_kit.dart'; import 'package:flutter_nfc_kit/flutter_nfc_kit.dart';
void showNfcReader(BuildContext context, {Function onNcfScan}) { void showNfcReader(BuildContext context, {Function onNcfScan, VoidCallback onCancel}) {
showModalBottomSheet( showModalBottomSheet(
context: context, context: context,
enableDrag: false, enableDrag: false,
@ -13,14 +13,16 @@ void showNfcReader(BuildContext context, {Function onNcfScan}) {
builder: (context) { builder: (context) {
return NfcLayout( return NfcLayout(
onNcfScan: onNcfScan, onNcfScan: onNcfScan,
onCancel: onCancel,
); );
}); });
} }
class NfcLayout extends StatefulWidget { class NfcLayout extends StatefulWidget {
Function onNcfScan; Function onNcfScan;
VoidCallback onCancel;
NfcLayout({this.onNcfScan}); NfcLayout({this.onNcfScan, this.onCancel});
@override @override
_NfcLayoutState createState() => _NfcLayoutState(); _NfcLayoutState createState() => _NfcLayoutState();
@ -103,6 +105,7 @@ class _NfcLayoutState extends State<NfcLayout> {
child: RaisedButton( child: RaisedButton(
onPressed: () { onPressed: () {
// _stream?.cancel(); // _stream?.cancel();
widget.onCancel();
Navigator.pop(context); Navigator.pop(context);
}, },
elevation: 0, elevation: 0,

Loading…
Cancel
Save