diff --git a/android/app/build.gradle b/android/app/build.gradle
index 300075a5..1f71421f 100644
--- a/android/app/build.gradle
+++ b/android/app/build.gradle
@@ -44,6 +44,8 @@ android {
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
+ multiDexEnabled true
+
}
buildTypes {
@@ -62,4 +64,7 @@ flutter {
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation "com.google.firebase:firebase-messaging:20.1.0"
+ implementation 'pub.devrel:easypermissions:0.4.0'
+
+
}
diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml
index 555b2fe8..30575eb9 100644
--- a/android/app/src/main/AndroidManifest.xml
+++ b/android/app/src/main/AndroidManifest.xml
@@ -11,6 +11,7 @@
+
diff --git a/android/build.gradle b/android/build.gradle
index 70b3637d..e2e8a05f 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -6,7 +6,7 @@ buildscript {
}
dependencies {
- classpath 'com.android.tools.build:gradle:3.5.0'
+ classpath 'com.android.tools.build:gradle:3.4.2'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.2'
}
diff --git a/android/gradle.properties b/android/gradle.properties
index 38c8d454..3f45ee5b 100644
--- a/android/gradle.properties
+++ b/android/gradle.properties
@@ -1,4 +1,5 @@
-org.gradle.jvmargs=-Xmx1536M
+
android.enableR8=true
android.useAndroidX=true
android.enableJetifier=true
+org.gradle.jvmargs=-Xmx4608m
\ No newline at end of file
diff --git a/assets/images/siri-ianzhao.gif b/assets/images/siri-ianzhao.gif
new file mode 100644
index 00000000..8d1c644f
Binary files /dev/null and b/assets/images/siri-ianzhao.gif differ
diff --git a/lib/config/config.dart b/lib/config/config.dart
index 55b44a34..e9ee7893 100644
--- a/lib/config/config.dart
+++ b/lib/config/config.dart
@@ -5,120 +5,139 @@ import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
const MAX_SMALL_SCREEN = 660;
-const BASE_URL = 'https://hmgwebservices.com/Services';
+const BASE_URL = 'https://hmgwebservices.com/';
const GET_PROJECT = '/Lists.svc/REST/GetProject';
///Doctor
-const GET_MY_DOCTOR = '/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
-const GET_DOCTOR_PROFILE = '/Doctors.svc/REST/GetDocProfiles';
-const GET_DOCTOR_RATING = '/Doctors.svc/REST/dr_GetAvgDoctorRating';
+const GET_MY_DOCTOR =
+ 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
+const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles';
+const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating';
///Prescriptions
-const PRESCRIPTIONS = '/Patients.svc/REST/GetPrescriptionApptList';
+const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_PRESCRIPTIONS_ALL_ORDERS =
- '/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
-const GET_PRESCRIPTION_REPORT = '/Patients.svc/REST/INP_GetPrescriptionReport';
-const SEND_PRESCRIPTION_EMAIL = '/Notifications.svc/REST/SendPrescriptionEmail';
+ 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
+const GET_PRESCRIPTION_REPORT =
+ 'Services/Patients.svc/REST/INP_GetPrescriptionReport';
+const SEND_PRESCRIPTION_EMAIL =
+ 'Services/Notifications.svc/REST/SendPrescriptionEmail';
const GET_PRESCRIPTION_REPORT_ENH =
- '/Patients.svc/REST/GetPrescriptionReport_enh';
+ 'Services/Patients.svc/REST/GetPrescriptionReport_enh';
///Lab Order
-const GET_Patient_LAB_ORDERS = '/Patients.svc/REST/GetPatientLabOrders';
+const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders';
const GET_Patient_LAB_SPECIAL_RESULT =
- '/Patients.svc/REST/GetPatientLabSpecialResults';
+ 'Services/Patients.svc/REST/GetPatientLabSpecialResults';
///
-const GET_PATIENT_ORDERS = '/Patients.svc/REST/GetPatientRadOrders';
+const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders';
const GET_PATIENT_ORDERS_DETAILS =
- '/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead';
-const GET_RAD_IMAGE_URL = '/Patients.svc/Rest/GetRadImageURL';
-const SEND_RAD_REPORT_EMAIL = '/Notifications.svc/REST/SendRadReportEmail';
+ 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead';
+const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL';
+const SEND_RAD_REPORT_EMAIL =
+ 'Services/Notifications.svc/REST/SendRadReportEmail';
///Feedback
-const SEND_FEEDBACK = '/COCWS.svc/REST/InsertCOCItemInSPList';
-const GET_STATUS_FOR_COCO = '/COCWS.svc/REST/GetStatusforCOC';
-const GET_PATIENT_AppointmentHistory = '/Doctors.svc/REST/PateintHasAppoimentHistory';
+const SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList';
+const GET_STATUS_FOR_COCO = 'Services/COCWS.svc/REST/GetStatusforCOC';
+const GET_PATIENT_AppointmentHistory =
+ 'Services/Doctors.svc/REST/PateintHasAppoimentHistory';
///VITAL SIGN
-const GET_PATIENT_VITAL_SIGN = '/Doctors.svc/REST/Doctor_GetPatientVitalSign';
-
-
+const GET_PATIENT_VITAL_SIGN =
+ 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign';
///Reports
-const REPORTS = '/Doctors.svc/REST/GetPatientMedicalReportStatusInfo';
-const INSERT_REQUEST_FOR_MEDICAL_REPORT = '/Doctors.svc/REST/InsertRequestForMedicalReport';
+const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo';
+const INSERT_REQUEST_FOR_MEDICAL_REPORT =
+ 'Services/Doctors.svc/REST/InsertRequestForMedicalReport';
///Rate
-const IS_LAST_APPOITMENT_RATED = '/Doctors.svc/REST/IsLastAppoitmentRated';
-const GET_APPOINTMENT_DETAILS_BY_NO = '/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo';
-
+const IS_LAST_APPOITMENT_RATED =
+ 'Services/Doctors.svc/REST/IsLastAppoitmentRated';
+const GET_APPOINTMENT_DETAILS_BY_NO =
+ 'Services/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo';
//const BASE_URL = 'https://hmgwebservices.com/'; // Production Environment
//const BASE_URL = 'https://hmgwebservices.com/Services'; // Production Environment
//const BASE_URL = 'https://uat.hmgwebservices.com/Services'; // UAT Environment
//URL to get clinic list
-const GET_CLINICS_LIST_URL = "/lists.svc/REST/GetClinicCentralized";
+const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized";
//URL to get doctors list
-const GET_DOCTORS_LIST_URL = "/Doctors.svc/REST/SearchDoctorsByTime";
+const GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime";
//URL to get doctor free slots
-const GET_DOCTOR_FREE_SLOTS = "/Doctors.svc/REST/GetDoctorFreeSlots";
+const GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots";
//URL to insert appointment
const INSERT_SPECIFIC_APPOINTMENT =
- "/Doctors.svc/REST/InsertSpecificAppointment";
+ "Services/Doctors.svc/REST/InsertSpecificAppointment";
//URL to get patient share
const GET_PATIENT_SHARE =
- "/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO";
+ "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO";
//URL to get patient appointment history
const GET_PATIENT_APPOINTMENT_HISTORY =
- "/Doctors.svc/REST/PateintHasAppoimentHistory";
+ "Services/Doctors.svc/REST/PateintHasAppoimentHistory";
//URL to get patient appointment curfew history
const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY =
- "/Doctors.svc/REST/AppoimentHistoryForCurfew";
+ "Services/Doctors.svc/REST/AppoimentHistoryForCurfew";
//URL to confirm appointment
-const CONFIRM_APPOINTMENT = "/MobileNotifications.svc/REST/ConfirmAppointment";
+const CONFIRM_APPOINTMENT =
+ "Services/MobileNotifications.svc/REST/ConfirmAppointment";
//URL to cancel appointment
-const CANCEL_APPOINTMENT = "/Doctors.svc/REST/CancelAppointment";
+const CANCEL_APPOINTMENT = "Services/Doctors.svc/REST/CancelAppointment";
//URL get appointment QR
-const GENERATE_QR_APPOINTMENT = "/Doctors.svc/REST/GenerateQRAppointmentNo";
+const GENERATE_QR_APPOINTMENT =
+ "Services/Doctors.svc/REST/GenerateQRAppointmentNo";
//URL send email appointment QR
-const EMAIL_QR_APPOINTMENT = "/Notifications.svc/REST/sendEmailForOnLineCheckin";
+const EMAIL_QR_APPOINTMENT =
+ "Services/Notifications.svc/REST/sendEmailForOnLineCheckin";
//URL check payment status
-const CHECK_PAYMENT_STATUS = "/PayFort_Serv.svc/REST/GetRequestStatusByRequestID";
+const CHECK_PAYMENT_STATUS =
+ "Services/PayFort_Serv.svc/REST/GetRequestStatusByRequestID";
//URL create advance payment
-const CREATE_ADVANCE_PAYMENT = "/Doctors.svc/REST/CreateAdvancePayment";
-
-const ADD_ADVANCE_NUMBER_REQUEST = '/PayFort_Serv.svc/REST/AddAdvancedNumberRequest';
+const CREATE_ADVANCE_PAYMENT = "Services/Doctors.svc/REST/CreateAdvancePayment";
-const IS_ALLOW_ASK_DOCTOR = '/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
-const GET_CALL_REQUEST_TYPE = '/Doctors.svc/REST/GetCallRequestType_LOV';
-const SEND_CALL_REQUEST = '/Doctors.svc/REST/InsertCallInfo';
+const ADD_ADVANCE_NUMBER_REQUEST =
+ 'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest';
-const GET_LIVECARE_CLINICS = '/ER_VirtualCall.svc/REST/PatientER_GetClinics';
-const GET_LIVECARE_CLINIC_TIMING = '/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule';
+const IS_ALLOW_ASK_DOCTOR =
+ 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
+const GET_CALL_REQUEST_TYPE =
+ 'Services/Doctors.svc/REST/GetCallRequestType_LOV';
+const SEND_CALL_REQUEST = 'Services/Doctors.svc/REST/InsertCallInfo';
-const GET_ER_APPOINTMENT_FEES = '/DoctorApplication.svc/REST/GetERAppointmentFees';
-const GET_ER_APPOINTMENT_TIME = '/ER_VirtualCall.svc/REST/GetRestTime';
+const GET_LIVECARE_CLINICS =
+ 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics';
+const GET_LIVECARE_CLINIC_TIMING =
+ 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule';
-const ADD_NEW_CALL_FOR_PATIENT_ER = '/DoctorApplication.svc/REST/NewCallForPatientER';
+const GET_ER_APPOINTMENT_FEES =
+ 'Services/DoctorApplication.svc/REST/GetERAppointmentFees';
+const GET_ER_APPOINTMENT_TIME = 'Services/ER_VirtualCall.svc/REST/GetRestTime';
-const GET_LIVECARE_HISTORY = '/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory';
-const CANCEL_LIVECARE_REQUEST = '/ER_VirtualCall.svc/REST/DeleteErRequest';
-const SEND_LIVECARE_INVOICE_EMAIL = '/Notifications.svc/REST/SendInvoiceForLiveCare';
+const ADD_NEW_CALL_FOR_PATIENT_ER =
+ 'Services/DoctorApplication.svc/REST/NewCallForPatientER';
+const GET_LIVECARE_HISTORY =
+ 'Services/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory';
+const CANCEL_LIVECARE_REQUEST =
+ 'Services/ER_VirtualCall.svc/REST/DeleteErRequest';
+const SEND_LIVECARE_INVOICE_EMAIL =
+ 'Services/Notifications.svc/REST/SendInvoiceForLiveCare';
//URL to get medicine and pharmacies list
const CHANNEL = 3;
@@ -135,12 +154,15 @@ const PATIENT_TYPE_ID = 1;
var DeviceTypeID = Platform.isIOS ? 1 : 2;
const LANGUAGE_ID = 2;
-const GET_PHARMCY_ITEMS = "/Lists.svc/REST/GetPharmcyItems_Region";
-const GET_PHARMACY_LIST = "/Patients.svc/REST/GetPharmcyList";
-const GET_PAtIENTS_INSURANCE = "/Patients.svc/REST/Get_PatientInsuranceDetails";
+const GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region";
+const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList";
+const GET_PAtIENTS_INSURANCE =
+ "Services/Patients.svc/REST/Get_PatientInsuranceDetails";
const GET_PAtIENTS_INSURANCE_UPDATED =
- "/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory";
-const GET_PAtIENTS_INSURANCE_APPROVALS = "/Patients.svc/REST/GetApprovalStatus";
+ "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory";
+const GET_PAtIENTS_INSURANCE_APPROVALS =
+ "Services/Patients.svc/REST/GetApprovalStatus";
+const SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse';
class AppGlobal {
static var context;
@@ -149,7 +171,7 @@ class AppGlobal {
Request getPublicRequest() {
Request request = new Request();
- request.VersionID = 5.5; //3.6;
+ request.VersionID = 5.6; //3.6;
request.Channel = 3;
request.IPAdress = "10.20.10.20";
request.generalid = 'Cs2020@2016\$2958';
diff --git a/lib/config/localized_values.dart b/lib/config/localized_values.dart
index c8f59a84..35d24cc7 100644
--- a/lib/config/localized_values.dart
+++ b/lib/config/localized_values.dart
@@ -319,22 +319,48 @@ const Map> localizedValues = {
"seeDetails": {"en": "SEE DETAILS", "ar": "منافعك التامينية"},
"insuranceCards": {"en": "Insurance Cards", "ar": "بطاقات التأمين"},
"requestType": {"en": "Request Type", "ar": "نوع الاستفسار"},
+ "register-info-family": {
+ "en": "How would like to add the new member?",
+ "ar": "كيف ترغب باضافة العضو الجديد؟"
+ },
+ "remove-family-member": {
+ "en": "Remove this member?",
+ "ar": "إزالة ملف العضو؟"
+ },
"MyMedicalFile": {"en": "My Medical File", 'ar': 'ملف الطبي الالكتروني'},
- "myMedicalFileSubTitle": {"en": "All your medical records", 'ar': 'جميع سجلاتك البية'},
+ "myMedicalFileSubTitle": {
+ "en": "All your medical records",
+ 'ar': 'جميع سجلاتك البية'
+ },
"viewMore": {"en": "View More", 'ar': 'عرض المزيد'},
- "homeHealthCareService": {"en": "Home Health Care Service", 'ar': 'الرعاية الصحية المنزلية'},
+ "homeHealthCareService": {
+ "en": "Home Health Care Service",
+ 'ar': 'الرعاية الصحية المنزلية'
+ },
"OnlinePharmacy": {"en": "Online Pharmacy", 'ar': 'صيدلايات الحبيب'},
"EmergencyService": {"en": "Emergency Service", 'ar': 'الفحص الطبي الشامل'},
- "OnlinePaymentService": {"en": "Online Payment Service", 'ar': 'خدمة الدفع عبر الإلكتدوني'},
+ "OnlinePaymentService": {
+ "en": "Online Payment Service",
+ 'ar': 'خدمة الدفع عبر الإلكتدوني'
+ },
"OffersAndPackages": {"en": "Offers and Packages", 'ar': 'العروض والباقات'},
- "ComprehensiveMedicalCheckup": {"en": "Comprehensive Medical Check up", 'ar': 'فحص طبي شامل'},
+ "ComprehensiveMedicalCheckup": {
+ "en": "Comprehensive Medical Check up",
+ 'ar': 'فحص طبي شامل'
+ },
"HMGService": {"en": "HMG Service", 'ar': 'جميع خدمات الحبيب'},
- "ViewAllHabibMedicalService": {"en": "View All Habib Medical Service", 'ar': 'عرض خدمات الحبيب الطبية'},
+ "ViewAllHabibMedicalService": {
+ "en": "View All Habib Medical Service",
+ 'ar': 'عرض خدمات الحبيب الطبية'
+ },
"viewAll": {"en": "View All", 'ar': 'عرض الكل'},
"ContactUs": {"en": "Contact Us", 'ar': 'الوصول إلينا'},
- "ViewAllWaysReachUs": {"en": "View All Ways Reach Us", 'ar': 'جميع طرق الاتصال بنا'},
+ "ViewAllWaysReachUs": {
+ "en": "View All Ways Reach Us",
+ 'ar': 'جميع طرق الاتصال بنا'
+ },
"medicalProfile": {"en": "Medical Profile", 'ar': 'الملف الطبي'},
"consultation": {"en": "Consultation", "ar": "استشارة"},
- "logs": {"en": "Logs", "ar": "السجلات"}
-
+ "logs": {"en": "Logs", "ar": "السجلات"},
+ "textToSpeech": {"en": "How May I Help You?", "ar": "كيف يمكنني مساعدتك؟"}
};
diff --git a/lib/config/shared_pref_kay.dart b/lib/config/shared_pref_kay.dart
index 53fa08dd..414c6a80 100644
--- a/lib/config/shared_pref_kay.dart
+++ b/lib/config/shared_pref_kay.dart
@@ -10,3 +10,4 @@ const ONLY_SMS = 'only-sms';
const AUTH_DATA = 'auth-data';
const IMEI_USER_DATA = 'imei-user-data';
const NHIC_DATA = 'nhic-data';
+const FAMILY_FILE = 'family-file';
diff --git a/lib/core/model/family-file/add_family_file_request.dart b/lib/core/model/family-file/add_family_file_request.dart
new file mode 100644
index 00000000..cfec8e39
--- /dev/null
+++ b/lib/core/model/family-file/add_family_file_request.dart
@@ -0,0 +1,92 @@
+class AddFamilyFileReq {
+ int searchType;
+ int sharedPatientID;
+ String sharedPatientIdentificationID;
+ String sharedPatientMobileNumber;
+ String zipCode;
+ bool isRegister;
+ int patientStatus;
+ double versionID;
+ int channel;
+ int languageID;
+ String iPAdress;
+ String generalid;
+ int patientOutSA;
+ String sessionID;
+ bool isDentalAllowedBackend;
+ int deviceTypeID;
+ int patientID;
+ String tokenID;
+ int patientTypeID;
+ int patientType;
+
+ AddFamilyFileReq(
+ {this.searchType,
+ this.sharedPatientID,
+ this.sharedPatientIdentificationID,
+ this.sharedPatientMobileNumber,
+ this.zipCode,
+ this.isRegister,
+ this.patientStatus,
+ this.versionID,
+ this.channel,
+ this.languageID,
+ this.iPAdress,
+ this.generalid,
+ this.patientOutSA,
+ this.sessionID,
+ this.isDentalAllowedBackend,
+ this.deviceTypeID,
+ this.patientID,
+ this.tokenID,
+ this.patientTypeID,
+ this.patientType});
+
+ AddFamilyFileReq.fromJson(Map json) {
+ searchType = json['SearchType'];
+ sharedPatientID = json['SharedPatientID'];
+ sharedPatientIdentificationID = json['SharedPatientIdentificationID'];
+ sharedPatientMobileNumber = json['SharedPatientMobileNumber'];
+ zipCode = json['ZipCode'];
+ isRegister = json['isRegister'];
+ patientStatus = json['PatientStatus'];
+ versionID = json['VersionID'];
+ channel = json['Channel'];
+ languageID = json['LanguageID'];
+ iPAdress = json['IPAdress'];
+ generalid = json['generalid'];
+ patientOutSA = json['PatientOutSA'];
+ sessionID = json['SessionID'];
+ isDentalAllowedBackend = json['isDentalAllowedBackend'];
+ deviceTypeID = json['DeviceTypeID'];
+ patientID = json['PatientID'];
+ tokenID = json['TokenID'];
+ patientTypeID = json['PatientTypeID'];
+ patientType = json['PatientType'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['SearchType'] = this.searchType;
+ data['SharedPatientID'] = this.sharedPatientID;
+ data['SharedPatientIdentificationID'] = this.sharedPatientIdentificationID;
+ data['SharedPatientMobileNumber'] = this.sharedPatientMobileNumber;
+ data['ZipCode'] = this.zipCode;
+ data['isRegister'] = this.isRegister;
+ data['PatientStatus'] = this.patientStatus;
+ data['VersionID'] = this.versionID;
+ data['Channel'] = this.channel;
+ data['LanguageID'] = this.languageID;
+ data['IPAdress'] = this.iPAdress;
+ data['generalid'] = this.generalid;
+ data['PatientOutSA'] = this.patientOutSA;
+ data['SessionID'] = this.sessionID;
+ data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
+ data['DeviceTypeID'] = this.deviceTypeID;
+ data['PatientID'] = this.patientID;
+ data['TokenID'] = this.tokenID;
+ data['PatientTypeID'] = this.patientTypeID;
+ data['PatientType'] = this.patientType;
+ return data;
+ }
+}
diff --git a/lib/core/model/family-file/insert b/lib/core/model/family-file/insert
new file mode 100644
index 00000000..e69de29b
diff --git a/lib/core/model/family-file/insert_share_file_request.dart b/lib/core/model/family-file/insert_share_file_request.dart
new file mode 100644
index 00000000..02fa9a0b
--- /dev/null
+++ b/lib/core/model/family-file/insert_share_file_request.dart
@@ -0,0 +1,80 @@
+class InsertSharePatientFileReq {
+ int responseID;
+ String shareFamilyPatientName;
+ int status;
+ int regionID;
+ double versionID;
+ int channel;
+ int languageID;
+ String iPAdress;
+ String generalid;
+ int patientOutSA;
+ String sessionID;
+ bool isDentalAllowedBackend;
+ int deviceTypeID;
+ int patientID;
+ String tokenID;
+ int patientTypeID;
+ int patientType;
+
+ InsertSharePatientFileReq(
+ {this.responseID,
+ this.shareFamilyPatientName,
+ this.status,
+ this.regionID,
+ this.versionID,
+ this.channel,
+ this.languageID,
+ this.iPAdress,
+ this.generalid,
+ this.patientOutSA,
+ this.sessionID,
+ this.isDentalAllowedBackend,
+ this.deviceTypeID,
+ this.patientID,
+ this.tokenID,
+ this.patientTypeID,
+ this.patientType});
+
+ InsertSharePatientFileReq.fromJson(Map json) {
+ responseID = json['ResponseID'];
+ shareFamilyPatientName = json['ShareFamilyPatientName'];
+ status = json['Status'];
+ regionID = json['RegionID'];
+ versionID = json['VersionID'];
+ channel = json['Channel'];
+ languageID = json['LanguageID'];
+ iPAdress = json['IPAdress'];
+ generalid = json['generalid'];
+ patientOutSA = json['PatientOutSA'];
+ sessionID = json['SessionID'];
+ isDentalAllowedBackend = json['isDentalAllowedBackend'];
+ deviceTypeID = json['DeviceTypeID'];
+ patientID = json['PatientID'];
+ tokenID = json['TokenID'];
+ patientTypeID = json['PatientTypeID'];
+ patientType = json['PatientType'];
+ }
+
+ Map toJson() {
+ final Map data = new Map();
+ data['ResponseID'] = this.responseID;
+ data['ShareFamilyPatientName'] = this.shareFamilyPatientName;
+ data['Status'] = this.status;
+ data['RegionID'] = this.regionID;
+ data['VersionID'] = this.versionID;
+ data['Channel'] = this.channel;
+ data['LanguageID'] = this.languageID;
+ data['IPAdress'] = this.iPAdress;
+ data['generalid'] = this.generalid;
+ data['PatientOutSA'] = this.patientOutSA;
+ data['SessionID'] = this.sessionID;
+ data['isDentalAllowedBackend'] = this.isDentalAllowedBackend;
+ data['DeviceTypeID'] = this.deviceTypeID;
+ data['PatientID'] = this.patientID;
+ data['TokenID'] = this.tokenID;
+ data['PatientTypeID'] = this.patientTypeID;
+ data['PatientType'] = this.patientType;
+ return data;
+ }
+}
diff --git a/lib/core/service/client/base_app_client.dart b/lib/core/service/client/base_app_client.dart
index ad8754e8..f45fe22b 100644
--- a/lib/core/service/client/base_app_client.dart
+++ b/lib/core/service/client/base_app_client.dart
@@ -21,7 +21,6 @@ AppSharedPreferences sharedPref = new AppSharedPreferences();
/// body: null);
class BaseAppClient {
-
post(String endPoint,
{Map body,
Function(dynamic response, int statusCode) onSuccess,
@@ -32,7 +31,7 @@ class BaseAppClient {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
String token = await sharedPref.getString(TOKEN);
var languageID =
- await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
+ await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'en');
var user = await sharedPref.getObject(USER_PROFILE);
body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] : SETUP_ID
@@ -59,7 +58,8 @@ class BaseAppClient {
: PATIENT_TYPE_ID;
if (user != null) {
body['TokenID'] = token;
- body['PatientID'] = user['PatientID'];
+ body['PatientID'] =
+ body['PatientID'] != null ? body['PatientID'] : user['PatientID'];
body['PatientOutSA'] = user['OutSA'];
body['SessionID'] = getSessionId(token);
}
@@ -85,11 +85,13 @@ class BaseAppClient {
} else {
if (isAllowAny) {
onSuccess(parsed, statusCode);
- } else if (!parsed['IsAuthenticated']) {
+ } else if (parsed['IsAuthenticated'] == null) {
if (parsed['isSMSSent'] == true) {
onSuccess(parsed, statusCode);
} else if (parsed['MessageStatus'] == 1) {
onSuccess(parsed, statusCode);
+ } else if (parsed['Result'] == 'OK') {
+ onSuccess(parsed, statusCode);
} else {
onFailure(
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
@@ -122,7 +124,6 @@ class BaseAppClient {
logout() async {
await sharedPref.remove(LOGIN_TOKEN_ID);
Navigator.of(AppGlobal.context).pushReplacementNamed(LOGIN_TYPE);
-
}
String getSessionId(String id) {
diff --git a/lib/core/viewModels/project_view_model.dart b/lib/core/viewModels/project_view_model.dart
index c231d455..8d360279 100644
--- a/lib/core/viewModels/project_view_model.dart
+++ b/lib/core/viewModels/project_view_model.dart
@@ -14,7 +14,8 @@ class ProjectViewModel with ChangeNotifier {
bool isLoading = false;
bool isError = false;
String error = '';
-
+ dynamic searchvalue;
+ dynamic get searchValue => searchvalue;
Locale get appLocal => _appLocale;
bool get isArabic => _isArabic;
@@ -43,7 +44,7 @@ class ProjectViewModel with ChangeNotifier {
void loadSharedPrefLanguage() async {
currentLanguage = await sharedPref.getString(APP_LANGUAGE);
- _appLocale = Locale(currentLanguage ?? 'ar');
+ _appLocale = Locale(currentLanguage ?? 'en');
_isArabic = currentLanguage != null
? currentLanguage == 'ar' ? true : false
: true;
@@ -71,4 +72,9 @@ class ProjectViewModel with ChangeNotifier {
if (subscription != null) subscription.cancel();
super.dispose();
}
+
+ setSearchValue(data) {
+ searchvalue = data;
+ notifyListeners();
+ }
}
diff --git a/lib/main.dart b/lib/main.dart
index a1944fd0..f0539049 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -4,10 +4,11 @@ import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
-
+import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart';
import 'config/size_config.dart';
import 'core/viewModels/project_view_model.dart';
import 'locator.dart';
+import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
void main() async {
setupLocator();
@@ -15,6 +16,7 @@ void main() async {
}
class MyApp extends StatelessWidget {
+ /// static final _myTabbedPageKey = new GlobalKey<_LandingPageState>();
@override
Widget build(BuildContext context) {
return LayoutBuilder(
@@ -27,6 +29,15 @@ class MyApp extends StatelessWidget {
ChangeNotifierProvider(
create: (context) => ProjectViewModel(),
),
+ ChangeNotifierProvider(
+ create: (context) => SearchProvider()),
+ ChangeNotifierProvider.value(
+ value: SearchProvider(),
+ ),
+ StreamProvider.value(
+ value: RobotProvider().intStream(),
+ initialData: RobotProvider().setValue({}),
+ )
],
child: Consumer(
builder: (context, projectProvider, child) => MaterialApp(
diff --git a/lib/pages/BookAppointment/BookingOptions.dart b/lib/pages/BookAppointment/BookingOptions.dart
index 7a9f449e..dacb25e9 100644
--- a/lib/pages/BookAppointment/BookingOptions.dart
+++ b/lib/pages/BookAppointment/BookingOptions.dart
@@ -1,14 +1,19 @@
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/CardCommon.dart';
+import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
import '../../uitl/translations_delegate_base.dart';
class BookingOptions extends StatelessWidget {
+ final bool isAppbar;
+ BookingOptions({this.isAppbar = false});
@override
Widget build(BuildContext context) {
+ final searchValue = Provider.of(context);
return AppScaffold(
- isShowAppBar: false,
+ isShowAppBar: isAppbar,
appBarTitle: TranslationBase.of(context).bookAppo,
body: Container(
margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 10.0),
@@ -29,17 +34,18 @@ class BookingOptions extends StatelessWidget {
children: [
Expanded(
child: CardCommon(
- image:
- 'assets/images/new-design/search_by_clinic.png',
- text: TranslationBase.of(context).clinic,
- subText: TranslationBase.of(context).name),
+ image: 'assets/images/new-design/search_by_clinic.png',
+ text: TranslationBase.of(context).clinic,
+ subText: TranslationBase.of(context).name,
+ type: 0,
+ ),
),
Expanded(
child: CardCommon(
- image:
- 'assets/images/new-design/search_by_doctor.png',
+ image: 'assets/images/new-design/search_by_doctor.png',
text: TranslationBase.of(context).doctor,
- subText: TranslationBase.of(context).name),
+ subText: TranslationBase.of(context).name,
+ type: 1),
)
],
),
diff --git a/lib/pages/BookAppointment/DoctorProfile.dart b/lib/pages/BookAppointment/DoctorProfile.dart
index b9f6e566..d3b6fc7c 100644
--- a/lib/pages/BookAppointment/DoctorProfile.dart
+++ b/lib/pages/BookAppointment/DoctorProfile.dart
@@ -10,7 +10,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart';
-
+import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'BookConfirm.dart';
import 'components/DocAvailableAppointments.dart';
import 'components/DocInfo.dart';
@@ -18,22 +18,40 @@ import 'components/DocInfo.dart';
class DoctorProfile extends StatefulWidget {
DoctorList doctor;
DoctorProfileList docProfileList;
+ final bool isOpenAppt;
+ DoctorProfile(
+ {@required this.doctor,
+ @required this.docProfileList,
+ this.isOpenAppt = false});
AuthenticatedUser authUser;
- DoctorProfile({@required this.doctor, @required this.docProfileList});
-
@override
_DoctorProfileState createState() => _DoctorProfileState();
}
class _DoctorProfileState extends State
- with SingleTickerProviderStateMixin {
+ with TickerProviderStateMixin {
TabController _tabController;
bool showFooterButton = false;
-
+ var event = RobotProvider();
@override
void initState() {
+ _tabController = new TabController(
+ length: 2,
+ vsync: this,
+ initialIndex: widget.isOpenAppt == true ? 1 : 0);
+
+ event.controller.stream.listen((p) {
+ if (p['clinic_id'] != null &&
+ p['doctor_id'] != null &&
+ p['project_id'] != null) {
+ setState(() {
+ // need to take the data from here
+ // dropdownValue = p['clinic_id'];
+ });
+ }
+ });
_tabController = new TabController(length: 2, vsync: this);
widget.authUser = new AuthenticatedUser();
getPatientData();
diff --git a/lib/pages/BookAppointment/Search.dart b/lib/pages/BookAppointment/Search.dart
index 55fa943e..9af6b449 100644
--- a/lib/pages/BookAppointment/Search.dart
+++ b/lib/pages/BookAppointment/Search.dart
@@ -1,19 +1,25 @@
import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByClinic.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/components/SearchByDoctor.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
+import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart';
+import 'package:diplomaticquarterapp/widgets/others/floating_button_search.dart';
import 'package:flutter/material.dart';
class Search extends StatefulWidget {
+ final int type;
+ Search({this.type = 0});
@override
_SearchState createState() => _SearchState();
}
-class _SearchState extends State with SingleTickerProviderStateMixin {
+class _SearchState extends State with TickerProviderStateMixin {
TabController _tabController;
@override
void initState() {
- _tabController = new TabController(length: 2, vsync: this);
+ _tabController =
+ new TabController(length: 2, vsync: this, initialIndex: widget.type);
+
super.initState();
}
@@ -36,6 +42,7 @@ class _SearchState extends State with SingleTickerProviderStateMixin {
body: TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [SearchByClinic(), SearchByDoctor()],
- controller: _tabController));
+ controller: _tabController),
+ bottomNavigationBar: BottomBarSearch());
}
}
diff --git a/lib/pages/BookAppointment/SearchResults.dart b/lib/pages/BookAppointment/SearchResults.dart
index 3ab31dec..7da5112b 100644
--- a/lib/pages/BookAppointment/SearchResults.dart
+++ b/lib/pages/BookAppointment/SearchResults.dart
@@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
+import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
@@ -15,9 +16,28 @@ class SearchResults extends StatefulWidget {
}
class _SearchResultsState extends State {
+ var event = RobotProvider();
+ List tempList = [];
+
@override
void initState() {
- // TODO: implement initState
+ event.controller.stream.listen((p) {
+ // if (p['project_id'] != null) {
+ // tempList = [];
+ // widget.doctorsList.forEach((e) => {
+ // if (e.projectID == int.parse(p['project_id'])) {tempList.add(e)}
+ // });
+ // } else if (p['doctor_id'] != null) {
+ // tempList = [];
+ // widget.doctorsList.forEach((e) => {
+ // if (e.doctorID == int.parse(p['doctor_id'])) {tempList.add(e)}
+ // });
+ // DoctorView().getDoctorsProfile(context, tempList[0], isAppo: true);
+ // }
+ // setState(() {
+ // widget.doctorsList = tempList;
+ // });
+ });
super.initState();
}
diff --git a/lib/pages/BookAppointment/components/SearchByClinic.dart b/lib/pages/BookAppointment/components/SearchByClinic.dart
index 9dc97373..33828171 100644
--- a/lib/pages/BookAppointment/components/SearchByClinic.dart
+++ b/lib/pages/BookAppointment/components/SearchByClinic.dart
@@ -1,11 +1,16 @@
+import 'dart:convert';
+
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Clinics/ClinicListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
+import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
+import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:flutter/material.dart';
+import 'package:provider/provider.dart';
import 'package:smart_progress_bar/smart_progress_bar.dart';
import '../SearchResults.dart';
@@ -19,11 +24,20 @@ class SearchByClinic extends StatefulWidget {
class _SearchByClinicState extends State {
bool nearestAppo = false;
String dropdownValue;
+ var event = RobotProvider();
List clinicsList = [];
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) => getClinicsList());
+ // event.controller.stream.listen((p) {
+ // if (p['clinic_id'] != null) {
+ // // setState(() {
+ // dropdownValue = p['clinic_id'].toString();
+ // //});
+ // getDoctorsList(context);
+ // }
+ // });
super.initState();
}
@@ -59,8 +73,8 @@ class _SearchByClinicState extends State {
),
borderRadius: BorderRadius.circular(10),
),
- margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 20.0),
- padding: EdgeInsets.all(10.0),
+ // margin: EdgeInsets.fromLTRB(10.0, 20.0, 10.0, 20.0),
+ padding: EdgeInsets.all(8.0),
width: MediaQuery.of(context).size.width,
child: DropdownButtonHideUnderline(
child: DropdownButton(
@@ -75,7 +89,7 @@ class _SearchByClinicState extends State {
onChanged: (newValue) {
setState(() {
dropdownValue = newValue;
- print(dropdownValue);
+
getDoctorsList(context);
});
},
diff --git a/lib/pages/BookAppointment/components/SearchByDoctor.dart b/lib/pages/BookAppointment/components/SearchByDoctor.dart
index e1afea54..3e817878 100644
--- a/lib/pages/BookAppointment/components/SearchByDoctor.dart
+++ b/lib/pages/BookAppointment/components/SearchByDoctor.dart
@@ -70,7 +70,11 @@ class _SearchByDoctorState extends State {
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: new Color(0xFFbcc2c4),
- onPressed: _isButtonDisabled ? null : _searchDoctor(context),
+ onPressed: () {
+ if (_isButtonDisabled == false) {
+ _searchDoctor(context);
+ }
+ },
child: Text(TranslationBase.of(context).search,
style: TextStyle(fontSize: 18.0)),
),
@@ -80,14 +84,16 @@ class _SearchByDoctorState extends State {
getDoctorsList(BuildContext context) {
List doctorsList = [];
DoctorsListService service = new DoctorsListService();
- service.getDoctorsListByName(doctorNameController.text, context).then((res) {
+ service
+ .getDoctorsListByName(doctorNameController.text, context)
+ .then((res) {
if (res['MessageStatus'] == 1) {
setState(() {
- if(res['DoctorList'].length != 0) {
- res['DoctorList'].forEach((v) {
- doctorsList.add(new DoctorList.fromJson(v));
- });
- } else {}
+ if (res['DoctorList'].length != 0) {
+ res['DoctorList'].forEach((v) {
+ doctorsList.add(new DoctorList.fromJson(v));
+ });
+ } else {}
});
navigateToSearchResults(context, doctorsList);
} else {
@@ -95,7 +101,8 @@ class _SearchByDoctorState extends State {
}
}).catchError((err) {
print(err);
- }).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
+ }).showProgressBar(
+ text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
_onDocTextChanged(content) {
diff --git a/lib/pages/BookAppointment/widgets/CardCommon.dart b/lib/pages/BookAppointment/widgets/CardCommon.dart
index 2f05fa91..a6cf648f 100644
--- a/lib/pages/BookAppointment/widgets/CardCommon.dart
+++ b/lib/pages/BookAppointment/widgets/CardCommon.dart
@@ -5,23 +5,24 @@ class CardCommon extends StatelessWidget {
final image;
final text;
final subText;
-
+ final type;
const CardCommon(
- {@required this.image, @required this.text, @required this.subText});
+ {@required this.image,
+ @required this.text,
+ @required this.subText,
+ @required this.type});
@override
Widget build(BuildContext context) {
-
return GestureDetector(
onTap: () {
- navigateToSearch(context);
+ navigateToSearch(context, this.type);
},
child: Container(
margin: EdgeInsets.fromLTRB(9.0, 9.0, 9.0, 9.0),
decoration: BoxDecoration(boxShadow: [
BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)
- ], borderRadius: BorderRadius.circular(10),
- color: Colors.white),
+ ], borderRadius: BorderRadius.circular(10), color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@@ -39,9 +40,7 @@ class CardCommon extends StatelessWidget {
child: Text(this.subText,
overflow: TextOverflow.clip,
style: TextStyle(
- color: Colors.black,
- letterSpacing: 1.0,
- fontSize: 15.0)),
+ color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)),
),
Container(
alignment: Alignment.bottomRight,
@@ -54,9 +53,12 @@ class CardCommon extends StatelessWidget {
);
}
- Future navigateToSearch(context) async {
+ Future navigateToSearch(context, type) async {
Navigator.push(
- context, MaterialPageRoute(builder: (context) => Search()));
+ context,
+ MaterialPageRoute(
+ builder: (context) => Search(
+ type: type,
+ )));
}
-
}
diff --git a/lib/pages/BookAppointment/widgets/DoctorView.dart b/lib/pages/BookAppointment/widgets/DoctorView.dart
index 35068bd7..3d69a93d 100644
--- a/lib/pages/BookAppointment/widgets/DoctorView.dart
+++ b/lib/pages/BookAppointment/widgets/DoctorView.dart
@@ -113,12 +113,12 @@ class DoctorView extends StatelessWidget {
return docSpeciality;
}
- getDoctorsProfile(context, DoctorList docObject) {
+ getDoctorsProfile(context, DoctorList docObject, {isAppo}) {
List docProfileList = [];
DoctorsListService service = new DoctorsListService();
service
- .getDoctorsProfile(
- docObject.doctorID, docObject.clinicID, docObject.projectID, context)
+ .getDoctorsProfile(docObject.doctorID, docObject.clinicID,
+ docObject.projectID, context)
.then((res) {
if (res['MessageStatus'] == 1) {
if (res['DoctorProfileList'].length != 0) {
@@ -126,7 +126,8 @@ class DoctorView extends StatelessWidget {
docProfileList.add(new DoctorProfileList.fromJson(v));
});
} else {}
- navigateToDoctorProfile(context, docObject, docProfileList[0]);
+ navigateToDoctorProfile(context, docObject, docProfileList[0],
+ isAppo: isAppo);
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
@@ -135,13 +136,15 @@ class DoctorView extends StatelessWidget {
}).showProgressBar(text: "Loading", backgroundColor: Colors.blue.withOpacity(0.6));
}
- Future navigateToDoctorProfile(context, docObject, docProfile) async {
+ Future navigateToDoctorProfile(context, docObject, docProfile,
+ {isAppo}) async {
Navigator.push(
context,
MaterialPageRoute(
- builder: (context) =>
- DoctorProfile(doctor: docObject, docProfileList: docProfile)
-
- ));
+ builder: (context) => DoctorProfile(
+ doctor: docObject,
+ docProfileList: docProfile,
+ isOpenAppt: isAppo,
+ )));
}
}
diff --git a/lib/pages/conference/widgets/noise_box.dart b/lib/pages/conference/widgets/noise_box.dart
index 5f638127..5087415f 100644
--- a/lib/pages/conference/widgets/noise_box.dart
+++ b/lib/pages/conference/widgets/noise_box.dart
@@ -27,7 +27,7 @@ class NoiseBox extends StatefulWidget {
_NoiseBoxState createState() => _NoiseBoxState();
}
-class _NoiseBoxState extends State with SingleTickerProviderStateMixin {
+class _NoiseBoxState extends State with TickerProviderStateMixin {
AnimationController _animationController;
int _density;
@@ -107,7 +107,9 @@ class NoisePainter extends CustomPainter {
@required this.density,
}) : assert(width != null),
assert(height != null),
- assert(density != null && density >= 3 && density < math.min(width, height));
+ assert(density != null &&
+ density >= 3 &&
+ density < math.min(width, height));
List colors = [
Colors.black,
diff --git a/lib/pages/family/add-family-member.dart b/lib/pages/family/add-family-member.dart
new file mode 100644
index 00000000..f1742141
--- /dev/null
+++ b/lib/pages/family/add-family-member.dart
@@ -0,0 +1,245 @@
+import 'package:diplomaticquarterapp/config/size_config.dart';
+import 'package:diplomaticquarterapp/core/model/family-file/add_family_file_request.dart';
+import 'package:diplomaticquarterapp/core/model/family-file/insert_share_file_request.dart';
+import 'package:diplomaticquarterapp/routes.dart';
+import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
+import 'package:diplomaticquarterapp/pages/family/add-family_type.dart';
+import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
+import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
+import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
+import 'package:diplomaticquarterapp/uitl/utils.dart';
+import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
+import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
+import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
+import 'package:diplomaticquarterapp/widgets/mobile-no/mobile_no.dart';
+import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
+import 'package:diplomaticquarterapp/widgets/otp/sms-popup.dart';
+import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
+import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
+import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
+
+class AddMember extends StatefulWidget {
+ @override
+ _AddMember createState() => _AddMember();
+}
+
+class _AddMember extends State {
+ final util = Utils();
+ final nationalIDorFile = TextEditingController();
+ final int loginType = AddFamilyMemberType.loginType;
+ String mobileNo;
+ String countryCode = '966';
+ bool isButtonDisabled = true;
+ var sharedPref = new AppSharedPreferences();
+ final authService = new AuthProvider();
+ bool isLoading = false;
+ var familyFileProvider = FamilyFilesProvider();
+
+ var patientShareRequestID;
+ @override
+ void initState() {
+ super.initState();
+ }
+
+ @override
+ Widget build(BuildContext context) {
+ return AppScaffold(
+ appBarTitle: TranslationBase.of(context).myFamilyFiles,
+ isShowAppBar: true,
+ body: isLoading == true
+ ? AppCircularProgressIndicator()
+ : SingleChildScrollView(
+ child: Container(
+ padding:
+ EdgeInsets.only(top: 10, left: 20, right: 20, bottom: 30),
+ height: SizeConfig.realScreenHeight * .9,
+ width: SizeConfig.realScreenWidth,
+ child: Column(children: [
+ Expanded(
+ flex: 2,
+ child: AppText(
+ TranslationBase.of(context).enterNationalId,
+ fontSize: SizeConfig.textMultiplier * 3.5,
+ textAlign: TextAlign.left,
+ )),
+ Expanded(
+ flex: 3,
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.spaceEvenly,
+ children: [
+ MobileNo(
+ onNumberChange: (value) =>
+ {mobileNo = value, validateForm()},
+ onCountryChange: (value) => countryCode = value),
+ Container(
+ child: TextFields(
+ controller: nationalIDorFile,
+ onChanged: (value) => {validateForm()},
+ prefixIcon: Icon(
+ loginType == 1
+ ? Icons.chrome_reader_mode
+ : Icons.receipt,
+ color: Colors.red),
+ padding: EdgeInsets.only(
+ top: 20, bottom: 20, left: 10, right: 10),
+ hintText: loginType == 1
+ ? TranslationBase.of(context).nationalID
+ : TranslationBase.of(context).fileNo,
+ ))
+ ],
+ ),
+ ),
+ Expanded(
+ flex: 3,
+ child: Column(
+ mainAxisAlignment: MainAxisAlignment.end,
+ children: [
+ Row(
+ children: [
+ Expanded(
+ child: DefaultButton(
+ TranslationBase.of(context).add,
+ () => {this.addMember()},
+ color: isButtonDisabled == true
+ ? Colors.grey
+ : Colors.grey[900],
+ textColor: Colors.white,
+ ))
+ ],
+ ),
+ ],
+ ))
+ ]),
+ )));
+ }
+
+ void validateForm() {
+ if (util.validateIDBox(nationalIDorFile.text, loginType) == true &&
+ mobileNo.length >= 9 &&
+ util.isSAUDIIDValid(nationalIDorFile.text, loginType) == true) {
+ setState(() {
+ isButtonDisabled = false;
+ });
+ } else {
+ setState(() {
+ isButtonDisabled = true;
+ });
+ }
+ }
+
+ addMember() {
+ var request = AddFamilyFileReq();
+ if (this.loginType == 1) {
+ request.sharedPatientID = 0;
+ request.sharedPatientIdentificationID = this.nationalIDorFile.text;
+ } else if (this.loginType == 2) {
+ request.sharedPatientID = int.parse(this.nationalIDorFile.text);
+ request.sharedPatientIdentificationID = '';
+ }
+ request.searchType = this.loginType;
+ request.sharedPatientMobileNumber = this.mobileNo;
+ request.zipCode = countryCode;
+ request.isRegister = false;
+ request.patientStatus = 2;
+ loading(true);
+ familyFileProvider
+ .addFamilyFile(request)
+ .then((value) => manageFamily(value))
+ .catchError(() {
+ loading(false);
+ });
+ }
+
+ manageFamily(addMemberResult) {
+ loading(false);
+ ConfirmDialog dialog = new ConfirmDialog(
+ context: context,
+ confirmMessage: addMemberResult['ShareFamilyFileObj']['Message'],
+ okText: TranslationBase.of(context).confirm,
+ cancelText: TranslationBase.of(context).cancel_nocaps,
+ okFunction: () => {
+ insertFamilyData(addMemberResult),
+ ConfirmDialog.closeAlertDialog(context)
+ },
+ cancelFunction: () => {});
+ dialog.showAlertDialog(context);
+ }
+
+ insertFamilyData(addMemberResult) {
+ var request = InsertSharePatientFileReq();
+ request.responseID = addMemberResult['ShareFamilyFileObj']['ReponseID'];
+ request.shareFamilyPatientName =
+ addMemberResult['ShareFamilyFileObj']['SharedPatientName'];
+ request.status = 2;
+ if (request.patientOutSA == 1) {
+ request.regionID = 2;
+ } else {
+ request.regionID = 1;
+ }
+ loading(true);
+ this
+ .familyFileProvider
+ .insertNewMember(request)
+ .then((value) => sendActivationCode(value));
+ }
+
+ sendActivationCode(result) {
+ // var request = this.getCommonRequest();
+ loading(true);
+ patientShareRequestID = result['PatientShareRequestID'];
+ this
+ .familyFileProvider
+ .sendActivationCode(mobileNo, countryCode, nationalIDorFile.text)
+ .then((result) => {
+ if (result != null && result['isSMSSent'] == true)
+ {this.startSMSService(1, result)}
+ // {loading(false), this.startSMSService(type)}
+ // else
+ // {loading(false)}
+ });
+ }
+
+ startSMSService(type, result) {
+ loading(false);
+ new SMSOTP(
+ context,
+ type,
+ this.mobileNo,
+ (value) => {this.checkActivationCode(value, result)},
+ () => {
+ print('Faild..'),
+ },
+ ).displayDialog(context);
+ }
+
+ checkActivationCode(value, result) {
+ this
+ .familyFileProvider
+ .checkActivationCode(
+ result['LogInTokenID'], value, nationalIDorFile.text, mobileNo)
+ .then((result) => {
+ SMSOTP.hideSMSBox(context),
+ handleFamilyRequests(this.patientShareRequestID, 3)
+ });
+ }
+
+ handleFamilyRequests(id, stauts) {
+ this
+ .familyFileProvider
+ .acceptAndRejectRecievedRequests(id, stauts)
+ .then((result) => {
+ sharedPref.remove(FAMILY_FILE),
+ Navigator.of(context).pushNamed(
+ MY_FAMILIY,
+ )
+ });
+ }
+
+ loading(flag) {
+ setState(() {
+ isLoading = flag;
+ });
+ }
+}
diff --git a/lib/pages/family/add-family_type.dart b/lib/pages/family/add-family_type.dart
new file mode 100644
index 00000000..96e055b3
--- /dev/null
+++ b/lib/pages/family/add-family_type.dart
@@ -0,0 +1,154 @@
+import 'package:diplomaticquarterapp/config/size_config.dart';
+import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
+import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
+import 'package:diplomaticquarterapp/widgets/card/rounded_container.dart';
+import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
+import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
+import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
+import 'package:flutter/cupertino.dart';
+import 'package:flutter/material.dart';
+import 'package:diplomaticquarterapp/routes.dart';
+
+class AddFamilyMemberType extends StatelessWidget {
+ static int loginType = 0;
+ @override
+ Widget build(BuildContext context) {
+ return AppScaffold(
+ appBarTitle: TranslationBase.of(context).myFamilyFiles,
+ isShowAppBar: true,
+ body: Padding(
+ padding: EdgeInsets.all(20),
+ child: Column(
+ children: [
+ Expanded(
+ flex: 6,
+ child: Column(
+ // mainAxisAlignment: MainAxisAlignment.spaceBetween,
+ crossAxisAlignment: CrossAxisAlignment.start,
+ children: [
+ Image.asset(
+ 'assets/images/habib-logo.png',
+ height: 80,
+ width: 80,
+ ),
+ Padding(
+ padding: EdgeInsets.all(20),
+ child: AppText(
+ TranslationBase.of(context).registerInfoFamily,
+ fontSize: SizeConfig.textMultiplier * 3.5,
+ textAlign: TextAlign.left,
+ ),
+ ),
+ Padding(
+ padding: EdgeInsets.all(20),
+ child: Row(
+ mainAxisAlignment: MainAxisAlignment.center,
+ children: [
+ Expanded(
+ child: InkWell(
+ onTap: () => {
+ AddFamilyMemberType.loginType = 1,
+ Navigator.of(context)
+ .pushNamed(ADD_FAMILY_MEMBER)
+ },
+ child: RoundedContainer(
+ borderColor: Colors.grey,
+ showBorder: true,
+ child: Padding(
+ padding: EdgeInsets.fromLTRB(
+ 20, 10, 20, 10),
+ child: Column(
+ mainAxisAlignment:
+ MainAxisAlignment.center,
+ children: [
+ Image.asset(
+ 'assets/images/id_card_icon.png',
+ height: SizeConfig
+ .imageSizeMultiplier *
+ 12,
+ width: SizeConfig
+ .imageSizeMultiplier *
+ 15,
+ ),
+ SizedBox(
+ height: 20,
+ ),
+ AppText(
+ TranslationBase.of(context)
+ .nationalID,
+ fontSize: SizeConfig
+ .textMultiplier *
+ 2,
+ )
+ ],
+ ),
+ )))),
+ Expanded(
+ child: InkWell(
+ onTap: () => {
+ AddFamilyMemberType.loginType = 2,
+ Navigator.of(context)
+ .pushNamed(ADD_FAMILY_MEMBER)
+ },
+ child: RoundedContainer(
+ borderColor: Colors.grey,
+ showBorder: true,
+ child: Padding(
+ padding: EdgeInsets.fromLTRB(
+ 25, 10, 25, 10),
+ child: Column(
+ children: [
+ Image.asset(
+ 'assets/images/my_file_white_icon.png',
+ height: SizeConfig
+ .imageSizeMultiplier *
+ 12,
+ width: SizeConfig
+ .imageSizeMultiplier *
+ 15,
+ ),
+ SizedBox(
+ height: 20,
+ ),
+ AppText(
+ TranslationBase.of(context)
+ .fileNo,
+ fontSize: SizeConfig
+ .textMultiplier *
+ 2,
+ )
+ ],
+ ),
+ ))))
+ ],
+ )),
+ Divider(
+ color: Colors.grey,
+ height: 2,
+ ),
+ ]),
+ ),
+ // Expanded(
+ // flex: 2,
+ // child: Column(
+ // mainAxisAlignment: MainAxisAlignment.end,
+ // children: [
+ // Row(
+ // children: [
+ // Expanded(
+ // child: DefaultButton(
+ // TranslationBase.of(context).registerNow,
+ // () => {
+ // Navigator.of(context).pushNamed(
+ // REGISTER,
+ // )
+ // },
+ // ))
+ // ],
+ // ),
+ // ],
+ // ))
+ ],
+ )));
+ }
+}
diff --git a/lib/pages/family/my-family.dart b/lib/pages/family/my-family.dart
index 93638e52..b2757514 100644
--- a/lib/pages/family/my-family.dart
+++ b/lib/pages/family/my-family.dart
@@ -1,25 +1,24 @@
import 'package:diplomaticquarterapp/config/size_config.dart';
+import 'package:diplomaticquarterapp/models/Authentication/check_activation_code_response.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
+import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
+import 'package:diplomaticquarterapp/uitl/utils.dart';
+import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
+import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
+import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
+import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
+import 'package:diplomaticquarterapp/routes.dart';
-class MyFamily extends StatefulWidget {
- @override
- _MyFamily createState() => _MyFamily();
-}
-
-class _MyFamily extends State {
- bool isLoading = true;
- var familyFileProvider = FamilyFilesProvider();
- @override
- void initState() {
- isLoading = true;
- // checkUser(context);
- super.initState();
- }
+class MyFamily extends StatelessWidget {
+ //bool isLoading = true;
+ final familyFileProvider = FamilyFilesProvider();
+ AppSharedPreferences sharedPref = new AppSharedPreferences();
+ var userID;
Widget build(BuildContext context) {
return AppScaffold(
@@ -30,7 +29,7 @@ class _MyFamily extends State {
child: SingleChildScrollView(
padding: EdgeInsets.all(20),
child: Container(
- height: SizeConfig.realScreenHeight * .9,
+ height: SizeConfig.realScreenHeight,
width: SizeConfig.realScreenWidth,
child: Stack(
children: [
@@ -48,42 +47,32 @@ class _MyFamily extends State {
],
),
TabBarView(
- children: [myFamilyDetails(), myFamilyRequest()],
+ children: [
+ myFamilyDetails(context),
+ myFamilyRequest(context)
+ ],
)
],
)))));
}
- Widget myFamilyDetails() {
- return Padding(
- padding: EdgeInsets.only(top: 40),
- child: Column(
- children: [
- Row(
- mainAxisAlignment: MainAxisAlignment.spaceBetween,
- children: [
- Expanded(
- flex: 3, child: Text(TranslationBase.of(context).request)),
- Expanded(
- flex: 2,
- child: Text(
- TranslationBase.of(context).switchUser,
- )),
- Expanded(
- flex: 1,
- child: Text(
- TranslationBase.of(context).deleteView,
- )),
- ],
- ),
- FutureBuilder(
+ Widget myFamilyDetails(context) {
+ return // Padding(
+ //padding: EdgeInsets.only(top: 50),
+ //child:
+ Column(
+ // mainAxisAlignment: MainAxisAlignment.start,
+ children: [
+ Expanded(
+ flex: 3,
+ child: FutureBuilder(
future: getFamilyFiles(), // async work
builder: (BuildContext context,
AsyncSnapshot snapshot) {
switch (snapshot.connectionState) {
case ConnectionState.waiting:
return Padding(
- padding: EdgeInsets.all(10),
+ padding: EdgeInsets.only(top: 50),
child: Text('Loading....'));
default:
if (snapshot.hasError)
@@ -91,35 +80,160 @@ class _MyFamily extends State {
padding: EdgeInsets.all(10),
child: Text(snapshot.error));
else
- return Column(
- children: snapshot
- .data.getAllSharedRecordsByStatusList
- .map((result) {
- return Padding(
- padding: EdgeInsets.all(10),
- child: Row(
+ return Padding(
+ padding: EdgeInsets.only(top: 50),
+ child: Column(children: [
+ Row(
+ mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Expanded(
- flex: 3, child: Text(result.patientName)),
- Expanded(flex: 2, child: Icon(Icons.group)),
- Expanded(flex: 1, child: Icon(Icons.delete)),
+ flex: 3,
+ child: Text(
+ TranslationBase.of(context).request)),
+ Expanded(
+ flex: 2,
+ child: Text(
+ TranslationBase.of(context).switchUser,
+ )),
+ Expanded(
+ flex: 1,
+ child: Text(
+ TranslationBase.of(context).deleteView,
+ )),
],
- ));
- }).toList());
+ ),
+ Column(
+ mainAxisAlignment: MainAxisAlignment.start,
+ children: snapshot
+ .data.getAllSharedRecordsByStatusList
+ .map((result) {
+ return result.status == 3
+ ? Padding(
+ padding: EdgeInsets.all(10),
+ child: Row(
+ children: [
+ Expanded(
+ flex: 3,
+ child:
+ Text(result.patientName)),
+ Expanded(
+ flex: 2,
+ child: IconButton(
+ icon: Icon(Icons.group),
+ color: Colors.black,
+ onPressed: () {
+ switchUser(
+ result, context);
+ },
+ )),
+ Expanded(
+ flex: 1,
+ child: IconButton(
+ icon: Icon(
+ Icons.delete,
+ color: Colors.black,
+ ),
+ onPressed: () {
+ deleteFamily(
+ result, context);
+ },
+ )),
+ ],
+ ))
+ : SizedBox();
+ }).toList())
+ ]));
}
},
- )
- ],
- ));
+ )),
+ Expanded(
+ flex: 1,
+ child: Column(
+ children: [
+ Row(
+ children: [
+ Expanded(
+ child: DefaultButton(
+ TranslationBase.of(context).addFamilyMember,
+ () => {
+ Navigator.of(context).pushNamed(ADD_FAMILY_MEMBER_TYPE)
+ },
+ color: Colors.grey[900],
+ textColor: Colors.white,
+ ))
+ ],
+ ),
+ ],
+ ))
+ ],
+ );
}
- Widget myFamilyRequest() {
+ addMember() {}
+ Widget myFamilyRequest(context) {
return Column(
children: [],
);
}
- Future getFamilyFiles() {
- return familyFileProvider.getSharedRecordByStatus();
+ Future getFamilyFiles() async {
+ if (await sharedPref.getObject(FAMILY_FILE) != null) {
+ // print(await sharedPref.getObject(FAMILY_FILE));
+ return Future.value(GetAllSharedRecordsByStatusResponse.fromJson(
+ await sharedPref.getObject(FAMILY_FILE)));
+ } else {
+ return familyFileProvider.getSharedRecordByStatus();
+ }
+ }
+
+ deleteFamily(family, context) {
+ ConfirmDialog dialog = new ConfirmDialog(
+ context: context,
+ confirmMessage: TranslationBase.of(context).removeFamilyMember,
+ okText: TranslationBase.of(context).confirm,
+ cancelText: TranslationBase.of(context).cancel_nocaps,
+ okFunction: () => {
+ removeFamily(family, context),
+ ConfirmDialog.closeAlertDialog(context)
+ },
+ cancelFunction: () => {});
+ dialog.showAlertDialog(context);
+ }
+
+ removeFamily(GetAllSharedRecordsByStatusList family, context) {
+ this.userID = family.iD;
+ Map request = {};
+ request['ID'] = this.userID;
+ request['IsActive'] = false;
+ this
+ .familyFileProvider
+ .deativateActivateMemberFile(request)
+ .then((value) => refreshFamily(context));
+ }
+
+ refreshFamily(context) {
+ sharedPref.remove(FAMILY_FILE);
+ (context as Element).reassemble();
+ }
+
+ switchUser(user, context) {
+ Utils.showProgressDialog(context);
+ this
+ .familyFileProvider
+ .silentLoggin(user)
+ .then((value) => loginAfter(value, context));
+ }
+
+ loginAfter(result, context) {
+ Utils.hideProgressDialog();
+ result = CheckActivationCode.fromJson(result);
+ this.sharedPref.clear();
+ this.sharedPref.setObject(USER_PROFILE, result.list);
+ this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);
+ this.sharedPref.setString(TOKEN, result.authenticationTokenID);
+ //this.checkIfUserAgreedBefore(result),
+ Navigator.of(context).pushNamed(
+ HOME,
+ );
}
}
diff --git a/lib/pages/landing/landing_page.dart b/lib/pages/landing/landing_page.dart
index 99a5f10e..5b91e8c1 100644
--- a/lib/pages/landing/landing_page.dart
+++ b/lib/pages/landing/landing_page.dart
@@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart';
import 'package:diplomaticquarterapp/pages/medical/my_admissions_page.dart';
+import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart';
@@ -24,6 +25,7 @@ import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'home_page.dart';
+import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
class LandingPage extends StatefulWidget {
static bool isOpenCallPage = false;
@@ -37,6 +39,7 @@ class LandingPage extends StatefulWidget {
class _LandingPageState extends State with WidgetsBindingObserver {
int currentTab = 0;
PageController pageController;
+ ProjectViewModel projectProvider;
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
final authService = new AuthProvider();
@@ -142,8 +145,7 @@ class _LandingPageState extends State with WidgetsBindingObserver {
print(route.settings.name);
}
- Map myMap =
- new Map.from(message);
+ Map myMap = new Map.from(message);
print(myMap);
LandingPage.isOpenCallPage = true;
LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
@@ -267,6 +269,10 @@ class _LandingPageState extends State with WidgetsBindingObserver {
@override
Widget build(BuildContext context) {
+ //final searchValue = Provider.of(context);
+ //print(searchValue);
+ // projectProvider = Provider.of(context);
+ // checkValue(projectProvider);
return Scaffold(
appBar: AppBar(
elevation: 0,
@@ -356,4 +362,10 @@ class _LandingPageState extends State with WidgetsBindingObserver {
void setUserValues(value) async {
sharedPref.setObject(IMEI_USER_DATA, value);
}
+
+ checkValue(projectProvider) {
+ if (projectProvider.searchValue != null) {
+ _changeCurrentTab(2);
+ }
+ }
}
diff --git a/lib/pages/login/confirm-login.dart b/lib/pages/login/confirm-login.dart
index 5c5add4d..ac36c7d6 100644
--- a/lib/pages/login/confirm-login.dart
+++ b/lib/pages/login/confirm-login.dart
@@ -271,10 +271,7 @@ class _ConfirmLogin extends State {
if (type == 2 || type == 3) {
fingrePrintBefore = type;
}
- this.selectedOption =
- (user != null && (user.logInType == 3 || user.logInType == 2))
- ? user.logInType
- : fingrePrintBefore != null ? fingrePrintBefore : type;
+ this.selectedOption = fingrePrintBefore != null ? fingrePrintBefore : type;
switch (type) {
case 1:
@@ -411,21 +408,12 @@ class _ConfirmLogin extends State {
});
}
- setUser() async {
+ setUser() async {}
+
+ setDefault() async {
if (await sharedPref.getObject(IMEI_USER_DATA) != null)
user = SelectDeviceIMEIRES.fromJson(
await sharedPref.getObject(IMEI_USER_DATA));
- }
-
- setDefault() async {
- // this.user = this.cs.sharedService.getSharedData(
- // AuthenticationService.IMEI_USER_DATA,
- // false
- // );
-
- setState(() {
- setUser();
- });
if (await sharedPref.getObject(REGISTER_DATA_FOR_LOGIIN) != null) {
isMoreOption = true;
@@ -488,46 +476,43 @@ class _ConfirmLogin extends State {
SMSOTP.showLoadingDialog(context, true);
var request = this.getCommonRequest().toJson();
- this
- .authService
- .checkActivationCode(request, value)
- .then((result) => {
- if (result is Map)
+ this.authService.checkActivationCode(request, value).then((result) => {
+ if (result is Map)
+ {
+ result = CheckActivationCode.fromJson(result),
+ if (this.registerd_data != null &&
+ this.registerd_data.isRegister == true)
{
- result = CheckActivationCode.fromJson(result),
- if (this.registerd_data != null &&
- this.registerd_data.isRegister == true)
- {
- Navigator.of(context).pushNamed(
- REGISTER_INFO,
- )
- }
- else
- {
- this.userData = result
- .list, //AuthenticatedUser.fromJson(result['List'][0]),
- this.sharedPref.setObject(USER_PROFILE, result.list),
- this.loginTokenID = result.logInTokenID,
- this
- .sharedPref
- .setObject(LOGIN_TOKEN_ID, result.logInTokenID),
- this
- .sharedPref
- .setString(TOKEN, result.authenticationTokenID),
- this.checkIfUserAgreedBefore(result),
- // Navigator.of(context).pop(),
- SMSOTP.showLoadingDialog(context, false),
- }
+ Navigator.of(context).pushNamed(
+ REGISTER_INFO,
+ )
}
else
{
+ this.userData = result
+ .list, //AuthenticatedUser.fromJson(result['List'][0]),
+ this.sharedPref.setObject(USER_PROFILE, result.list),
+ this.loginTokenID = result.logInTokenID,
+ this
+ .sharedPref
+ .setObject(LOGIN_TOKEN_ID, result.logInTokenID),
+ this
+ .sharedPref
+ .setString(TOKEN, result.authenticationTokenID),
+ this.checkIfUserAgreedBefore(result),
// Navigator.of(context).pop(),
SMSOTP.showLoadingDialog(context, false),
- Future.delayed(Duration(seconds: 1), () {
- AppToast.showErrorToast(message: result);
- }),
}
- });
+ }
+ else
+ {
+ // Navigator.of(context).pop(),
+ SMSOTP.showLoadingDialog(context, false),
+ Future.delayed(Duration(seconds: 1), () {
+ AppToast.showErrorToast(message: result);
+ }),
+ }
+ });
}
checkIfUserAgreedBefore(CheckActivationCode result) {
@@ -540,7 +525,7 @@ class _ConfirmLogin extends State {
}
insertIMEI() {
- authService.insertDeviceImei().then((value) => {goToHome()});
+ authService.insertDeviceImei(selectedOption).then((value) => {goToHome()});
}
goToHome() {
diff --git a/lib/pages/medical/doctor/doctor_profile_page.dart b/lib/pages/medical/doctor/doctor_profile_page.dart
index 79f8c69e..2b19ba3d 100644
--- a/lib/pages/medical/doctor/doctor_profile_page.dart
+++ b/lib/pages/medical/doctor/doctor_profile_page.dart
@@ -20,7 +20,7 @@ class DoctorProfilePage extends StatefulWidget {
}
class _DoctorProfilePageState extends State
- with SingleTickerProviderStateMixin {
+ with TickerProviderStateMixin {
TabController _tabController;
final PatientDoctorAppointment patientDoctorAppointment;
@@ -61,10 +61,9 @@ class _DoctorProfilePageState extends State
margin: EdgeInsets.all(5),
width: 50,
height: 50,
- decoration:
- BoxDecoration(shape: BoxShape.circle,
- color: Colors.grey
- ),
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ color: Colors.grey),
child: Icon(
Icons.calendar_view_day,
size: 25,
@@ -82,10 +81,9 @@ class _DoctorProfilePageState extends State
margin: EdgeInsets.all(5),
width: 50,
height: 50,
- decoration:
- BoxDecoration(shape: BoxShape.circle,
- color: Colors.grey
- ),
+ decoration: BoxDecoration(
+ shape: BoxShape.circle,
+ color: Colors.grey),
child: Icon(
Icons.format_list_bulleted,
size: 25,
@@ -151,8 +149,7 @@ class _DoctorProfilePageState extends State
indicatorWeight: 3.0,
tabs: [
Tab(
- child: Text(
- 'Doctor Information',
+ child: Text('Doctor Information',
style: TextStyle(color: Colors.black))),
Tab(
child: Text(
@@ -166,7 +163,12 @@ class _DoctorProfilePageState extends State
height: MediaQuery.of(context).size.height * 0.8,
child: TabBarView(
physics: BouncingScrollPhysics(),
- children: [DoctorInformation(doctorProfile: model.doctorProfile,), Container()],
+ children: [
+ DoctorInformation(
+ doctorProfile: model.doctorProfile,
+ ),
+ Container()
+ ],
controller: _tabController,
),
),
diff --git a/lib/routes.dart b/lib/routes.dart
index b1f216e8..27161669 100644
--- a/lib/routes.dart
+++ b/lib/routes.dart
@@ -8,6 +8,8 @@ import 'package:diplomaticquarterapp/pages/login/welcome.dart';
import 'package:diplomaticquarterapp/pages/login/login-type.dart';
import 'package:diplomaticquarterapp/pages/login/login.dart';
import 'package:diplomaticquarterapp/pages/login/register.dart';
+import 'package:diplomaticquarterapp/pages/family/add-family_type.dart';
+import 'package:diplomaticquarterapp/pages/family/add-family-member.dart';
const String INIT_ROUTE = '/';
const String HOME = '/';
@@ -20,6 +22,8 @@ const String REGISTER = 'register';
const String CONFIRM_LOGIN = 'confrim-login';
const String REGISTER_INFO = 'register-info';
const String MY_FAMILIY = 'my-family';
+const String ADD_FAMILY_MEMBER_TYPE = 'add-family-member-type';
+const String ADD_FAMILY_MEMBER = 'add-family-member';
const String LIVE_CARE = 'live-care';
var routes = {
HOME: (_) => LandingPage(),
@@ -31,5 +35,7 @@ var routes = {
CONFIRM_LOGIN: (_) => ConfirmLogin(),
REGISTER_INFO: (_) => RegisterInfo(),
MY_FAMILIY: (_) => MyFamily(),
+ ADD_FAMILY_MEMBER_TYPE: (_) => AddFamilyMemberType(),
+ ADD_FAMILY_MEMBER: (_) => AddMember(),
LIVE_CARE: (_) => LiveCareHome()
};
diff --git a/lib/services/appointment_services/GetDoctorsList.dart b/lib/services/appointment_services/GetDoctorsList.dart
index 6e6f804e..ba3ad56e 100644
--- a/lib/services/appointment_services/GetDoctorsList.dart
+++ b/lib/services/appointment_services/GetDoctorsList.dart
@@ -10,6 +10,7 @@ import 'package:diplomaticquarterapp/models/Request.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
+import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:flutter/cupertino.dart';
class DoctorsListService extends BaseService {
@@ -19,8 +20,9 @@ class DoctorsListService extends BaseService {
AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider();
- Future