Merge branch 'development' into Haroon

# Conflicts:
#	lib/config/config.dart
#	lib/config/localized_values.dart
#	lib/pages/feedback/send_feedback_page.dart
#	lib/pages/landing/home_page.dart
#	lib/uitl/translations_delegate_base.dart
#	lib/widgets/in_app_browser/InAppBrowser.dart
merge-requests/335/head
Haroon Amjad 5 years ago
commit 47e521fe1d

@ -40,7 +40,7 @@ android {
defaultConfig { defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
// applicationId "com.cloud.diplomaticquarterapp" // applicationId "com.cloud.diplomaticquarterapp"
applicationId "com.ejada.hmg" applicationId "com.ejada.hmg.uat"
minSdkVersion 21 minSdkVersion 21
targetSdkVersion 30 targetSdkVersion 30
versionCode flutterVersionCode.toInteger() versionCode flutterVersionCode.toInteger()

@ -10,7 +10,7 @@
"client_info": { "client_info": {
"mobilesdk_app_id": "1:815750722565:android:62281cd3e5df4063", "mobilesdk_app_id": "1:815750722565:android:62281cd3e5df4063",
"android_client_info": { "android_client_info": {
"package_name": "com.ejada.hmg" "package_name": "com.ejada.hmg.uat"
} }
}, },
"oauth_client": [ "oauth_client": [

@ -5,6 +5,7 @@
In most cases you can leave this as-is, but you if you want to provide In most cases you can leave this as-is, but you if you want to provide
additional functionality it is fine to subclass or reimplement additional functionality it is fine to subclass or reimplement
FlutterApplication and put your custom class here. --> FlutterApplication and put your custom class here. -->
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" /> <uses-permission android:name="android.permission.ACCESS_BACKGROUND_LOCATION" />
@ -29,7 +30,11 @@
<!-- Detect Reboot Permission --> <!-- Detect Reboot Permission -->
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/> <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
<queries>
<intent>
<action android:name="android.speech.RecognitionService" />
</intent>
</queries>
<application <application
android:name="io.flutter.app.FlutterApplication" android:name="io.flutter.app.FlutterApplication"
android:icon="@mipmap/ic_launcher" android:icon="@mipmap/ic_launcher"
@ -109,4 +114,7 @@
<uses-permission android:name="android.permission.USE_FINGERPRINT" /> <uses-permission android:name="android.permission.USE_FINGERPRINT" />
<uses-permission android:name="android.permission.READ_CALENDAR" /> <uses-permission android:name="android.permission.READ_CALENDAR" />
<uses-permission android:name="android.permission.WRITE_CALENDAR" /> <uses-permission android:name="android.permission.WRITE_CALENDAR" />
</manifest> </manifest>

@ -9,7 +9,7 @@ buildscript {
} }
dependencies { dependencies {
classpath 'com.android.tools.build:gradle:3.5.0' classpath 'com.android.tools.build:gradle:3.5.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.8' classpath 'com.google.gms:google-services:4.3.8'
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="18" height="18" viewBox="0 0 18 18">
<g id="Group_1261" data-name="Group 1261" transform="translate(-148.52 -172.52)">
<path id="Path_1724" data-name="Path 1724" d="M9,0a9,9,0,0,1,9,9,9.18,9.18,0,0,1-1.863,5.483A8.844,8.844,0,0,1,9,18,9,9,0,0,1,9,0Z" transform="translate(148.52 172.52)" fill="#e6b71b"/>
<path id="hourglass_2_" data-name="hourglass (2)" d="M10.865,10.178H10.4V8.663a2.662,2.662,0,0,0-.88-1.977l-.783-.7a.578.578,0,0,1,0-.86l.783-.7a2.665,2.665,0,0,0,.88-1.978V.925h.463a.463.463,0,0,0,0-.925h-7.4a.463.463,0,0,0,0,.925h.463V2.439a2.662,2.662,0,0,0,.88,1.977l.783.7a.578.578,0,0,1,0,.86l-.783.7a2.665,2.665,0,0,0-.88,1.978v1.514H3.463a.463.463,0,1,0,0,.925h7.4a.463.463,0,0,0,0-.925ZM5.313,8.711a1.264,1.264,0,0,1,.373-.9L6.918,6.578a.347.347,0,0,1,.491,0L8.642,7.811a1.264,1.264,0,0,1,.373.9v1.467h-3.7Z" transform="translate(150.356 175.968)" fill="#fff"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 947 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

@ -3,6 +3,7 @@
# CocoaPods analytics sends network stats synchronously affecting flutter build latency. # CocoaPods analytics sends network stats synchronously affecting flutter build latency.
ENV['COCOAPODS_DISABLE_STATS'] = 'true' ENV['COCOAPODS_DISABLE_STATS'] = 'true'
$FirebaseAnalyticsWithoutAdIdSupport = true
project 'Runner', { project 'Runner', {
'Debug' => :debug, 'Debug' => :debug,

@ -0,0 +1,69 @@
import 'package:diplomaticquarterapp/uitl/utils.dart';
class _Event{
String name;
String description;
bool active;
_Event(dynamic map){
name = map['name'];
description = map['description'];
active = map['active'];
}
flutterName() => 'f: $name';
}
class AnalyticEvents{
static _Event get(String key) {
var e = _Event(mapping[key]);
if(e == null){
var label = labelFrom(className: key); // Convert Class Name in to Label (HomeCare -> Home Care)
e = _Event({"name": label, "active":true, "description":key});
}
return e;
}
static var mapping = const {
"HomeHealthCarePage" : {
"active" : true,
"name" : "Home Health Care Page",
"description" : "",
},
"SplashScreen" : {
"active" : true,
"name" : "Splash Screen",
"description" : "",
},
"LandingPage" : {
"active" : true,
"name" : "Landing Page",
"description" : "",
},
"WelcomeLogin" : {
"active" : true,
"name" : "Welcome Login",
"description" : "",
},
"LoginType" : {
"active" : true,
"name" : "Login Type",
"description" : "",
},
"Login" : {
"active" : true,
"name" : "Login",
"description" : "",
},
"ForgotPassword" : {
"active" : true,
"name" : "Forgot Password",
"description" : "",
},
"" : {
"active" : true,
"name" : "",
"description" : "",
},
};
}

@ -0,0 +1,85 @@
import 'package:diplomaticquarterapp/analytics/analytic-events.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:firebase_analytics/observer.dart';
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
class Singleton {
const Singleton(); //Constant constructor
void hello() { print('Hello world'); }
}
var analytics = FirebaseAnalytics();
class GAnalytics{
const GAnalytics();
static GAnalytics shared = const GAnalytics();
NavObserver navObserver() => NavObserver();
}
// adb shell setprop debug.firebase.analytics.app com.ejada.hmg -> Android
class NavObserver extends RouteObserver<PageRoute<dynamic>>{
_sendScreenView(PageRoute route) async{
log(String className){
var event = AnalyticEvents.get(className);
if(event.active){
analytics.setCurrentScreen(screenName: event.flutterName(), screenClassOverride: className).catchError( (Object error) {
debugPrint('$FirebaseAnalyticsObserver: $error');
},
test: (Object error) {
return error is PlatformException;
},
);
}
}
if(route.settings.name != null && route.settings.name.isNotEmpty && route.settings.name != "null"){
var class_ = routes[route.settings.name](0);
if(class_ != null)
log(class_.toStringShort());
}else if(route is FadePage){
var class_ = route.page;
if(class_ != null)
log(class_.toStringShort());
}else if(route is MaterialPageRoute){
var class_ = route.builder(null);
if (class_ != null)
log(class_.toStringShort());
}else{
print("");
}
}
@override
void didPush(Route<dynamic> route, Route<dynamic> previousRoute) {
super.didPush(route, previousRoute);
if (route is PageRoute) {
_sendScreenView(route);
}
}
@override
void didReplace({Route<dynamic> newRoute, Route<dynamic> oldRoute}) {
super.didReplace(newRoute: newRoute, oldRoute: oldRoute);
if (newRoute is PageRoute) {
_sendScreenView(newRoute);
}
}
@override
void didPop(Route<dynamic> route, Route<dynamic> previousRoute) {
super.didPop(route, previousRoute);
// if (previousRoute is PageRoute && route is PageRoute) {
// _sendScreenView(previousRoute);
// }
}
}

@ -17,12 +17,12 @@ const BASE_URL = 'https://uat.hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/'; // const BASE_URL = 'https://hmgwebservices.com/';
// Pharmacy UAT URLs // Pharmacy UAT URLs
//const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; const BASE_PHARMACY_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
//const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/'; const PHARMACY_BASE_URL = 'https://uat.hmgwebservices.com/epharmacy/api/';
// Pharmacy Production URLs // Pharmacy Production URLs
const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/'; //const BASE_PHARMACY_URL = 'https://mdlaboratories.com/exacartapi/api/';
const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/'; //const PHARMACY_BASE_URL = 'https://mdlaboratories.com/exacartapi/api/';
const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity'; const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity';
@ -33,8 +33,7 @@ const GET_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_GetAllPoints';
const LOG_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_InsertPatientFileInfo'; const LOG_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_InsertPatientFileInfo';
// Delivery Driver // Delivery Driver
const DRIVER_LOCATION = const DRIVER_LOCATION = 'Services/Patients.svc/REST/PatientER_GetDriverLocation';
'Services/Patients.svc/REST/PatientER_GetDriverLocation';
//weather //weather
const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo'; const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo';
@ -42,51 +41,36 @@ const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo';
const GET_PRIVILEGE = 'Services/Patients.svc/REST/Service_Privilege'; const GET_PRIVILEGE = 'Services/Patients.svc/REST/Service_Privilege';
// Wifi Credentials // Wifi Credentials
const WIFI_CREDENTIALS = const WIFI_CREDENTIALS = "Services/Patients.svc/Hmg_SMS_Get_By_ProjectID_And_PatientID";
"Services/Patients.svc/Hmg_SMS_Get_By_ProjectID_And_PatientID";
///Doctor ///Doctor
const GET_MY_DOCTOR = const GET_MY_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles'; const GET_DOCTOR_PROFILE = 'Services/Doctors.svc/REST/GetDocProfiles';
const GET_DOCTOR_RATING_NOTES = const GET_DOCTOR_RATING_NOTES = 'Services/Doctors.svc/REST/dr_GetNotesDoctorRating';
'Services/Doctors.svc/REST/dr_GetNotesDoctorRating'; const GET_DOCTOR_RATING_DETAILS = 'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails';
const GET_DOCTOR_RATING_DETAILS =
'Services/Doctors.svc/REST/dr_GetDoctorRatingDetails';
const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating'; const GET_DOCTOR_RATING = 'Services/Doctors.svc/REST/dr_GetAvgDoctorRating';
///Prescriptions ///Prescriptions
const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList'; const PRESCRIPTIONS = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_PRESCRIPTIONS_ALL_ORDERS = const GET_PRESCRIPTIONS_ALL_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; const GET_PRESCRIPTION_REPORT = 'Services/Patients.svc/REST/INP_GetPrescriptionReport';
const GET_PRESCRIPTION_REPORT = const SEND_PRESCRIPTION_EMAIL = 'Services/Notifications.svc/REST/SendPrescriptionEmail';
'Services/Patients.svc/REST/INP_GetPrescriptionReport'; const GET_PRESCRIPTION_REPORT_ENH = 'Services/Patients.svc/REST/GetPrescriptionReport_enh';
const SEND_PRESCRIPTION_EMAIL =
'Services/Notifications.svc/REST/SendPrescriptionEmail';
const GET_PRESCRIPTION_REPORT_ENH =
'Services/Patients.svc/REST/GetPrescriptionReport_enh';
///Lab Order ///Lab Order
const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders'; const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders';
const GET_Patient_LAB_SPECIAL_RESULT = const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults';
'Services/Patients.svc/REST/GetPatientLabSpecialResults'; const SEND_LAB_RESULT_EMAIL = 'Services/Notifications.svc/REST/SendLabReportEmail';
const SEND_LAB_RESULT_EMAIL = const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults';
'Services/Notifications.svc/REST/SendLabReportEmail'; const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults';
const GET_Patient_LAB_RESULT =
'Services/Patients.svc/REST/GetPatientLabResults';
const GET_Patient_LAB_ORDERS_RESULT =
'Services/Patients.svc/REST/GetPatientLabOrdersResults';
/// ///
const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders';
const GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = const GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT = 'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo';
'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo';
const GET_PATIENT_ORDERS_DETAILS = const GET_PATIENT_ORDERS_DETAILS = 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead';
'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead';
const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL'; const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL';
const SEND_RAD_REPORT_EMAIL = const SEND_RAD_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendRadReportEmail';
'Services/Notifications.svc/REST/SendRadReportEmail';
///Feedback ///Feedback
const SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList'; const SEND_FEEDBACK = 'Services/COCWS.svc/REST/InsertCOCItemInSPList';
@ -95,32 +79,23 @@ const GET_PATIENT_AppointmentHistory = 'Services'
'/Doctors.svc/REST/PateintHasAppoimentHistory'; '/Doctors.svc/REST/PateintHasAppoimentHistory';
///VITAL SIGN ///VITAL SIGN
const GET_PATIENT_VITAL_SIGN = const GET_PATIENT_VITAL_SIGN = 'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign';
'Services/Doctors.svc/REST/Doctor_GetPatientVitalSign';
///Er Nearest ///Er Nearest
const GET_NEAREST_HOSPITAL = const GET_NEAREST_HOSPITAL = 'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime';
'Services/Patients.svc/REST/Patient_GetProjectAvgERWaitingTime';
///ED Online ///ED Online
const ER_GET_VISUAL_TRIAGE_QUESTIONS = const ER_GET_VISUAL_TRIAGE_QUESTIONS = "services/Doctors.svc/REST/ER_GetVisualTriageQuestions";
"services/Doctors.svc/REST/ER_GetVisualTriageQuestions"; const ER_SAVE_TRIAGE_INFORMATION = "services/Doctors.svc/REST/ER_SaveTriageInformation";
const ER_SAVE_TRIAGE_INFORMATION =
"services/Doctors.svc/REST/ER_SaveTriageInformation";
const ER_GetPatientPaymentInformationForERClinic = const ER_GetPatientPaymentInformationForERClinic =
"services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic"; "services/Doctors.svc/REST/ER_GetPatientPaymentInformationForERClinic";
///Er Nearest ///Er Nearest
const GET_AMBULANCE_REQUEST = const GET_AMBULANCE_REQUEST = 'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod';
'Services/Patients.svc/REST/PatientER_RRT_GetAllTransportationMethod'; const GET_PATIENT_ALL_PRES_ORDERS = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
const GET_PATIENT_ALL_PRES_ORDERS = const GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID = 'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID';
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; const UPDATE_PRESS_ORDER = 'Services/Patients.svc/REST/PatientER_UpdatePresOrder';
const GET_PICK_UP_REQUEST_BY_PRES_ORDER_ID = const INSERT_ER_INERT_PRES_ORDER = 'Services/Patients.svc/REST/PatientER_InsertPresOrder';
'Services/Patients.svc/REST/PatientER_RRT_GetPickUpRequestByPresOrderID';
const UPDATE_PRESS_ORDER =
'Services/Patients.svc/REST/PatientER_UpdatePresOrder';
const INSERT_ER_INERT_PRES_ORDER =
'Services/Patients.svc/REST/PatientER_InsertPresOrder';
///FindUs ///FindUs
const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations'; const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations';
@ -129,15 +104,13 @@ const GET_FINDUS_REQUEST = 'Services/Lists.svc/REST/Get_HMG_Locations';
const GET_LIVECHAT_REQUEST = 'Services/Patients.svc/REST/GetPatientICProjects'; const GET_LIVECHAT_REQUEST = 'Services/Patients.svc/REST/GetPatientICProjects';
///babyInformation ///babyInformation
const GET_BABYINFORMATION_REQUEST = const GET_BABYINFORMATION_REQUEST = 'Services/Community.svc/REST/GetBabyByUserID';
'Services/Community.svc/REST/GetBabyByUserID';
///Get Baby By User ID ///Get Baby By User ID
const GET_BABY_BY_USER_ID = 'Services/Community.svc/REST/GetBabyByUserID'; const GET_BABY_BY_USER_ID = 'Services/Community.svc/REST/GetBabyByUserID';
///userInformation ///userInformation
const GET_USERINFORMATION_REQUEST = const GET_USERINFORMATION_REQUEST = 'Services/Community.svc/REST/GetUserInformation_New';
'Services/Community.svc/REST/GetUserInformation_New';
///Update email ///Update email
const UPDATE_PATENT_EMAIL = 'Services/Patients.svc/REST/UpdatePateintEmail'; const UPDATE_PATENT_EMAIL = 'Services/Patients.svc/REST/UpdatePateintEmail';
@ -159,29 +132,21 @@ const GET_TABLE_REQUEST = 'Services/Community.svc/REST/CreateVaccinationTable';
const GET_CITIES_REQUEST = 'Services/Lists.svc/REST/GetAllCities'; const GET_CITIES_REQUEST = 'Services/Lists.svc/REST/GetAllCities';
///BloodDetails ///BloodDetails
const GET_BLOOD_REQUEST = const GET_BLOOD_REQUEST = 'services/PatientVarification.svc/REST/BloodDonation_GetBloodGroupDetails';
'services/PatientVarification.svc/REST/BloodDonation_GetBloodGroupDetails';
const SAVE_BLOOD_REQUEST = const SAVE_BLOOD_REQUEST = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType';
'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType';
const GET_BLOOD_AGREEMENT = const GET_BLOOD_AGREEMENT = 'Services/PatientVarification.svc/REST/CheckUserAgreementForBloodDonation';
'Services/PatientVarification.svc/REST/CheckUserAgreementForBloodDonation'; const SAVE_BLOOD_AGREEMENT = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation';
const SAVE_BLOOD_AGREEMENT =
'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation';
///Reports ///Reports
const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo'; const REPORTS = 'Services/Doctors.svc/REST/GetPatientMedicalReportStatusInfo';
const INSERT_REQUEST_FOR_MEDICAL_REPORT = const INSERT_REQUEST_FOR_MEDICAL_REPORT = 'Services/Doctors.svc/REST/InsertRequestForMedicalReport';
'Services/Doctors.svc/REST/InsertRequestForMedicalReport'; const SEND_MEDICAL_REPORT_EMAIL = 'Services/Notifications.svc/REST/SendMedicalReportEmail';
const SEND_MEDICAL_REPORT_EMAIL =
'Services/Notifications.svc/REST/SendMedicalReportEmail';
///Rate ///Rate
const IS_LAST_APPOITMENT_RATED = const IS_LAST_APPOITMENT_RATED = 'Services/Doctors.svc/REST/IsLastAppoitmentRated';
'Services/Doctors.svc/REST/IsLastAppoitmentRated'; const GET_APPOINTMENT_DETAILS_BY_NO = 'Services/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo';
const GET_APPOINTMENT_DETAILS_BY_NO =
'Services/MobileNotifications.svc/REST/GetAppointmentDetailsByApptNo';
const GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID'; const GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID';
@ -193,8 +158,7 @@ const GET_QR_PARKING = 'Services/SWP.svc/REST/GetQRParkingByID';
const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized"; const GET_CLINICS_LIST_URL = "Services/lists.svc/REST/GetClinicCentralized";
//URL to get active appointment list //URL to get active appointment list
const GET_ACTIVE_APPOINTMENTS_LIST_URL = const GET_ACTIVE_APPOINTMENTS_LIST_URL = "Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber";
"Services/Doctors.svc/Rest/Dr_GetAppointmentActiveNumber";
//URL to get projects list //URL to get projects list
const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject'; const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject';
@ -203,115 +167,87 @@ const GET_PROJECTS_LIST = 'Services/Lists.svc/REST/GetProject';
const GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime"; const GET_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/SearchDoctorsByTime";
//URL to dental doctors list //URL to dental doctors list
const GET_DENTAL_DOCTORS_LIST_URL = const GET_DENTAL_DOCTORS_LIST_URL = "Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping";
"Services/Doctors.svc/REST/Dental_DoctorChiefComplaintMapping";
//URL to get doctor free slots //URL to get doctor free slots
const GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots"; const GET_DOCTOR_FREE_SLOTS = "Services/Doctors.svc/REST/GetDoctorFreeSlots";
//URL to insert appointment //URL to insert appointment
const INSERT_SPECIFIC_APPOINTMENT = const INSERT_SPECIFIC_APPOINTMENT = "Services/Doctors.svc/REST/InsertSpecificAppointment";
"Services/Doctors.svc/REST/InsertSpecificAppointment";
//URL to get patient share //URL to get patient share
const GET_PATIENT_SHARE = const GET_PATIENT_SHARE = "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO";
"Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNO";
//URL to get patient appointment history //URL to get patient appointment history
const GET_PATIENT_APPOINTMENT_HISTORY = const GET_PATIENT_APPOINTMENT_HISTORY = "Services/Doctors.svc/REST/PateintHasAppoimentHistory";
"Services/Doctors.svc/REST/PateintHasAppoimentHistory";
const SEND_REPORT_EYE_EMAIL = const SEND_REPORT_EYE_EMAIL = "Services/Notifications.svc/REST/SendGlassesPrescriptionEmail";
"Services/Notifications.svc/REST/SendGlassesPrescriptionEmail";
const SEND_CONTACT_LENS_PRESCRIPTION_EMAIL = const SEND_CONTACT_LENS_PRESCRIPTION_EMAIL = "Services/Notifications.svc/REST/SendContactLensPrescriptionEmail";
"Services/Notifications.svc/REST/SendContactLensPrescriptionEmail";
//URL to get patient appointment curfew history //URL to get patient appointment curfew history
const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = const GET_PATIENT_APPOINTMENT_CURFEW_HISTORY = "Services/Doctors.svc/REST/AppoimentHistoryForCurfew";
"Services/Doctors.svc/REST/AppoimentHistoryForCurfew";
//URL to confirm appointment //URL to confirm appointment
const CONFIRM_APPOINTMENT = const CONFIRM_APPOINTMENT = "Services/MobileNotifications.svc/REST/ConfirmAppointment";
"Services/MobileNotifications.svc/REST/ConfirmAppointment";
const INSERT_VIDA_REQUEST = const INSERT_VIDA_REQUEST = "Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart";
"Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart";
//URL to cancel appointment //URL to cancel appointment
const CANCEL_APPOINTMENT = "Services/Doctors.svc/REST/CancelAppointment"; const CANCEL_APPOINTMENT = "Services/Doctors.svc/REST/CancelAppointment";
//URL get appointment QR //URL get appointment QR
const GENERATE_QR_APPOINTMENT = const GENERATE_QR_APPOINTMENT = "Services/Doctors.svc/REST/GenerateQRAppointmentNo";
"Services/Doctors.svc/REST/GenerateQRAppointmentNo";
//URL send email appointment QR //URL send email appointment QR
const EMAIL_QR_APPOINTMENT = const EMAIL_QR_APPOINTMENT = "Services/Notifications.svc/REST/sendEmailForOnLineCheckin";
"Services/Notifications.svc/REST/sendEmailForOnLineCheckin";
//URL check payment status //URL check payment status
const CHECK_PAYMENT_STATUS = const CHECK_PAYMENT_STATUS = "Services/PayFort_Serv.svc/REST/GetRequestStatusByRequestID";
"Services/PayFort_Serv.svc/REST/GetRequestStatusByRequestID";
//URL create advance payment //URL create advance payment
const CREATE_ADVANCE_PAYMENT = "Services/Doctors.svc/REST/CreateAdvancePayment"; const CREATE_ADVANCE_PAYMENT = "Services/Doctors.svc/REST/CreateAdvancePayment";
const HIS_CREATE_ADVANCE_PAYMENT = const HIS_CREATE_ADVANCE_PAYMENT = "Services/Patients.svc/REST/HIS_CreateAdvancePayment";
"Services/Patients.svc/REST/HIS_CreateAdvancePayment";
const ADD_ADVANCE_NUMBER_REQUEST = const ADD_ADVANCE_NUMBER_REQUEST = 'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest';
'Services/PayFort_Serv.svc/REST/AddAdvancedNumberRequest';
const IS_ALLOW_ASK_DOCTOR = const IS_ALLOW_ASK_DOCTOR = 'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult'; const GET_CALL_REQUEST_TYPE = 'Services/Doctors.svc/REST/GetCallRequestType_LOV';
const GET_CALL_REQUEST_TYPE = const ADD_VIDA_REQUEST = 'Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart';
'Services/Doctors.svc/REST/GetCallRequestType_LOV';
const ADD_VIDA_REQUEST =
'Services/ER_VirtualCall.svc/REST/PatientER_VidaRequestInseart';
const SEND_CALL_REQUEST = 'Services/Doctors.svc/REST/InsertCallInfo'; const SEND_CALL_REQUEST = 'Services/Doctors.svc/REST/InsertCallInfo';
const GET_LIVECARE_CLINICS = const GET_LIVECARE_CLINICS = 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics';
'Services/ER_VirtualCall.svc/REST/PatientER_GetClinics';
const GET_LIVECARE_SCHEDULE_CLINICS = const GET_LIVECARE_SCHEDULE_CLINICS = 'Services/Doctors.svc/REST/PatientER_GetClinicsHaveSchedule';
'Services/Doctors.svc/REST/PatientER_GetClinicsHaveSchedule';
const GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST = const GET_LIVECARE_SCHEDULE_CLINIC_DOCTOR_LIST = 'Services/Doctors.svc/REST/PatientER_GetDoctorByClinicID';
'Services/Doctors.svc/REST/PatientER_GetDoctorByClinicID';
const GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS = const GET_LIVECARE_SCHEDULE_DOCTOR_TIME_SLOTS = 'Services/Doctors.svc/REST/PatientER_GetDoctorFreeSlots';
'Services/Doctors.svc/REST/PatientER_GetDoctorFreeSlots';
const INSERT_LIVECARE_SCHEDULE_APPOINTMENT = const INSERT_LIVECARE_SCHEDULE_APPOINTMENT = 'Services/Doctors.svc/REST/InsertSpecificAppoitmentForSchedule';
'Services/Doctors.svc/REST/InsertSpecificAppoitmentForSchedule';
const GET_PATIENT_SHARE_LIVECARE = const GET_PATIENT_SHARE_LIVECARE =
"Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNOForLiveCare"; "Services/Doctors.svc/REST/GetCheckinScreenAppointmentDetailsByAppointmentNOForLiveCare";
const GET_LIVECARE_CLINIC_TIMING = const GET_LIVECARE_CLINIC_TIMING = 'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule';
'Services/ER_VirtualCall.svc/REST/PatientER_GetClinicsServiceTimingsSchedule';
const GET_ER_APPOINTMENT_FEES = const GET_ER_APPOINTMENT_FEES = 'Services/DoctorApplication.svc/REST/GetERAppointmentFees';
'Services/DoctorApplication.svc/REST/GetERAppointmentFees';
const GET_ER_APPOINTMENT_TIME = 'Services/ER_VirtualCall.svc/REST/GetRestTime'; const GET_ER_APPOINTMENT_TIME = 'Services/ER_VirtualCall.svc/REST/GetRestTime';
const ADD_NEW_CALL_FOR_PATIENT_ER = const ADD_NEW_CALL_FOR_PATIENT_ER = 'Services/DoctorApplication.svc/REST/NewCallForPatientER';
'Services/DoctorApplication.svc/REST/NewCallForPatientER';
const GET_LIVECARE_HISTORY = const GET_LIVECARE_HISTORY = 'Services/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory';
'Services/ER_VirtualCall.svc/REST/GetPatientErVirtualHistory'; const CANCEL_LIVECARE_REQUEST = 'Services/ER_VirtualCall.svc/REST/DeleteErRequest';
const CANCEL_LIVECARE_REQUEST = const SEND_LIVECARE_INVOICE_EMAIL = 'Services/Notifications.svc/REST/SendInvoiceForLiveCare';
'Services/ER_VirtualCall.svc/REST/DeleteErRequest';
const SEND_LIVECARE_INVOICE_EMAIL =
'Services/Notifications.svc/REST/SendInvoiceForLiveCare';
const GET_USER_TERMS = 'Services/Patients.svc/REST/GetUserTermsAndConditions'; const GET_USER_TERMS = 'Services/Patients.svc/REST/GetUserTermsAndConditions';
const UPDATE_HEALTH_TERMS = const UPDATE_HEALTH_TERMS = 'services/Patients.svc/REST/UpdatePateintHealthSummaryReport';
'services/Patients.svc/REST/UpdatePateintHealthSummaryReport';
const GET_PATIENT_HEALTH_STATS = const GET_PATIENT_HEALTH_STATS = 'Services/Patients.svc/REST/Med_GetTransactionsSts';
'Services/Patients.svc/REST/Med_GetTransactionsSts';
const SEND_CHECK_IN_NFC_REQUEST = 'Services/Patients.svc/REST/Patient_CheckAppointmentValidation_ForNFC';
//URL to get medicine and pharmacies list //URL to get medicine and pharmacies list
const CHANNEL = 3; const CHANNEL = 3;
@ -332,21 +268,16 @@ var DeviceTypeID = Platform.isIOS ? 1 : 2;
const LANGUAGE_ID = 2; const LANGUAGE_ID = 2;
const GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region"; const GET_PHARMCY_ITEMS = "Services/Lists.svc/REST/GetPharmcyItems_Region";
const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList"; const GET_PHARMACY_LIST = "Services/Patients.svc/REST/GetPharmcyList";
const GET_PAtIENTS_INSURANCE = const GET_PAtIENTS_INSURANCE = "Services/Patients.svc/REST/Get_PatientInsuranceDetails";
"Services/Patients.svc/REST/Get_PatientInsuranceDetails"; const GET_PAtIENTS_INSURANCE_UPDATED = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory";
const GET_PAtIENTS_INSURANCE_UPDATED =
"Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory";
const INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList"; const INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList";
const GET_PATIENT_INSURANCE_DETAILS = const GET_PATIENT_INSURANCE_DETAILS = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails";
"Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails"; const UPLOAD_INSURANCE_CARD = 'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate';
const UPLOAD_INSURANCE_CARD =
'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate';
const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID"; const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID";
const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail"; const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail";
const GET_PAtIENTS_INSURANCE_APPROVALS = const GET_PAtIENTS_INSURANCE_APPROVALS = "Services/Patients.svc/REST/GetApprovalStatus";
"Services/Patients.svc/REST/GetApprovalStatus";
const SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse'; const SEARCH_BOT = 'HabibiChatBotApi/BotInterface/GetVoiceCommandResponse';
const GET_VACCINATIONS_ITEMS = "/Services/ERP.svc/REST/GET_VACCINATIONS_ITEMS"; const GET_VACCINATIONS_ITEMS = "/Services/ERP.svc/REST/GET_VACCINATIONS_ITEMS";
@ -356,84 +287,57 @@ const GET_PATIENT_SICK_LEAVE = 'Services/Patients.svc/REST/GetPatientSickLeave';
const SendSickLeaveEmail = 'Services/Notifications.svc/REST/SendSickLeaveEmail'; const SendSickLeaveEmail = 'Services/Notifications.svc/REST/SendSickLeaveEmail';
const GET_PATIENT_AdVANCE_BALANCE_AMOUNT = const GET_PATIENT_AdVANCE_BALANCE_AMOUNT = 'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount';
'Services/Patients.svc/REST/GetPatientAdvanceBalanceAmount'; const GET_PATIENT_INFO_BY_ID = 'Services/Doctors.svc/REST/GetPatientInfoByPatientID';
const GET_PATIENT_INFO_BY_ID =
'Services/Doctors.svc/REST/GetPatientInfoByPatientID';
const GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER = const GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER =
'Services/Patients.svc/REST/AP_GetPatientInfoByPatientIDandMobileNumber'; 'Services/Patients.svc/REST/AP_GetPatientInfoByPatientIDandMobileNumber';
const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = const SEND_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = 'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment';
'Services/Authentication.svc/REST/SendActivationCodeForAdvancePayment';
const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT = const CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT =
'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment'; 'Services/Authentication.svc/REST/CheckActivationCodeForAdvancePayment';
const GET_COVID_DRIVETHRU_PROJECT_LIST = const GET_COVID_DRIVETHRU_PROJECT_LIST = 'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter';
'Services/Doctors.svc/REST/COVID19_ProjectDriveThroughTestingCenter';
const GET_COVID_DRIVETHRU_PROCEDURES_LIST = const GET_COVID_DRIVETHRU_PAYMENT_INFO = 'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation';
'Services/Doctors.svc/REST/COVID19_GetTestProcedures';
const GET_COVID_DRIVETHRU_PAYMENT_INFO = const GET_COVID_DRIVETHRU_FREE_SLOTS = 'Services/Doctors.svc/REST/COVID19_GetFreeSlots';
'Services/Doctors.svc/REST/COVID19_GetPatientPaymentInormation';
const GET_COVID_DRIVETHRU_FREE_SLOTS = const GET_COVID_DRIVETHRU_PROCEDURES_LIST =
'Services/Doctors.svc/REST/COVID19_GetFreeSlots'; 'Services/Doctors.svc/REST/COVID19_GetTestProcedures';
///Smartwatch Integration Services ///Smartwatch Integration Services
const GET_PATIENT_LAST_RECORD = const GET_PATIENT_LAST_RECORD = 'Services/Patients.svc/REST/Med_GetPatientLastRecord';
'Services/Patients.svc/REST/Med_GetPatientLastRecord';
///My Trackers ///My Trackers
const GET_DIABETIC_RESULT_AVERAGE = const GET_DIABETIC_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage';
'Services/Patients.svc/REST/Patient_GetDiabeticResultAverage'; const GET_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_GetDiabtecResults';
const GET_DIABTEC_RESULT = const ADD_DIABTEC_RESULT = 'Services/Patients.svc/REST/Patient_AddDiabtecResult';
'Services/Patients.svc/REST/Patient_GetDiabtecResults';
const ADD_DIABTEC_RESULT = const GET_BLOOD_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage';
'Services/Patients.svc/REST/Patient_AddDiabtecResult'; const GET_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetBloodPressureResult';
const ADD_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddBloodPressureResult';
const GET_BLOOD_PRESSURE_RESULT_AVERAGE =
'Services/Patients.svc/REST/Patient_GetBloodPressureResultAverage'; const GET_WEIGHT_PRESSURE_RESULT_AVERAGE = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage';
const GET_BLOOD_PRESSURE_RESULT = const GET_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult';
'Services/Patients.svc/REST/Patient_GetBloodPressureResult'; const ADD_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult';
const ADD_BLOOD_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_AddBloodPressureResult';
const GET_WEIGHT_PRESSURE_RESULT_AVERAGE =
'Services/Patients.svc/REST/Patient_GetWeightMeasurementResultAverage';
const GET_WEIGHT_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_GetWeightMeasurementResult';
const ADD_WEIGHT_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_AddWeightMeasurementResult';
const ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID = const ADD_ACTIVE_PRESCRIPTIONS_REPORT_BY_PATIENT_ID =
'Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID'; 'Services/Patients.svc/Rest/GetActivePrescriptionReportByPatientID';
const GET_CALL_INFO_HOURS_RESULT = const GET_CALL_INFO_HOURS_RESULT = 'Services/Doctors.svc/REST/GetCallInfoHoursResult';
'Services/Doctors.svc/REST/GetCallInfoHoursResult'; const GET_CALL_REQUEST_TYPE_LOV = 'Services/Doctors.svc/REST/GetCallRequestType_LOV';
const GET_CALL_REQUEST_TYPE_LOV =
'Services/Doctors.svc/REST/GetCallRequestType_LOV'; const UPDATE_DIABETIC_RESULT = 'Services/Patients.svc/REST/Patient_UpdateDiabeticResult';
const UPDATE_DIABETIC_RESULT = const SEND_AVERAGE_BLOOD_SUGAR_REPORT = 'Services/Notifications.svc/REST/SendAverageBloodSugarReport';
'Services/Patients.svc/REST/Patient_UpdateDiabeticResult'; const DEACTIVATE_DIABETIC_STATUS = 'services/Patients.svc/REST/Patient_DeactivateDiabeticStatus';
const DEACTIVATE_BLOOD_PRESSURES_STATUS = 'services/Patients.svc/REST/Patient_DeactivateBloodPressureStatus';
const SEND_AVERAGE_BLOOD_SUGAR_REPORT =
'Services/Notifications.svc/REST/SendAverageBloodSugarReport'; const UPDATE_BLOOD_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateBloodPressureResult';
const DEACTIVATE_DIABETIC_STATUS = const SEND_AVERAGE_BLOOD_WEIGHT_REPORT = 'Services/Notifications.svc/REST/SendAverageBodyWeightReport';
'services/Patients.svc/REST/Patient_DeactivateDiabeticStatus'; const SEND_AVERAGE_BLOOD_PRESSURE_REPORT = 'Services/Notifications.svc/REST/SendAverageBloodPressureReport';
const DEACTIVATE_BLOOD_PRESSURES_STATUS =
'services/Patients.svc/REST/Patient_DeactivateBloodPressureStatus'; const UPDATE_WEIGHT_PRESSURE_RESULT = 'Services/Patients.svc/REST/Patient_UpdateWeightMeasurementResult';
const DEACTIVATE_WEIGHT_PRESSURE_RESULT = 'services/Patients.svc/REST/Patient_DeactivateWeightMeasurementStatus';
const UPDATE_BLOOD_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_UpdateBloodPressureResult';
const SEND_AVERAGE_BLOOD_WEIGHT_REPORT =
'Services/Notifications.svc/REST/SendAverageBodyWeightReport';
const SEND_AVERAGE_BLOOD_PRESSURE_REPORT =
'Services/Notifications.svc/REST/SendAverageBloodPressureReport';
const UPDATE_WEIGHT_PRESSURE_RESULT =
'Services/Patients.svc/REST/Patient_UpdateWeightMeasurementResult';
const DEACTIVATE_WEIGHT_PRESSURE_RESULT =
'services/Patients.svc/REST/Patient_DeactivateWeightMeasurementStatus';
const GET_DOCTOR_RESPONSE = 'Services/Patients.svc/REST/GetDoctorResponse'; const GET_DOCTOR_RESPONSE = 'Services/Patients.svc/REST/GetDoctorResponse';
const UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus'; const UPDATE_READ_STATUS = 'Services/Patients.svc/REST/UpdateReadStatus';
const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo'; const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo';
@ -441,35 +345,25 @@ const INSERT_CALL_INFO = 'Services/Doctors.svc/REST/InsertCallInfo';
const GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies'; const GET_PATIENT_ALLERGIES = 'Services/Patients.svc/REST/GetPatientAllergies';
// H2O // H2O
const H2O_GET_USER_PROGRESS = const H2O_GET_USER_PROGRESS = "Services/H2ORemainder.svc/REST/H2O_GetUserProgress";
"Services/H2ORemainder.svc/REST/H2O_GetUserProgress"; const H2O_INSERT_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2O_InsertUserActivity";
const H2O_INSERT_USER_ACTIVITY = const H2O_GET_USER_DETAIL = "Services/H2ORemainder.svc/REST/H2O_GetUserDetails_New";
"Services/H2ORemainder.svc/REST/H2O_InsertUserActivity"; const H2O_UPDATE_USER_DETAIL = "Services/H2ORemainder.svc/REST/H2O_UpdateUserDetails_New";
const H2O_GET_USER_DETAIL = const H2O_UNDO_USER_ACTIVITY = "Services/H2ORemainder.svc/REST/H2o_UndoUserActivity";
"Services/H2ORemainder.svc/REST/H2O_GetUserDetails_New";
const H2O_UPDATE_USER_DETAIL =
"Services/H2ORemainder.svc/REST/H2O_UpdateUserDetails_New";
const H2O_UNDO_USER_ACTIVITY =
"Services/H2ORemainder.svc/REST/H2o_UndoUserActivity";
//E_Referral Services //E_Referral Services
const GET_ALL_RELATIONSHIP_TYPES = const GET_ALL_RELATIONSHIP_TYPES = "Services/Patients.svc/REST/GetAllRelationshipTypes";
"Services/Patients.svc/REST/GetAllRelationshipTypes"; const SEND_ACTIVATION_CODE_FOR_E_REFERRAL = 'Services/Authentication.svc/REST/SendActivationCodeForEReferral';
const SEND_ACTIVATION_CODE_FOR_E_REFERRAL = const CHECK_ACTIVATION_CODE_FOR_E_REFERRAL = 'Services/Authentication.svc/REST/CheckActivationCodeForEReferral';
'Services/Authentication.svc/REST/SendActivationCodeForEReferral';
const CHECK_ACTIVATION_CODE_FOR_E_REFERRAL =
'Services/Authentication.svc/REST/CheckActivationCodeForEReferral';
const GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities'; const GET_ALL_CITIES = 'services/Lists.svc/rest/GetAllCities';
const CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral"; const CREATE_E_REFERRAL = "Services/Patients.svc/REST/CreateEReferral";
const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals"; const GET_E_REFERRALS = "Services/Patients.svc/REST/GetEReferrals";
// Encillary Orders // Encillary Orders
const GET_ANCILLARY_ORDERS = const GET_ANCILLARY_ORDERS = 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderList';
'Services/Doctors.svc/REST/GetOnlineAncillaryOrderList';
const GET_ANCILLARY_ORDERS_DETAILS = const GET_ANCILLARY_ORDERS_DETAILS = 'Services/Doctors.svc/REST/GetOnlineAncillaryOrderProcList';
'Services/Doctors.svc/REST/GetOnlineAncillaryOrderProcList';
//Pharmacy wishlist //Pharmacy wishlist
// const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/"; // const GET_WISHLIST = "http://swd-pharapp-01:7200/api/shopping_cart_items/";
@ -501,50 +395,34 @@ const GET_SHIPPING_OPTIONS = "get_shipping_option/";
const DELETE_SHOPPING_CART = "delete_shopping_cart_items/"; const DELETE_SHOPPING_CART = "delete_shopping_cart_items/";
const DELETE_SHOPPING_CART_ALL = "delete_shopping_cart_item_by_customer/"; const DELETE_SHOPPING_CART_ALL = "delete_shopping_cart_item_by_customer/";
const ORDER_SHOPPING_CART = "orders"; const ORDER_SHOPPING_CART = "orders";
const GET_LACUM_ACCOUNT_INFORMATION = const GET_LACUM_ACCOUNT_INFORMATION = "Services/Patients.svc/REST/GetLakumAccountInformation";
"Services/Patients.svc/REST/GetLakumAccountInformation"; const GET_LACUM_GROUP_INFORMATION = "Services/Patients.svc/REST/GetlakumInQueryInfoGrouping";
const GET_LACUM_GROUP_INFORMATION = const LACUM_ACCOUNT_ACTIVATE = "Services/Patients.svc/REST/LakumAccountActivation";
"Services/Patients.svc/REST/GetlakumInQueryInfoGrouping"; const LACUM_ACCOUNT_DEACTIVATE = "Services/Patients.svc/REST/LakumAccountDeactivation";
const LACUM_ACCOUNT_ACTIVATE = const CREATE_LAKUM_ACCOUNT = "Services/Patients.svc/REST/PHR_CreateLakumAccount";
"Services/Patients.svc/REST/LakumAccountActivation"; const TRANSFER_YAHALA_LOYALITY_POINTS = "Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints";
const LACUM_ACCOUNT_DEACTIVATE = const LAKUM_GET_USER_TERMS_AND_CONDITIONS = "Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy";
"Services/Patients.svc/REST/LakumAccountDeactivation";
const CREATE_LAKUM_ACCOUNT =
"Services/Patients.svc/REST/PHR_CreateLakumAccount";
const TRANSFER_YAHALA_LOYALITY_POINTS =
"Services/Patients.svc/REST/TransferYaHalaLoyaltyPoints";
const LAKUM_GET_USER_TERMS_AND_CONDITIONS =
"Services/ERP.svc/REST/GetUserTermsAndConditionsForEPharmcy";
const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList'; const PRESCRIPTION = 'Services/Patients.svc/REST/GetPrescriptionApptList';
const GET_RECOMMENDED_PRODUCT = 'alsoProduct/'; const GET_RECOMMENDED_PRODUCT = 'alsoProduct/';
const GET_MOST_VIEWED_PRODUCTS = "mostview?"; const GET_MOST_VIEWED_PRODUCTS = "mostview?";
const GET_NEW_PRODUCTS = "newproducts?"; const GET_NEW_PRODUCTS = "newproducts?";
// Home Health Care // Home Health Care
const HHC_GET_ALL_SERVICES = const HHC_GET_ALL_SERVICES = "Services/Patients.svc/REST/PatientER_HHC_GetAllServices";
"Services/Patients.svc/REST/PatientER_HHC_GetAllServices"; const HHC_GET_ALL_CMC_SERVICES = "Services/Patients.svc/REST/PatientER_CMC_GetAllServices";
const HHC_GET_ALL_CMC_SERVICES = const PATIENT_ER_UPDATE_PRES_ORDER = "Services/Patients.svc/REST/PatientER_UpdatePresOrder";
"Services/Patients.svc/REST/PatientER_CMC_GetAllServices"; const GET_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder";
const PATIENT_ER_UPDATE_PRES_ORDER = const GET_CMC_ORDER_DETAIL_BY_ID = "Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder";
"Services/Patients.svc/REST/PatientER_UpdatePresOrder";
const GET_ORDER_DETAIL_BY_ID =
"Services/Patients.svc/REST/PatientER_HHC_GetTransactionsForOrder";
const GET_CMC_ORDER_DETAIL_BY_ID =
"Services/Patients.svc/REST/PatientER_CMC_GetTransactionsForOrder";
const GET_CHECK_UP_ITEMS = "Services/Patients.svc/REST/GetCheckUpItems"; const GET_CHECK_UP_ITEMS = "Services/Patients.svc/REST/GetCheckUpItems";
const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS = const PUSH_NOTIFICATION_GET_ALL_NOTIFICATIONS =
'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications'; 'Services/MobileNotifications.svc/REST/PushNotification_GetAllNotifications';
const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ = const PUSH_NOTIFICATION_SET_MESSAGES_FROM_POOL_AS_READ =
'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead'; 'Services/MobileNotifications.svc/REST/PushNotification_SetMessagesFromPoolAsRead';
const GET_PATIENT_ALL_PRES_ORD = const GET_PATIENT_ALL_PRES_ORD = 'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders';
'Services/Patients.svc/REST/PatientER_GetPatientAllPresOrders'; const PATIENT_ER_INSERT_PRES_ORDER = 'Services/Patients.svc/REST/PatientER_InsertPresOrder';
const PATIENT_ER_INSERT_PRES_ORDER =
'Services/Patients.svc/REST/PatientER_InsertPresOrder';
const PHARMACY_MAKE_REVIEW = 'epharmacy/api/insertreviews'; const PHARMACY_MAKE_REVIEW = 'epharmacy/api/insertreviews';
const BLOOD_DONATION_REGISTER_BLOOD_TYPE = const BLOOD_DONATION_REGISTER_BLOOD_TYPE = 'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType';
'Services/PatientVarification.svc/REST/BloodDonation_RegisterBloodType'; const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION = 'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation';
const ADD_USER_AGREEMENT_FOR_BLOOD_DONATION =
'Services/PatientVarification.svc/REST/AddUserAgreementForBloodDonation';
//Pharmacy wishlist //Pharmacy wishlist
const GET_WISHLIST = "shopping_cart_items/"; const GET_WISHLIST = "shopping_cart_items/";
@ -577,8 +455,7 @@ const GET_SUB_PRODUCTS = 'products?categoryid=';
const GET_FINAL_PRODUCTS = const GET_FINAL_PRODUCTS =
'products?fields=id,reviews,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&CategoryId='; 'products?fields=id,reviews,discount_ids,name,namen,localized_names,display_order,short_description,full_description,full_descriptionn,sku,order_minimum_quantity,order_maximum_quantity,price,old_price,images,is_rx,rx_message,rx_messagen,discount_name,discount_namen,approved_rating_sum,approved_total_reviews,allow_back_in_stock_subscriptions,stock_quantity,stock_availability,stock_availabilityn,discount_percentage&CategoryId=';
const GET_CLINIC_CATEGORY = 'Services/Doctors.svc/REST/DP_GetClinicCategory'; const GET_CLINIC_CATEGORY = 'Services/Doctors.svc/REST/DP_GetClinicCategory';
const GET_DISEASE_BY_CLINIC_ID = const GET_DISEASE_BY_CLINIC_ID = 'Services/Doctors.svc/REST/DP_GetDiseasesByClinicID';
'Services/Doctors.svc/REST/DP_GetDiseasesByClinicID';
const SEARCH_DOCTOR_BY_TIME = 'Services/Doctors.svc/REST/SearchDoctorsByTime'; const SEARCH_DOCTOR_BY_TIME = 'Services/Doctors.svc/REST/SearchDoctorsByTime';
const TIMER_MIN = 10; const TIMER_MIN = 10;
@ -594,6 +471,8 @@ const SCAN_QR_CODE = 'productbysku/';
const FILTERED_PRODUCTS = 'products?categoryids='; const FILTERED_PRODUCTS = 'products?categoryids=';
const GET_DOCTOR_LIST_CALCULATION = "Services/Doctors.svc/REST/GetCallculationDoctors";
class AppGlobal { class AppGlobal {
static var context; static var context;

@ -466,6 +466,14 @@ const Map localizedValues = {
"ar": "ar":
" خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف). " " خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف). "
}, },
"parkingDescription": {
"en": "Parking service is for you to scan the car location so you can find it easy on you way out. click on (scan parking) button to save the parking location, then (show my park) button will appear to show you the way for the parking. if you want to rescan parking QR just click on (Clear My Data).",
"ar": "خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف)."
},
"checkinOption": {"en": "Check-In Options", "ar": "تحقق في الخيارات"},
"readBarcode": {"en": "Read Barcode", "ar": "قراءة الكود"}, "readBarcode": {"en": "Read Barcode", "ar": "قراءة الكود"},
"showMyPark": {"en": "Show My Park", "ar": "عرض بارك"}, "showMyPark": {"en": "Show My Park", "ar": "عرض بارك"},
"clearMyData": {"en": "clear My Data", "ar": "امسح البيانات"}, "clearMyData": {"en": "clear My Data", "ar": "امسح البيانات"},
@ -1257,6 +1265,8 @@ const Map localizedValues = {
"stretcher": {"en": "Stretcher", "ar": "نقالة"}, "stretcher": {"en": "Stretcher", "ar": "نقالة"},
"none": {"en": "None", "ar": "لا شيء"}, "none": {"en": "None", "ar": "لا شيء"},
"RRT-Summary": {"en": "Summary", "ar": "ملخص الطلب"}, "RRT-Summary": {"en": "Summary", "ar": "ملخص الطلب"},
"Rapid-Response-Team": {"en": "Rapid Response Team", "ar": "فريق الاستجابة السريع"},
"rrtService": {"en": "RRT Service", "ar": "خدمة RRT"},
"bill-amount": {"en": "Bill Amount", "ar": "مبلغ الفاتورة"}, "bill-amount": {"en": "Bill Amount", "ar": "مبلغ الفاتورة"},
"transport-method": {"en": "Transportation Method", "ar": "طريقة النقل"}, "transport-method": {"en": "Transportation Method", "ar": "طريقة النقل"},
"directions": {"en": "Directions", "ar": "الاتجاهات"}, "directions": {"en": "Directions", "ar": "الاتجاهات"},
@ -2023,5 +2033,29 @@ const Map localizedValues = {
"covid-select-procedure": { "covid-select-procedure": {
"en": "Please select the procedure:", "en": "Please select the procedure:",
"ar": "الرجاء تحديد الإجراء:" "ar": "الرجاء تحديد الإجراء:"
} },
"online-consultation": {"en": "Online Consultation", "ar": "استشارة مباشرة"},
"expected-weiting": {
"en": "Waiting time to start LiveCare consultation ",
"ar": "وقت الانتظار المتوقع لبدء استشارة لايف كير"
},
"er-consult-fee": {"en": "Consultation Fee", "ar": "رسوم الاستشارة"},
"insured-patient": {
"en":
"If you're Insurance patient, you have only have to pay the co-payment",
"ar": "إذا كنت مريضًا في مجال التأمين ، فليس عليك سوى دفع المبلغ المشترك"
},
"i-accept-terms": {
"en": "I Accept the Terms And Conditions",
"ar": "أوافق على الشروط والأحكام"
},
"upcoming-pay-options": {
"en": "You can pay by the following Options:",
"ar": "يمكنك الدفع عن طريق الخيارات التالية:"
},
"please-accept-terms": {
"en": "Please accept terms & conditions to continue",
"ar": "يرجى قبول الشروط والأحكام للمتابعة"
},
}; };

@ -30,3 +30,4 @@ const NOTIFICATION_COUNT = 'notification-count';
const PHARMACY_SELECTED_ADDRESS = 'selected-address'; const PHARMACY_SELECTED_ADDRESS = 'selected-address';
const PHARMACY_AUTORZIE_TOKEN = 'PHARMACY_AUTORZIE_TOKEN'; const PHARMACY_AUTORZIE_TOKEN = 'PHARMACY_AUTORZIE_TOKEN';
const H2O_UNIT = 'H2O_UNIT'; const H2O_UNIT = 'H2O_UNIT';
const H2O_REMINDER = 'H2O_REMINDER';

@ -49,6 +49,7 @@ class UserDetailModel {
this.isNotificationON}); this.isNotificationON});
UserDetailModel.fromJson(Map<String, dynamic> json) { UserDetailModel.fromJson(Map<String, dynamic> json) {
if(json==null) return;
userID = json['UserID']; userID = json['UserID'];
patientID = json['PatientID']; patientID = json['PatientID'];
patientType = json['PatientType']; patientType = json['PatientType'];

@ -23,7 +23,7 @@ class ActivePrescriptionReport {
dynamic patientName; dynamic patientName;
dynamic phoneOffice1; dynamic phoneOffice1;
dynamic prescriptionQR; dynamic prescriptionQR;
int prescriptionTimes; double prescriptionTimes;
dynamic productImage; dynamic productImage;
String productImageBase64; String productImageBase64;
String productImageString; String productImageString;

@ -1,4 +1,4 @@
class ReauestInsuranceApprovalModel { class RequestInsuranceApprovalModel {
double versionID; double versionID;
int channel; int channel;
int languageID; int languageID;
@ -15,7 +15,7 @@ class ReauestInsuranceApprovalModel {
int eXuldAPPNO; int eXuldAPPNO;
int projectID; int projectID;
ReauestInsuranceApprovalModel( RequestInsuranceApprovalModel(
{this.versionID, {this.versionID,
this.channel, this.channel,
this.languageID, this.languageID,
@ -32,7 +32,7 @@ class ReauestInsuranceApprovalModel {
this.eXuldAPPNO, this.eXuldAPPNO,
this.projectID}); this.projectID});
ReauestInsuranceApprovalModel.fromJson(Map<String, dynamic> json) { RequestInsuranceApprovalModel.fromJson(Map<String, dynamic> json) {
versionID = json['VersionID']; versionID = json['VersionID'];
channel = json['Channel']; channel = json['Channel'];
languageID = json['LanguageID']; languageID = json['LanguageID'];

@ -1,140 +1,465 @@
class InsuranceApprovalDetails {
String procedureName;
String status;
String isInvoicedDesc;
InsuranceApprovalDetails({
this.procedureName,
this.status,
this.isInvoicedDesc,
});
InsuranceApprovalDetails.fromJson(Map<String, dynamic> json) {
try {
isInvoicedDesc = json['IsInvoicedDesc'];
status = json['Status'];
procedureName = json['ProcedureName'];
} catch (e) {
print(e);
}
}
}
class InsuranceApprovalModel { class InsuranceApprovalModel {
InsuranceApprovalDetails approvalDetails; String setupID;
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;
int eXuldAPPNO;
int projectID; int projectID;
String doctorName;
String clinicName;
String patientDescription;
int approvalNo; int approvalNo;
String approvalStatusDescption; String approvalDate;
int unUsedCount; int patientType;
int patientID;
//String companyName; int companyID;
int subCategoryID;
int doctorID;
int clinicID;
int approvalType;
String inpatientApprovalSubType;
String validFrom;
String vaildDays;
String validTo;
bool isApprovalOnGross;
bool isPackage;
int requestedAmount;
int actualApprovedAmount;
int aviliableAmount;
String companyApprovalNo;
int progNoteOrderNo;
String submitOn;
String receiptOn;
String remarks1;
String remarks2;
int status;
String feedbackStatusBy;
String feedbackStatus;
String feedbackStatusOn;
int authorizerID;
String expiryDate; String expiryDate;
String rceiptOn;
int appointmentNo; int appointmentNo;
int admissionNo;
int admissionRequestNo;
int createdBy;
String createdOn;
int editedBy;
String editedOn;
String rowVer;
bool isAddlDiscApplied;
int inProgressReasonID;
String extendedBy;
String extendedOn;
int subPolicyNo;
int noOrderAuthorizerID;
bool isVerbalApproval;
String subStatus;
bool isNotificationSend;
String eApprovalStatus;
String eApprovalRemarks;
bool isEmailSentOnDelayApproval;
int eAuthorizationID;
InsuranceApprovalDetails apporvalDetails;
String approvalStatusDescption;
String clinicName;
String clinicNameN;
String companyName;
String doctorImageURL;
String doctorName;
String doctorNameN;
int doctorRate;
String doctorTitle;
int gender;
String genderDescription;
bool isActiveDoctorProfile;
bool isExecludeDoctor;
bool isInOutPatient;
String isInOutPatientDescription;
String isInOutPatientDescriptionN;
bool isLiveCareAppointment;
String projectName;
String projectNameN;
String qR;
List<String> speciality;
String strApprovalDate;
String strExpiryDate;
String strSubmitDate;
int totaUnUsedCount;
int unUsedCount;
InsuranceApprovalModel( InsuranceApprovalModel(
{this.versionID, {this.setupID,
this.channel,
this.languageID,
this.iPAdress,
this.generalid,
this.patientOutSA,
this.sessionID,
this.isDentalAllowedBackend,
this.deviceTypeID,
this.patientID,
this.tokenID,
this.patientTypeID,
this.patientType,
this.eXuldAPPNO,
this.projectID, this.projectID,
this.doctorName,
this.clinicName,
this.patientDescription,
this.approvalNo, this.approvalNo,
this.approvalStatusDescption, this.approvalDate,
this.unUsedCount, this.patientType,
//this.companyName, this.patientID,
this.companyID,
this.subCategoryID,
this.doctorID,
this.clinicID,
this.approvalType,
this.inpatientApprovalSubType,
this.validFrom,
this.vaildDays,
this.validTo,
this.isApprovalOnGross,
this.isPackage,
this.requestedAmount,
this.actualApprovedAmount,
this.aviliableAmount,
this.companyApprovalNo,
this.progNoteOrderNo,
this.submitOn,
this.receiptOn,
this.remarks1,
this.remarks2,
this.status,
this.feedbackStatusBy,
this.feedbackStatus,
this.feedbackStatusOn,
this.authorizerID,
this.expiryDate, this.expiryDate,
this.rceiptOn, this.appointmentNo,
this.approvalDetails, this.admissionNo,
this.appointmentNo}); this.admissionRequestNo,
this.createdBy,
InsuranceApprovalDetails x = InsuranceApprovalDetails(); this.createdOn,
this.editedBy,
this.editedOn,
this.rowVer,
this.isAddlDiscApplied,
this.inProgressReasonID,
this.extendedBy,
this.extendedOn,
this.subPolicyNo,
this.noOrderAuthorizerID,
this.isVerbalApproval,
this.subStatus,
this.isNotificationSend,
this.eApprovalStatus,
this.eApprovalRemarks,
this.isEmailSentOnDelayApproval,
this.eAuthorizationID,
this.apporvalDetails,
this.approvalStatusDescption,
this.clinicName,
this.clinicNameN,
this.companyName,
this.doctorImageURL,
this.doctorName,
this.doctorNameN,
this.doctorRate,
this.doctorTitle,
this.gender,
this.genderDescription,
this.isActiveDoctorProfile,
this.isExecludeDoctor,
this.isInOutPatient,
this.isInOutPatientDescription,
this.isInOutPatientDescriptionN,
this.isLiveCareAppointment,
this.projectName,
this.projectNameN,
this.qR,
this.speciality,
this.strApprovalDate,
this.strExpiryDate,
this.strSubmitDate,
this.totaUnUsedCount,
this.unUsedCount});
InsuranceApprovalModel.fromJson(Map<String, dynamic> json) { InsuranceApprovalModel.fromJson(Map<String, dynamic> json) {
try { setupID = json['SetupID'];
rceiptOn = json['ReceiptOn']; projectID = json['ProjectID'];
expiryDate = json['ExpiryDate']; approvalNo = json['ApprovalNo'];
//companyName = json['CompanyName']; approvalDate = json['ApprovalDate'];
unUsedCount = json['TotaUnUsedCount']; patientType = json['PatientType'];
approvalStatusDescption = json['ApprovalStatusDescption']; patientID = json['PatientID'];
approvalNo = json['ApprovalNo']; companyID = json['CompanyID'];
patientDescription = json['IsInOutPatientDescription']; subCategoryID = json['SubCategoryID'];
versionID = json['VersionID']; doctorID = json['DoctorID'];
channel = json['Channel']; clinicID = json['ClinicID'];
languageID = json['LanguageID']; approvalType = json['ApprovalType'];
iPAdress = json['IPAdress']; inpatientApprovalSubType = json['InpatientApprovalSubType'];
generalid = json['generalid']; validFrom = json['ValidFrom'];
patientOutSA = json['PatientOutSA']; vaildDays = json['VaildDays'];
sessionID = json['SessionID']; validTo = json['ValidTo'];
isDentalAllowedBackend = json['isDentalAllowedBackend']; isApprovalOnGross = json['IsApprovalOnGross'];
deviceTypeID = json['DeviceTypeID']; isPackage = json['IsPackage'];
patientID = json['PatientID']; requestedAmount = json['RequestedAmount'];
tokenID = json['TokenID']; actualApprovedAmount = json['ActualApprovedAmount'];
patientTypeID = json['PatientTypeID']; aviliableAmount = json['AviliableAmount'];
patientType = json['PatientType']; companyApprovalNo = json['CompanyApprovalNo'];
eXuldAPPNO = json['EXuldAPPNO']; progNoteOrderNo = json['ProgNoteOrderNo'];
projectID = json['ProjectID']; submitOn = json['SubmitOn'];
doctorName = json['DoctorName']; receiptOn = json['ReceiptOn'];
clinicName = json['ClinicName']; remarks1 = json['Remarks1'];
approvalDetails = remarks2 = json['Remarks2'];
InsuranceApprovalDetails.fromJson(json['ApporvalDetails'][0]); status = json['Status'];
appointmentNo = json['AppointmentNo']; feedbackStatusBy = json['FeedbackStatusBy'];
} catch (e) { feedbackStatus = json['FeedbackStatus'];
print(e); feedbackStatusOn = json['FeedbackStatusOn'];
authorizerID = json['AuthorizerID'];
expiryDate = json['ExpiryDate'];
appointmentNo = json['AppointmentNo'];
admissionNo = json['AdmissionNo'];
admissionRequestNo = json['AdmissionRequestNo'];
createdBy = json['CreatedBy'];
createdOn = json['CreatedOn'];
editedBy = json['EditedBy'];
editedOn = json['EditedOn'];
rowVer = json['RowVer'];
isAddlDiscApplied = json['IsAddlDiscApplied'];
inProgressReasonID = json['InProgressReasonID'];
extendedBy = json['ExtendedBy'];
extendedOn = json['ExtendedOn'];
subPolicyNo = json['SubPolicyNo'];
noOrderAuthorizerID = json['NoOrderAuthorizerID'];
isVerbalApproval = json['isVerbalApproval'];
subStatus = json['SubStatus'];
isNotificationSend = json['IsNotificationSend'];
eApprovalStatus = json['EApprovalStatus'];
eApprovalRemarks = json['EApprovalRemarks'];
isEmailSentOnDelayApproval = json['IsEmailSentOnDelayApproval'];
eAuthorizationID = json['EAuthorizationID'];
if (json['ApporvalDetails'] != null) {
apporvalDetails = InsuranceApprovalDetails.fromJson(json['ApporvalDetails'][0]);
} }
approvalStatusDescption = json['ApprovalStatusDescption'];
clinicName = json['ClinicName'];
clinicNameN = json['ClinicNameN'];
companyName = json['CompanyName'];
doctorImageURL = json['DoctorImageURL'];
doctorName = json['DoctorName'];
doctorNameN = json['DoctorNameN'];
doctorRate = json['DoctorRate'];
doctorTitle = json['DoctorTitle'];
gender = json['Gender'];
genderDescription = json['GenderDescription'];
isActiveDoctorProfile = json['IsActiveDoctorProfile'];
isExecludeDoctor = json['IsExecludeDoctor'];
isInOutPatient = json['IsInOutPatient'];
isInOutPatientDescription = json['IsInOutPatientDescription'];
isInOutPatientDescriptionN = json['IsInOutPatientDescriptionN'];
isLiveCareAppointment = json['IsLiveCareAppointment'];
projectName = json['ProjectName'];
projectNameN = json['ProjectNameN'];
qR = json['QR'];
speciality = json['Speciality'].cast<String>();
strApprovalDate = json['StrApprovalDate'];
strExpiryDate = json['StrExpiryDate'];
strSubmitDate = json['StrSubmitDate'];
totaUnUsedCount = json['TotaUnUsedCount'];
unUsedCount = json['UnUsedCount'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['VersionID'] = this.versionID; data['SetupID'] = this.setupID;
data['Channel'] = this.channel; data['ProjectID'] = this.projectID;
data['LanguageID'] = this.languageID; data['ApprovalNo'] = this.approvalNo;
data['IPAdress'] = this.iPAdress; data['ApprovalDate'] = this.approvalDate;
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; data['PatientType'] = this.patientType;
if (appointmentNo == null) { data['PatientID'] = this.patientID;
data['EXuldAPPNO'] = this.eXuldAPPNO; data['CompanyID'] = this.companyID;
data['ProjectID'] = this.projectID; data['SubCategoryID'] = this.subCategoryID;
} data['DoctorID'] = this.doctorID;
if (appointmentNo != null) { data['ClinicID'] = this.clinicID;
data['AppointmentNo'] = this.appointmentNo; data['ApprovalType'] = this.approvalType;
data['InpatientApprovalSubType'] = this.inpatientApprovalSubType;
data['ValidFrom'] = this.validFrom;
data['VaildDays'] = this.vaildDays;
data['ValidTo'] = this.validTo;
data['IsApprovalOnGross'] = this.isApprovalOnGross;
data['IsPackage'] = this.isPackage;
data['RequestedAmount'] = this.requestedAmount;
data['ActualApprovedAmount'] = this.actualApprovedAmount;
data['AviliableAmount'] = this.aviliableAmount;
data['CompanyApprovalNo'] = this.companyApprovalNo;
data['ProgNoteOrderNo'] = this.progNoteOrderNo;
data['SubmitOn'] = this.submitOn;
data['ReceiptOn'] = this.receiptOn;
data['Remarks1'] = this.remarks1;
data['Remarks2'] = this.remarks2;
data['Status'] = this.status;
data['FeedbackStatusBy'] = this.feedbackStatusBy;
data['FeedbackStatus'] = this.feedbackStatus;
data['FeedbackStatusOn'] = this.feedbackStatusOn;
data['AuthorizerID'] = this.authorizerID;
data['ExpiryDate'] = this.expiryDate;
data['AppointmentNo'] = this.appointmentNo;
data['AdmissionNo'] = this.admissionNo;
data['AdmissionRequestNo'] = this.admissionRequestNo;
data['CreatedBy'] = this.createdBy;
data['CreatedOn'] = this.createdOn;
data['EditedBy'] = this.editedBy;
data['EditedOn'] = this.editedOn;
data['RowVer'] = this.rowVer;
data['IsAddlDiscApplied'] = this.isAddlDiscApplied;
data['InProgressReasonID'] = this.inProgressReasonID;
data['ExtendedBy'] = this.extendedBy;
data['ExtendedOn'] = this.extendedOn;
data['SubPolicyNo'] = this.subPolicyNo;
data['NoOrderAuthorizerID'] = this.noOrderAuthorizerID;
data['isVerbalApproval'] = this.isVerbalApproval;
data['SubStatus'] = this.subStatus;
data['IsNotificationSend'] = this.isNotificationSend;
data['EApprovalStatus'] = this.eApprovalStatus;
data['EApprovalRemarks'] = this.eApprovalRemarks;
data['IsEmailSentOnDelayApproval'] = this.isEmailSentOnDelayApproval;
data['EAuthorizationID'] = this.eAuthorizationID;
if (this.apporvalDetails != null) {
data['ApporvalDetails'] = this.apporvalDetails.toJson;
} }
data['ApprovalStatusDescption'] = this.approvalStatusDescption;
data['ClinicName'] = this.clinicName;
data['ClinicNameN'] = this.clinicNameN;
data['CompanyName'] = this.companyName;
data['DoctorImageURL'] = this.doctorImageURL;
data['DoctorName'] = this.doctorName;
data['DoctorNameN'] = this.doctorNameN;
data['DoctorRate'] = this.doctorRate;
data['DoctorTitle'] = this.doctorTitle;
data['Gender'] = this.gender;
data['GenderDescription'] = this.genderDescription;
data['IsActiveDoctorProfile'] = this.isActiveDoctorProfile;
data['IsExecludeDoctor'] = this.isExecludeDoctor;
data['IsInOutPatient'] = this.isInOutPatient;
data['IsInOutPatientDescription'] = this.isInOutPatientDescription;
data['IsInOutPatientDescriptionN'] = this.isInOutPatientDescriptionN;
data['IsLiveCareAppointment'] = this.isLiveCareAppointment;
data['ProjectName'] = this.projectName;
data['ProjectNameN'] = this.projectNameN;
data['QR'] = this.qR;
data['Speciality'] = this.speciality;
data['StrApprovalDate'] = this.strApprovalDate;
data['StrExpiryDate'] = this.strExpiryDate;
data['StrSubmitDate'] = this.strSubmitDate;
data['TotaUnUsedCount'] = this.totaUnUsedCount;
data['UnUsedCount'] = this.unUsedCount;
return data;
}
}
class InsuranceApprovalDetails {
int setupID;
int projectID;
int approvalNo;
int lineItemNo;
int orderType;
int procedureID;
int toothNo;
int price;
int approvedAmount;
String unapprovedPatientShare;
int waivedAmount;
String discountType;
int discountValue;
String shareType;
String patientShareTypeValue;
String companyShareTypeValue;
String patientShare;
String companyShare;
int deductableAmount;
String disapprovedRemarks;
int progNoteOrderNo;
int progNoteLineItemNo;
String invoiceTransactionType;
int invoiceNo;
String procedureName;
String procedureNameN;
String status;
bool isInvoiced;
String isInvoicedDesc;
InsuranceApprovalDetails(
{this.setupID,
this.projectID,
this.approvalNo,
this.lineItemNo,
this.orderType,
this.procedureID,
this.toothNo,
this.price,
this.approvedAmount,
this.unapprovedPatientShare,
this.waivedAmount,
this.discountType,
this.discountValue,
this.shareType,
this.patientShareTypeValue,
this.companyShareTypeValue,
this.patientShare,
this.companyShare,
this.deductableAmount,
this.disapprovedRemarks,
this.progNoteOrderNo,
this.progNoteLineItemNo,
this.invoiceTransactionType,
this.invoiceNo,
this.procedureName,
this.procedureNameN,
this.status,
this.isInvoiced,
this.isInvoicedDesc});
InsuranceApprovalDetails.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
projectID = json['ProjectID'];
approvalNo = json['ApprovalNo'];
lineItemNo = json['LineItemNo'];
orderType = json['OrderType'];
procedureID = json['ProcedureID'];
toothNo = json['ToothNo'];
price = json['Price'];
approvedAmount = json['ApprovedAmount'];
unapprovedPatientShare = json['UnapprovedPatientShare'];
waivedAmount = json['WaivedAmount'];
discountType = json['DiscountType'];
discountValue = json['DiscountValue'];
shareType = json['ShareType'];
patientShareTypeValue = json['PatientShareTypeValue'];
companyShareTypeValue = json['CompanyShareTypeValue'];
patientShare = json['PatientShare'];
companyShare = json['CompanyShare'];
deductableAmount = json['DeductableAmount'];
disapprovedRemarks = json['DisapprovedRemarks'];
progNoteOrderNo = json['ProgNoteOrderNo'];
progNoteLineItemNo = json['ProgNoteLineItemNo'];
invoiceTransactionType = json['InvoiceTransactionType'];
invoiceNo = json['InvoiceNo'];
procedureName = json['ProcedureName'];
procedureNameN = json['ProcedureNameN'];
status = json['Status'];
isInvoiced = json['IsInvoiced'];
isInvoicedDesc = json['IsInvoicedDesc'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['ProjectID'] = this.projectID;
data['ApprovalNo'] = this.approvalNo;
data['LineItemNo'] = this.lineItemNo;
data['OrderType'] = this.orderType;
data['ProcedureID'] = this.procedureID;
data['ToothNo'] = this.toothNo;
data['Price'] = this.price;
data['ApprovedAmount'] = this.approvedAmount;
data['UnapprovedPatientShare'] = this.unapprovedPatientShare;
data['WaivedAmount'] = this.waivedAmount;
data['DiscountType'] = this.discountType;
data['DiscountValue'] = this.discountValue;
data['ShareType'] = this.shareType;
data['PatientShareTypeValue'] = this.patientShareTypeValue;
data['CompanyShareTypeValue'] = this.companyShareTypeValue;
data['PatientShare'] = this.patientShare;
data['CompanyShare'] = this.companyShare;
data['DeductableAmount'] = this.deductableAmount;
data['DisapprovedRemarks'] = this.disapprovedRemarks;
data['ProgNoteOrderNo'] = this.progNoteOrderNo;
data['ProgNoteLineItemNo'] = this.progNoteLineItemNo;
data['InvoiceTransactionType'] = this.invoiceTransactionType;
data['InvoiceNo'] = this.invoiceNo;
data['ProcedureName'] = this.procedureName;
data['ProcedureNameN'] = this.procedureNameN;
data['Status'] = this.status;
data['IsInvoiced'] = this.isInvoiced;
data['IsInvoicedDesc'] = this.isInvoicedDesc;
return data; return data;
} }
} }

@ -134,7 +134,7 @@ class PrescriptionReport {
frequencyID = json['frequencyID']; frequencyID = json['frequencyID'];
routeID = json['routeID']; routeID = json['routeID'];
name = json['name']; name = json['name'];
itemDescriptionN = json['itemDescriptionN']; itemDescriptionN = json['ItemDescriptionN'];
routeN = json['routeN']; routeN = json['routeN'];
frequencyN = json['frequencyN']; frequencyN = json['frequencyN'];
} }

@ -15,6 +15,7 @@ class PrescriptionReportEnh {
String imageThumbUrl; String imageThumbUrl;
String isCovered; String isCovered;
String itemDescription; String itemDescription;
String itemDescriptionN;
int itemID; int itemID;
String orderDate; String orderDate;
int patientID; int patientID;
@ -35,38 +36,39 @@ class PrescriptionReportEnh {
PrescriptionReportEnh( PrescriptionReportEnh(
{this.address, {this.address,
this.appointmentNo, this.appointmentNo,
this.clinic, this.clinic,
this.companyName, this.companyName,
this.days, this.days,
this.doctorName, this.doctorName,
this.doseDailyQuantity, this.doseDailyQuantity,
this.frequency, this.frequency,
this.frequencyNumber, this.frequencyNumber,
this.image, this.image,
this.imageExtension, this.imageExtension,
this.imageSRCUrl, this.imageSRCUrl,
this.imageString, this.imageString,
this.imageThumbUrl, this.imageThumbUrl,
this.isCovered, this.isCovered,
this.itemDescription, this.itemDescription,
this.itemID, this.itemDescriptionN,
this.orderDate, this.itemID,
this.patientID, this.orderDate,
this.patientName, this.patientID,
this.phoneOffice1, this.patientName,
this.prescriptionQR, this.phoneOffice1,
this.prescriptionTimes, this.prescriptionQR,
this.productImage, this.prescriptionTimes,
this.productImageBase64, this.productImage,
this.productImageString, this.productImageBase64,
this.projectID, this.productImageString,
this.projectName, this.projectID,
this.remarks, this.projectName,
this.route, this.remarks,
this.sKU, this.route,
this.scaleOffset, this.sKU,
this.startDate}); this.scaleOffset,
this.startDate});
PrescriptionReportEnh.fromJson(Map<String, dynamic> json) { PrescriptionReportEnh.fromJson(Map<String, dynamic> json) {
address = json['Address']; address = json['Address'];
@ -85,6 +87,7 @@ class PrescriptionReportEnh {
imageThumbUrl = json['ImageThumbUrl']; imageThumbUrl = json['ImageThumbUrl'];
isCovered = json['IsCovered']; isCovered = json['IsCovered'];
itemDescription = json['ItemDescription']; itemDescription = json['ItemDescription'];
itemDescriptionN = json['ItemDescriptionN'];
itemID = json['ItemID']; itemID = json['ItemID'];
orderDate = json['OrderDate']; orderDate = json['OrderDate'];
patientID = json['PatientID']; patientID = json['PatientID'];
@ -122,6 +125,7 @@ class PrescriptionReportEnh {
data['ImageThumbUrl'] = this.imageThumbUrl; data['ImageThumbUrl'] = this.imageThumbUrl;
data['IsCovered'] = this.isCovered; data['IsCovered'] = this.isCovered;
data['ItemDescription'] = this.itemDescription; data['ItemDescription'] = this.itemDescription;
data['ItemDescriptionN'] = this.itemDescriptionN;
data['ItemID'] = this.itemID; data['ItemID'] = this.itemID;
data['OrderDate'] = this.orderDate; data['OrderDate'] = this.orderDate;
data['PatientID'] = this.patientID; data['PatientID'] = this.patientID;

@ -0,0 +1,124 @@
class PrescriptionReportINP {
int patientID;
String patientName;
String patientAge;
String patientGender;
String address;
String phoneOffice;
String itemDescription;
int doseTimingID;
int frequencyID;
int routeID;
String clinic;
String doctorName;
String route;
String frequency;
String remarks;
String name;
int days;
String startDate;
String orderDate;
int doseDailyQuantity;
int itemID;
Null productImage;
String sKU;
String itemDescriptionN;
String routeN;
String frequencyN;
String imageSRCUrl;
String imageThumbUrl;
PrescriptionReportINP(
{this.patientID,
this.patientName,
this.patientAge,
this.patientGender,
this.address,
this.phoneOffice,
this.itemDescription,
this.doseTimingID,
this.frequencyID,
this.routeID,
this.clinic,
this.doctorName,
this.route,
this.frequency,
this.remarks,
this.name,
this.days,
this.startDate,
this.orderDate,
this.doseDailyQuantity,
this.itemID,
this.productImage,
this.sKU,
this.itemDescriptionN,
this.routeN,
this.frequencyN,
this.imageSRCUrl,
this.imageThumbUrl});
PrescriptionReportINP.fromJson(Map<String, dynamic> json) {
patientID = json['PatientID'];
patientName = json['PatientName'];
patientAge = json['PatientAge'];
patientGender = json['PatientGender'];
address = json['Address'];
phoneOffice = json['PhoneOffice'];
itemDescription = json['ItemDescription'];
doseTimingID = json['DoseTimingID'];
frequencyID = json['FrequencyID'];
routeID = json['RouteID'];
clinic = json['Clinic'];
doctorName = json['DoctorName'];
route = json['Route'];
frequency = json['Frequency'];
remarks = json['Remarks'];
name = json['Name'];
days = json['Days'];
startDate = json['StartDate'];
orderDate = json['OrderDate'];
doseDailyQuantity = json['DoseDailyQuantity'];
itemID = json['ItemID'];
productImage = json['ProductImage'];
sKU = json['SKU'];
itemDescriptionN = json['ItemDescriptionN'];
routeN = json['RouteN'];
frequencyN = json['FrequencyN'];
imageSRCUrl = json['ImageSRCUrl'];
imageThumbUrl = json['ImageThumbUrl'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['PatientID'] = this.patientID;
data['PatientName'] = this.patientName;
data['PatientAge'] = this.patientAge;
data['PatientGender'] = this.patientGender;
data['Address'] = this.address;
data['PhoneOffice'] = this.phoneOffice;
data['ItemDescription'] = this.itemDescription;
data['DoseTimingID'] = this.doseTimingID;
data['FrequencyID'] = this.frequencyID;
data['RouteID'] = this.routeID;
data['Clinic'] = this.clinic;
data['DoctorName'] = this.doctorName;
data['Route'] = this.route;
data['Frequency'] = this.frequency;
data['Remarks'] = this.remarks;
data['Name'] = this.name;
data['Days'] = this.days;
data['StartDate'] = this.startDate;
data['OrderDate'] = this.orderDate;
data['DoseDailyQuantity'] = this.doseDailyQuantity;
data['ItemID'] = this.itemID;
data['ProductImage'] = this.productImage;
data['SKU'] = this.sKU;
data['ItemDescriptionN'] = this.itemDescriptionN;
data['RouteN'] = this.routeN;
data['FrequencyN'] = this.frequencyN;
data['ImageSRCUrl'] = this.imageSRCUrl;
data['ImageThumbUrl'] = this.imageThumbUrl;
return data;
}
}

@ -23,6 +23,7 @@ class RequestSendPrescriptionEmail {
String setupID; String setupID;
String clinicName; String clinicName;
String doctorName; String doctorName;
int doctorID;
int projectID; int projectID;
List<PrescriptionReport> listPrescriptions; List<PrescriptionReport> listPrescriptions;
@ -49,7 +50,8 @@ class RequestSendPrescriptionEmail {
this.setupID, this.setupID,
this.clinicName, this.clinicName,
this.doctorName, this.doctorName,
this.projectID}); this.projectID,
this.doctorID});
RequestSendPrescriptionEmail.fromJson(Map<String, dynamic> json) { RequestSendPrescriptionEmail.fromJson(Map<String, dynamic> json) {
appointmentDate = json['AppointmentDate']; appointmentDate = json['AppointmentDate'];
@ -75,6 +77,7 @@ class RequestSendPrescriptionEmail {
clinicName = json['ClinicName']; clinicName = json['ClinicName'];
doctorName = json['DoctorName']; doctorName = json['DoctorName'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
doctorID = json['DoctorID'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -106,7 +109,7 @@ class RequestSendPrescriptionEmail {
data['ClinicName'] = this.clinicName; data['ClinicName'] = this.clinicName;
data['DoctorName'] = this.doctorName; data['DoctorName'] = this.doctorName;
data['ProjectID'] = this.projectID; data['ProjectID'] = this.projectID;
data['DoctorID'] = this.doctorID;
return data; return data;
} }
} }

@ -7,6 +7,7 @@ import 'package:diplomaticquarterapp/core/model/health_calcolator/get_doctor_by_
import 'package:diplomaticquarterapp/core/model/health_calcolator/get_doctor_list_calcolation_model.dart'; import 'package:diplomaticquarterapp/core/model/health_calcolator/get_doctor_list_calcolation_model.dart';
import 'package:diplomaticquarterapp/core/model/health_calcolator/get_doctor_list_calcolation_request_model.dart'; import 'package:diplomaticquarterapp/core/model/health_calcolator/get_doctor_list_calcolation_request_model.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:flutter/cupertino.dart';
class BariatricsService extends BaseService { class BariatricsService extends BaseService {
List<ClinicCategory> clinicCategoryList = []; List<ClinicCategory> clinicCategoryList = [];
@ -75,19 +76,24 @@ class BariatricsService extends BaseService {
}, body: body); }, body: body);
} }
Future getDoctorList() async { Future getDoctorList({@required DiseasesByClinic disease}) async {
hasError = false; hasError = false;
DoctorListByTimeRequestModel _doctorListReq = DoctorListByTimeRequestModel(); var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
_doctorListReq.isGetNearAppointment = false;
_doctorListReq.continueDentalPlan = false;
_doctorListReq.isSearchAppointmnetByClinicID = true;
_doctorListReq.latitude = 0;
_doctorListReq.longitude = 0;
_doctorListReq.license = true;
_doctorListReq.clinicID = 108;
_doctorListReq.patientID = 0;
//body['ClinicID'] = 108; // hint: it is static depend on IONIC project Map<String, dynamic> body = Map();
body['ClinicID'] = 108; // hint: it is static depend on IONIC project
body['ContinueDentalPlan'] = false;
body['IsGetNearAppointment'] = false;
body['IsSearchAppointmnetByClinicID'] = true;
body['LanguageID'] = languageID == 'ar' ? 1 : 2;
body['Latitude'] = 0;
body['License'] = true;
body['Longitude'] = 0;
body['PatientID'] = 0;
body['isDentalAllowedBackend'] = false;
if(disease != null)
body['DiseaseID'] = disease.diseasesID;
await baseAppClient.post(GET_DOCTOR_LIST_BY_TIME, onSuccess: (dynamic response, int statusCode) { await baseAppClient.post(GET_DOCTOR_LIST_BY_TIME, onSuccess: (dynamic response, int statusCode) {
doctorListByTime.clear(); doctorListByTime.clear();
@ -98,6 +104,6 @@ class BariatricsService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: _doctorListReq.toJson()); }, body: body);
} }
} }

@ -29,8 +29,7 @@ AppSharedPreferences sharedPref = new AppSharedPreferences();
/// onFailure: (String error, int statusCode) {}, /// onFailure: (String error, int statusCode) {},
/// body: Map(); /// body: Map();
/// ///
AuthenticatedUserObject authenticatedUserObject = AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
locator<AuthenticatedUserObject>();
VitalSignService _vitalSignService = locator<VitalSignService>(); VitalSignService _vitalSignService = locator<VitalSignService>();
class BaseAppClient { class BaseAppClient {
@ -50,14 +49,10 @@ class BaseAppClient {
//Map profile = await sharedPref.getObj(DOCTOR_PROFILE); //Map profile = await sharedPref.getObj(DOCTOR_PROFILE);
var pharmacyToken = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN); var pharmacyToken = await sharedPref.getString(PHARMACY_AUTORZIE_TOKEN);
var user = await sharedPref.getObject(USER_PROFILE); var user = await sharedPref.getObject(USER_PROFILE);
Map<String, String> headers = { Map<String, String> headers = {'Content-Type': 'application/json', 'Accept': 'application/json'};
'Content-Type': 'application/json',
'Accept': 'application/json'
};
if (!isExternal) { if (!isExternal) {
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
var languageID = var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
if (body.containsKey('SetupID')) { if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] != null
@ -72,19 +67,13 @@ class BaseAppClient {
body['IPAdress'] = IP_ADDRESS; body['IPAdress'] = IP_ADDRESS;
body['generalid'] = GENERAL_ID; body['generalid'] = GENERAL_ID;
body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null
? body['PatientOutSA']
: PATIENT_OUT_SA
: PATIENT_OUT_SA;
if (body.containsKey('isDentalAllowedBackend')) { if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
body.containsKey('isDentalAllowedBackend') ? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend'] != null ? body['isDentalAllowedBackend']
? body['isDentalAllowedBackend'] : IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND : IS_DENTAL_ALLOWED_BACKEND;
: IS_DENTAL_ALLOWED_BACKEND;
} }
body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
@ -107,19 +96,20 @@ class BaseAppClient {
: PATIENT_TYPE_ID; : PATIENT_TYPE_ID;
if (user != null) { if (user != null) {
body['TokenID'] = token; body['TokenID'] = token;
body['PatientID'] = body['PatientID'] != null body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID'];
? body['PatientID']
: user['PatientID'];
body['PatientOutSA'] = user['OutSA']; body['PatientOutSA'] = user['OutSA'];
body['PatientOutSA'] = body.containsKey('PatientOutSA')
? body['PatientOutSA'] != null
? body['PatientOutSA']
: PATIENT_OUT_SA
: PATIENT_OUT_SA;
body['SessionID'] = SESSION_ID; //getSe body['SessionID'] = SESSION_ID; //getSe
headers = { headers = {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': pharmacyToken, 'Authorization': pharmacyToken,
'Mobilenumber': user != null 'Mobilenumber': user != null ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "",
? Utils.getPhoneNumberWithoutZero(
user['MobileNumber'].toString())
: "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user['PatientID'].toString(), 'Username': user['PatientID'].toString(),
}; };
@ -131,8 +121,7 @@ class BaseAppClient {
print("Body : ${json.encode(body)}"); print("Body : ${json.encode(body)}");
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.post(url.trim(), final response = await http.post(url.trim(), body: json.encode(body), headers: headers);
body: json.encode(body), headers: headers);
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
print("statusCode :$statusCode"); print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
@ -144,8 +133,7 @@ class BaseAppClient {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
if (parsed['ErrorType'] == 4) { if (parsed['ErrorType'] == 4) {
navigateToAppUpdate( navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']);
AppGlobal.context, parsed['ErrorEndUserMessage']);
} }
if (isAllowAny) { if (isAllowAny) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
@ -160,34 +148,24 @@ class BaseAppClient {
if (parsed != null) { if (parsed != null) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
onFailure( onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logout(); logout();
} }
} }
} else if (parsed['MessageStatus'] == 1 || } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) {
parsed['SMSLoginRequired'] == true) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else if (parsed['MessageStatus'] == 2 && } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) {
parsed['IsAuthenticated']) {
if (parsed['SameClinicApptList'] != null) { if (parsed['SameClinicApptList'] != null) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
if (parsed['message'] == null && if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) {
parsed['ErrorEndUserMessage'] == null) {
if (parsed['ErrorSearchMsg'] == null) { if (parsed['ErrorSearchMsg'] == null) {
onFailure("Server Error found with no available message", onFailure("Server Error found with no available message", statusCode);
statusCode);
} else { } else {
onFailure(parsed['ErrorSearchMsg'], statusCode); onFailure(parsed['ErrorSearchMsg'], statusCode);
} }
} else { } else {
onFailure( onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
} }
} }
} else if (!parsed['IsAuthenticated']) { } else if (!parsed['IsAuthenticated']) {
@ -201,9 +179,7 @@ class BaseAppClient {
if (parsed['message'] != null) { if (parsed['message'] != null) {
onFailure(parsed['message'] ?? parsed['message'], statusCode); onFailure(parsed['message'] ?? parsed['message'], statusCode);
} else { } else {
onFailure( onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
} }
} }
} }
@ -240,16 +216,13 @@ class BaseAppClient {
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': token ?? '', 'Authorization': token ?? '',
'Mobilenumber': user != null 'Mobilenumber': user != null ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "",
? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString())
: "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user != null ? user['PatientID'].toString() : "", 'Username': user != null ? user['PatientID'].toString() : "",
}; };
if (!isExternal) { if (!isExternal) {
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
var languageID = var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
if (body.containsKey('SetupID')) { if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
? body['SetupID'] != null ? body['SetupID'] != null
@ -271,12 +244,11 @@ class BaseAppClient {
: PATIENT_OUT_SA; : PATIENT_OUT_SA;
if (body.containsKey('isDentalAllowedBackend')) { if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
body.containsKey('isDentalAllowedBackend') ? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend'] != null ? body['isDentalAllowedBackend']
? body['isDentalAllowedBackend'] : IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND : IS_DENTAL_ALLOWED_BACKEND;
: IS_DENTAL_ALLOWED_BACKEND;
} }
body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
@ -299,9 +271,7 @@ class BaseAppClient {
: PATIENT_TYPE_ID; : PATIENT_TYPE_ID;
if (user != null) { if (user != null) {
body['TokenID'] = token; body['TokenID'] = token;
body['PatientID'] = body['PatientID'] != null body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID'];
? body['PatientID']
: user['PatientID'];
body['PatientOutSA'] = user['OutSA']; body['PatientOutSA'] = user['OutSA'];
body['SessionID'] = SESSION_ID; //getSe body['SessionID'] = SESSION_ID; //getSe
headers = { headers = {
@ -320,8 +290,7 @@ class BaseAppClient {
print("Body : ${json.encode(body)}"); print("Body : ${json.encode(body)}");
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.post(url.trim(), final response = await http.post(url.trim(), body: json.encode(body), headers: headers);
body: json.encode(body), headers: headers);
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
print("statusCode :$statusCode"); print("statusCode :$statusCode");
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
@ -333,8 +302,7 @@ class BaseAppClient {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
if (parsed['ErrorType'] == 4) { if (parsed['ErrorType'] == 4) {
navigateToAppUpdate( navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']);
AppGlobal.context, parsed['ErrorEndUserMessage']);
} }
if (isAllowAny) { if (isAllowAny) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
@ -349,34 +317,24 @@ class BaseAppClient {
if (parsed != null) { if (parsed != null) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
onFailure( onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logout(); logout();
} }
} }
} else if (parsed['MessageStatus'] == 1 || } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) {
parsed['SMSLoginRequired'] == true) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else if (parsed['MessageStatus'] == 2 && } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) {
parsed['IsAuthenticated']) {
if (parsed['SameClinicApptList'] != null) { if (parsed['SameClinicApptList'] != null) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
if (parsed['message'] == null && if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) {
parsed['ErrorEndUserMessage'] == null) {
if (parsed['ErrorSearchMsg'] == null) { if (parsed['ErrorSearchMsg'] == null) {
onFailure("Server Error found with no available message", onFailure("Server Error found with no available message", statusCode);
statusCode);
} else { } else {
onFailure(parsed['ErrorSearchMsg'], statusCode); onFailure(parsed['ErrorSearchMsg'], statusCode);
} }
} else { } else {
onFailure( onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
} }
} }
} else if (!parsed['IsAuthenticated']) { } else if (!parsed['IsAuthenticated']) {
@ -390,9 +348,7 @@ class BaseAppClient {
if (parsed['message'] != null) { if (parsed['message'] != null) {
onFailure(parsed['message'] ?? parsed['message'], statusCode); onFailure(parsed['message'] ?? parsed['message'], statusCode);
} else { } else {
onFailure( onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
} }
} }
} }
@ -408,8 +364,7 @@ class BaseAppClient {
} }
Future navigateToAppUpdate(context, String text) async { Future navigateToAppUpdate(context, String text) async {
Navigator.pushReplacement( Navigator.pushReplacement(context, FadePage(page: AppUpdatePage(appUpdateText: text)));
context, FadePage(page: AppUpdatePage(appUpdateText: text)));
} }
get(String endPoint, get(String endPoint,
@ -433,10 +388,7 @@ class BaseAppClient {
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.get( final response = await http.get(
url.trim(), url.trim(),
headers: { headers: {'Content-Type': 'application/json', 'Accept': 'application/json'},
'Content-Type': 'application/json',
'Accept': 'application/json'
},
); );
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
print("statusCode :$statusCode"); print("statusCode :$statusCode");
@ -480,9 +432,7 @@ class BaseAppClient {
'Content-Type': 'text/html; charset=utf-8', 'Content-Type': 'text/html; charset=utf-8',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': token ?? '', 'Authorization': token ?? '',
'Mobilenumber': user != null 'Mobilenumber': user != null ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "",
? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString())
: "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user != null ? user['PatientID'].toString() : "", 'Username': user != null ? user['PatientID'].toString() : "",
}); });
@ -491,8 +441,7 @@ class BaseAppClient {
if (statusCode < 200 || statusCode >= 400 || json == null) { if (statusCode < 200 || statusCode >= 400 || json == null) {
if (statusCode == 401) { if (statusCode == 401) {
AppToast.showErrorToast( AppToast.showErrorToast(message: TranslationBase.of(AppGlobal.context).pharmacyRelogin);
message: TranslationBase.of(AppGlobal.context).pharmacyRelogin);
Navigator.of(AppGlobal.context).pushNamed(HOME); Navigator.of(AppGlobal.context).pushNamed(HOME);
} else { } else {
onFailure('Error While Fetching data', statusCode); onFailure('Error While Fetching data', statusCode);
@ -520,10 +469,7 @@ class BaseAppClient {
final response = await http.post( final response = await http.post(
url.trim(), url.trim(),
body: json.encode(body), body: json.encode(body),
headers: { headers: {'Content-Type': 'application/json', 'Accept': 'application/json'},
'Content-Type': 'application/json',
'Accept': 'application/json'
},
); );
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
@ -556,10 +502,7 @@ class BaseAppClient {
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.get( final response = await http.get(
url.trim(), url.trim(),
headers: { headers: {'Content-Type': 'application/json', 'Accept': 'application/json'},
'Content-Type': 'application/json',
'Accept': 'application/json'
},
); );
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
@ -586,10 +529,7 @@ class BaseAppClient {
final response = await http.put( final response = await http.put(
url.trim(), url.trim(),
body: json.encode(body), body: json.encode(body),
headers: { headers: {'Content-Type': 'application/json', 'Accept': 'application/json'},
'Content-Type': 'application/json',
'Accept': 'application/json'
},
); );
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
@ -622,10 +562,7 @@ class BaseAppClient {
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = await http.delete( final response = await http.delete(
url.trim(), url.trim(),
headers: { headers: {'Content-Type': 'application/json', 'Accept': 'application/json'},
'Content-Type': 'application/json',
'Accept': 'application/json'
},
); );
final int statusCode = response.statusCode; final int statusCode = response.statusCode;
@ -645,10 +582,8 @@ class BaseAppClient {
await sharedPref.remove(LOGIN_TOKEN_ID); await sharedPref.remove(LOGIN_TOKEN_ID);
await sharedPref.remove(PHARMACY_CUSTOMER_ID); await sharedPref.remove(PHARMACY_CUSTOMER_ID);
await authenticatedUserObject.getUser(); await authenticatedUserObject.getUser();
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin = Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin = false;
false; var model = Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false);
var model =
Provider.of<ToDoCountProviderModel>(AppGlobal.context, listen: false);
_vitalSignService.weightKg = ""; _vitalSignService.weightKg = "";
_vitalSignService.heightCm = ""; _vitalSignService.heightCm = "";
model.setState(0, false); model.setState(0, false);
@ -662,8 +597,7 @@ class BaseAppClient {
static defaultHttpParameters() async { static defaultHttpParameters() async {
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
var languageID = var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var user = await sharedPref.getObject(USER_PROFILE); var user = await sharedPref.getObject(USER_PROFILE);
var params = {}; var params = {};
if (user != null) { if (user != null) {
@ -699,8 +633,7 @@ class BaseAppClient {
try { try {
if (isExternal) { if (isExternal) {
String token = await sharedPref.getString(TOKEN); String token = await sharedPref.getString(TOKEN);
var languageID = var languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
var user = await sharedPref.getObject(USER_PROFILE); var user = await sharedPref.getObject(USER_PROFILE);
if (body.containsKey('SetupID')) { if (body.containsKey('SetupID')) {
body['SetupID'] = body.containsKey('SetupID') body['SetupID'] = body.containsKey('SetupID')
@ -723,12 +656,11 @@ class BaseAppClient {
: PATIENT_OUT_SA; : PATIENT_OUT_SA;
if (body.containsKey('isDentalAllowedBackend')) { if (body.containsKey('isDentalAllowedBackend')) {
body['isDentalAllowedBackend'] = body['isDentalAllowedBackend'] = body.containsKey('isDentalAllowedBackend')
body.containsKey('isDentalAllowedBackend') ? body['isDentalAllowedBackend'] != null
? body['isDentalAllowedBackend'] != null ? body['isDentalAllowedBackend']
? body['isDentalAllowedBackend'] : IS_DENTAL_ALLOWED_BACKEND
: IS_DENTAL_ALLOWED_BACKEND : IS_DENTAL_ALLOWED_BACKEND;
: IS_DENTAL_ALLOWED_BACKEND;
} }
body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2; body['DeviceTypeID'] = Platform.isAndroid ? 1 : 2;
@ -751,9 +683,7 @@ class BaseAppClient {
: PATIENT_TYPE_ID; : PATIENT_TYPE_ID;
if (user != null) { if (user != null) {
body['TokenID'] = token; body['TokenID'] = token;
body['PatientID'] = body['PatientID'] != null body['PatientID'] = body['PatientID'] != null ? body['PatientID'] : user['PatientID'];
? body['PatientID']
: user['PatientID'];
body['PatientOutSA'] = user['OutSA']; body['PatientOutSA'] = user['OutSA'];
body['SessionID'] = SESSION_ID; //getSessionId(token); body['SessionID'] = SESSION_ID; //getSessionId(token);
} }
@ -765,17 +695,14 @@ class BaseAppClient {
var ss = json.encode(body); var ss = json.encode(body);
if (await Utils.checkConnection()) { if (await Utils.checkConnection()) {
final response = final response = await http.post(url.trim(), body: json.encode(body), headers: {
await http.post(url.trim(), body: json.encode(body), headers: {
// 'Content-Type': 'application/json', // 'Content-Type': 'application/json',
// 'Accept': 'application/json', // 'Accept': 'application/json',
// 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', // 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Content-Type': 'application/json', 'Content-Type': 'application/json',
'Accept': 'application/json', 'Accept': 'application/json',
'Authorization': token ?? '', 'Authorization': token ?? '',
'Mobilenumber': user != null 'Mobilenumber': user != null ? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString()) : "",
? Utils.getPhoneNumberWithoutZero(user['MobileNumber'].toString())
: "",
'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9', 'Statictoken': 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9',
'Username': user != null ? user['PatientID'].toString() : "", 'Username': user != null ? user['PatientID'].toString() : "",
}); });
@ -790,8 +717,7 @@ class BaseAppClient {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
if (parsed['ErrorType'] == 4) { if (parsed['ErrorType'] == 4) {
navigateToAppUpdate( navigateToAppUpdate(AppGlobal.context, parsed['ErrorEndUserMessage']);
AppGlobal.context, parsed['ErrorEndUserMessage']);
} }
if (isAllowAny) { if (isAllowAny) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
@ -806,31 +732,21 @@ class BaseAppClient {
if (parsed != null) { if (parsed != null) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else { } else {
onFailure( onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
logout(); logout();
} }
} }
} else if (parsed['MessageStatus'] == 1 || } else if (parsed['MessageStatus'] == 1 || parsed['SMSLoginRequired'] == true) {
parsed['SMSLoginRequired'] == true) {
onSuccess(parsed, statusCode); onSuccess(parsed, statusCode);
} else if (parsed['MessageStatus'] == 2 && } else if (parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']) {
parsed['IsAuthenticated']) { if (parsed['message'] == null && parsed['ErrorEndUserMessage'] == null) {
if (parsed['message'] == null &&
parsed['ErrorEndUserMessage'] == null) {
if (parsed['ErrorSearchMsg'] == null) { if (parsed['ErrorSearchMsg'] == null) {
onFailure("Server Error found with no available message", onFailure("Server Error found with no available message", statusCode);
statusCode);
} else { } else {
onFailure(parsed['ErrorSearchMsg'], statusCode); onFailure(parsed['ErrorSearchMsg'], statusCode);
} }
} else { } else {
onFailure( onFailure(parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
parsed['message'] ??
parsed['ErrorEndUserMessage'] ??
parsed['ErrorMessage'],
statusCode);
} }
} else if (!parsed['IsAuthenticated']) { } else if (!parsed['IsAuthenticated']) {
await logout(); await logout();
@ -843,9 +759,7 @@ class BaseAppClient {
if (parsed['message'] != null) { if (parsed['message'] != null) {
onFailure(parsed['message'] ?? parsed['message'], statusCode); onFailure(parsed['message'] ?? parsed['message'], statusCode);
} else { } else {
onFailure( onFailure(parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'], statusCode);
parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
} }
} }
} }

@ -1,6 +1,7 @@
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/model/insurance/Insurance_card_details.dart'; import 'package:diplomaticquarterapp/core/model/insurance/Insurance_card_details.dart';
import 'package:diplomaticquarterapp/core/model/insurance/ReauestInsuranceApprovalModel.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_approval.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update_model.dart'; import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update_model.dart';
@ -25,8 +26,7 @@ class InsuranceCardService extends BaseService {
List<InsuranceCardDetailsModel> insuranceCardDetailsList = List(); List<InsuranceCardDetailsModel> insuranceCardDetailsList = List();
bool isHaveInsuranceCard = false; bool isHaveInsuranceCard = false;
GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse();
GetAllSharedRecordsByStatusResponse();
clearInsuranceCard() { clearInsuranceCard() {
_cardList.clear(); _cardList.clear();
@ -36,19 +36,12 @@ class InsuranceCardService extends BaseService {
_cardUpdated.clear(); _cardUpdated.clear();
} }
RequestInsuranceApprovalModel _requestInsuranceApprovalModel = RequestInsuranceApprovalModel(isDentalAllowedBackend: false, patientTypeID: 1, patientType: 1, eXuldAPPNO: 0, projectID: 0);
InsuranceApprovalModel _insuranceApprovalModel = InsuranceApprovalModel(
isDentalAllowedBackend: false,
patientTypeID: 1,
patientType: 1,
eXuldAPPNO: 0,
projectID: 0);
Future getInsurance() async { Future getInsurance() async {
hasError = false; hasError = false;
_cardList.clear(); _cardList.clear();
await baseAppClient.post(GET_PAtIENTS_INSURANCE, await baseAppClient.post(GET_PAtIENTS_INSURANCE, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
response['List_PatientInsuranceCard'].forEach((item) { response['List_PatientInsuranceCard'].forEach((item) {
_cardList.add(InsuranceCardModel.fromJson(item)); _cardList.add(InsuranceCardModel.fromJson(item));
}); });
@ -60,10 +53,9 @@ class InsuranceCardService extends BaseService {
Future getInsuranceUpdate() async { Future getInsuranceUpdate() async {
hasError = false; hasError = false;
_cardList.clear(); _cardList.clear();
await baseAppClient.post(GET_PAtIENTS_INSURANCE_UPDATED, await baseAppClient.post(GET_PAtIENTS_INSURANCE_UPDATED, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { _cardUpdated.clear();
_cardUpdated.clear();
response['List_PatientInsuranceCardHistory'].forEach((item) { response['List_PatientInsuranceCardHistory'].forEach((item) {
_cardUpdated.add(InsuranceUpdateModel.fromJson(item)); _cardUpdated.add(InsuranceUpdateModel.fromJson(item));
}); });
@ -77,17 +69,16 @@ class InsuranceCardService extends BaseService {
hasError = false; hasError = false;
// _cardList.clear(); // _cardList.clear();
if (appointmentNo != null) { if (appointmentNo != null) {
_insuranceApprovalModel.appointmentNo = appointmentNo; // _requestInsuranceApprovalModel.appointmentNo = appointmentNo;
_insuranceApprovalModel.eXuldAPPNO = null; _requestInsuranceApprovalModel.eXuldAPPNO = null;
_insuranceApprovalModel.projectID = null; _requestInsuranceApprovalModel.projectID = null;
} else { } else {
_insuranceApprovalModel.appointmentNo = null; // _requestInsuranceApprovalModel.appointmentNo = null;
_insuranceApprovalModel.eXuldAPPNO = 0; _requestInsuranceApprovalModel.eXuldAPPNO = 0;
_insuranceApprovalModel.projectID = 0; _requestInsuranceApprovalModel.projectID = 0;
} }
await baseAppClient.post(GET_PAtIENTS_INSURANCE_APPROVALS, await baseAppClient.post(GET_PAtIENTS_INSURANCE_APPROVALS, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
print(response['HIS_Approval_List'].length); print(response['HIS_Approval_List'].length);
_insuranceApproval.clear(); _insuranceApproval.clear();
_insuranceApproval.length = 0; _insuranceApproval.length = 0;
@ -97,14 +88,13 @@ class InsuranceCardService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: _insuranceApprovalModel.toJson()); }, body: _requestInsuranceApprovalModel.toJson());
} }
Future getFamilyFiles() async { Future getFamilyFiles() async {
var myFamily = await sharedPref.getObject(FAMILY_FILE); var myFamily = await sharedPref.getObject(FAMILY_FILE);
if (myFamily != null) { if (myFamily != null) {
getAllSharedRecordsByStatusResponse = getAllSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse.fromJson(myFamily);
GetAllSharedRecordsByStatusResponse.fromJson(myFamily);
} else { } else {
getSharedRecordByStatus(); getSharedRecordByStatus();
} }
@ -115,68 +105,75 @@ class InsuranceCardService extends BaseService {
dynamic localRes; dynamic localRes;
var request = GetAllSharedRecordsByStatusReq(); var request = GetAllSharedRecordsByStatusReq();
request.status = 0; request.status = 0;
await baseAppClient.post(GET_SHARED_RECORD_BY_STATUS, await baseAppClient.post(GET_SHARED_RECORD_BY_STATUS, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
AppToast.showErrorToast(message: error); AppToast.showErrorToast(message: error);
throw error; throw error;
}, body: request.toJson()); }, body: request.toJson());
sharedPref.setObject(FAMILY_FILE, localRes); sharedPref.setObject(FAMILY_FILE, localRes);
getAllSharedRecordsByStatusResponse = getAllSharedRecordsByStatusResponse = GetAllSharedRecordsByStatusResponse.fromJson(localRes);
GetAllSharedRecordsByStatusResponse.fromJson(localRes);
} catch (error) { } catch (error) {
print(error); print(error);
throw error; throw error;
} }
} }
Future getInsuranceDetails(data) async{
Future getInsuranceDetails(data) async {
dynamic localRes; dynamic localRes;
await baseAppClient.post(INSURANCE_DETAILS, await baseAppClient.post(
onSuccess: (dynamic response, int statusCode) { INSURANCE_DETAILS,
localRes = response['List_InsuranceCheckList']; onSuccess: (dynamic response, int statusCode) {
}, onFailure: (String error, int statusCode) { localRes = response['List_InsuranceCheckList'];
hasError = true; },
super.error = error; onFailure: (String error, int statusCode) {
}, body:{'CompanyID': data.companyID,'SubCategoryID':data.subCategoryID },); hasError = true;
super.error = error;
},
body: {'CompanyID': data.companyID, 'SubCategoryID': data.subCategoryID},
);
return Future.value(localRes); return Future.value(localRes);
} }
Future getPatientInsuranceDetails({String setupID, int projectID, String patientIdentificationID,int patientID}) async{ Future getPatientInsuranceDetails({String setupID, int projectID, String patientIdentificationID, int patientID}) async {
error = ""; error = "";
hasError = false; hasError = false;
insuranceCardDetails = null; insuranceCardDetails = null;
isHaveInsuranceCard = false; isHaveInsuranceCard = false;
await baseAppClient.post(GET_PATIENT_INSURANCE_DETAILS, await baseAppClient.post(
onSuccess: (dynamic response, int statusCode) { GET_PATIENT_INSURANCE_DETAILS,
insuranceCardDetailsList.clear(); onSuccess: (dynamic response, int statusCode) {
isHaveInsuranceCard = true; insuranceCardDetailsList.clear();
response['List_PatientInsuranceDetails'].forEach((item) { isHaveInsuranceCard = true;
insuranceCardDetailsList.add(InsuranceCardDetailsModel.fromJson(item)); response['List_PatientInsuranceDetails'].forEach((item) {
}); insuranceCardDetailsList.add(InsuranceCardDetailsModel.fromJson(item));
}, onFailure: (String error, int statusCode) { });
hasError = true; },
super.error = error; onFailure: (String error, int statusCode) {
}, body:{'SetupID': setupID,'ProjectID':projectID,'PatientIdentificationID':patientIdentificationID ,'isDentalAllowedBackend':false,'PatientID':patientID},); hasError = true;
super.error = error;
},
body: {'SetupID': setupID, 'ProjectID': projectID, 'PatientIdentificationID': patientIdentificationID, 'isDentalAllowedBackend': false, 'PatientID': patientID},
);
} }
Future uploadInsuranceCard({ String patientIdentificationID,int patientID,String image=""}) async{ Future uploadInsuranceCard({String patientIdentificationID, int patientID, String image = ""}) async {
error = ""; error = "";
Map<String,dynamic> body = Map(); Map<String, dynamic> body = Map();
body['PatientID']=patientID; body['PatientID'] = patientID;
body['PatientType']=user.patientType; body['PatientType'] = user.patientType;
body['MobileNo']=user.mobileNumber; body['MobileNo'] = user.mobileNumber;
body['PatientIdentificationID']=patientIdentificationID; body['PatientIdentificationID'] = patientIdentificationID;
body['InsuranceCardImage']= image; body['InsuranceCardImage'] = image;
await baseAppClient.post(UPLOAD_INSURANCE_CARD, await baseAppClient.post(
onSuccess: (dynamic response, int statusCode) { UPLOAD_INSURANCE_CARD,
onSuccess: (dynamic response, int statusCode) {},
}, onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body:body,); },
body: body,
);
} }
} }

@ -73,7 +73,7 @@ class BloodPressureService extends BaseService {
super.error = ""; super.error = "";
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['to'] = user.emailAddress; body['To'] = user.emailAddress;
await baseAppClient.post(SEND_AVERAGE_BLOOD_PRESSURE_REPORT, await baseAppClient.post(SEND_AVERAGE_BLOOD_PRESSURE_REPORT,
onSuccess: (response, statusCode) async {}, onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {

@ -114,7 +114,7 @@ class BloodSugarService extends BaseService {
super.error = ""; super.error = "";
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
body['to'] = user.emailAddress; body['To'] = user.emailAddress;
await baseAppClient.post(SEND_AVERAGE_BLOOD_SUGAR_REPORT, await baseAppClient.post(SEND_AVERAGE_BLOOD_SUGAR_REPORT,
onSuccess: (response, statusCode) async {}, onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/perscription_pharmacy.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_inp.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_enh.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/request_get_list_pharmacy_for_prescriptions.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/request_get_list_pharmacy_for_prescriptions.dart';
@ -15,7 +16,7 @@ import 'package:flutter/cupertino.dart';
class PrescriptionsService extends BaseService { class PrescriptionsService extends BaseService {
List<Prescriptions> prescriptionsList = List(); List<Prescriptions> prescriptionsList = List();
List<PrescriptionReportINP> prescriptionReportListINP = List();
List<PrescriptionsOrder> prescriptionsOrderList = List(); List<PrescriptionsOrder> prescriptionsOrderList = List();
Future getPrescriptions() async { Future getPrescriptions() async {
@ -56,32 +57,40 @@ class PrescriptionsService extends BaseService {
appointmentNo: 0, isDentalAllowedBackend: false); appointmentNo: 0, isDentalAllowedBackend: false);
List<PrescriptionReport> prescriptionReportList = List(); List<PrescriptionReport> prescriptionReportList = List();
Future getPrescriptionReport( Future getPrescriptionReport({Prescriptions prescriptions}) async {
{Prescriptions prescriptions}) async {
hasError = false; hasError = false;
_requestPrescriptionReport.dischargeNo = prescriptions.dischargeNo; if (prescriptions.isInOutPatient == false) {
_requestPrescriptionReport.dischargeNo = prescriptions.dischargeNo;
} else {
_requestPrescriptionReport.dischargeNo = 0;
}
_requestPrescriptionReport.projectID = prescriptions.projectID; _requestPrescriptionReport.projectID = prescriptions.projectID;
_requestPrescriptionReport.clinicID = prescriptions.clinicID; _requestPrescriptionReport.clinicID = prescriptions.clinicID;
_requestPrescriptionReport.setupID = prescriptions.setupID; _requestPrescriptionReport.setupID = prescriptions.setupID;
_requestPrescriptionReport.episodeID = prescriptions.episodeID; _requestPrescriptionReport.episodeID = prescriptions.episodeID;
_requestPrescriptionReport.appointmentNo = prescriptions.appointmentNo; _requestPrescriptionReport.appointmentNo = prescriptions.appointmentNo;
await baseAppClient.post(prescriptions.isInOutPatient? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT, await baseAppClient.post(
prescriptions.isInOutPatient
? GET_PRESCRIPTION_REPORT_ENH
: GET_PRESCRIPTION_REPORT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
prescriptionReportList.clear(); prescriptionReportList.clear();
prescriptionReportEnhList.clear(); prescriptionReportEnhList.clear();
if(prescriptions.isInOutPatient){ if (prescriptions.isInOutPatient) {
response['ListPRM'].forEach((prescriptions) { response['ListPRM'].forEach((prescriptions) {
prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions)); prescriptionReportList
prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions)); .add(PrescriptionReport.fromJson(prescriptions));
prescriptionReportEnhList
.add(PrescriptionReportEnh.fromJson(prescriptions));
}); });
}else{ } else {
prescriptionReportListINP.clear();
response['INP_GetPrescriptionReport_List'].forEach((prescriptions) { response['INP_GetPrescriptionReport_List'].forEach((prescriptions) {
prescriptionReportList.add(PrescriptionReport.fromJson(prescriptions)); prescriptionReportListINP
.add(PrescriptionReportINP.fromJson(prescriptions));
}); });
} }
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
@ -90,35 +99,42 @@ class PrescriptionsService extends BaseService {
RequestSendPrescriptionEmail _requestSendPrescriptionEmail = RequestSendPrescriptionEmail _requestSendPrescriptionEmail =
RequestSendPrescriptionEmail( RequestSendPrescriptionEmail(
isDentalAllowedBackend: false,); isDentalAllowedBackend: false,
);
Future sendPrescriptionEmail(String appointmentDate, int patientID, Future sendPrescriptionEmail(String appointmentDate, int patientID,
String clinicName, String doctorName, int projectID) async { String clinicName, String doctorName, int doctorID, int projectID) async {
_requestSendPrescriptionEmail.listPrescriptions = prescriptionReportList; _requestSendPrescriptionEmail.listPrescriptions = prescriptionReportList;
_requestSendPrescriptionEmail.appointmentDate = appointmentDate; _requestSendPrescriptionEmail.appointmentDate = appointmentDate;
_requestSendPrescriptionEmail.patientID = patientID; _requestSendPrescriptionEmail.patientID = patientID;
_requestSendPrescriptionEmail.clinicName = clinicName; _requestSendPrescriptionEmail.clinicName = clinicName;
_requestSendPrescriptionEmail.doctorName = doctorName; _requestSendPrescriptionEmail.doctorName = doctorName;
_requestSendPrescriptionEmail.projectID = projectID; _requestSendPrescriptionEmail.projectID = projectID;
_requestSendPrescriptionEmail.to = user.emailAddress; _requestSendPrescriptionEmail.to = user.emailAddress;
_requestSendPrescriptionEmail.dateofBirth = user.dateofBirth; _requestSendPrescriptionEmail.dateofBirth = user.dateofBirth;
_requestSendPrescriptionEmail.patientIditificationNum = user.patientIdentificationNo; _requestSendPrescriptionEmail.patientIditificationNum =
_requestSendPrescriptionEmail.patientMobileNumber = user.mobileNumber; user.patientIdentificationNo;
_requestSendPrescriptionEmail.patientName = user.firstName +" "+ user.lastName; _requestSendPrescriptionEmail.patientMobileNumber = user.mobileNumber;
_requestSendPrescriptionEmail.setupID = user.setupID; _requestSendPrescriptionEmail.doctorID = doctorID;
_requestSendPrescriptionEmail.patientName =
user.firstName + " " + user.lastName;
_requestSendPrescriptionEmail.setupID = user.setupID;
_requestSendPrescriptionEmail.to = user.emailAddress;
hasError = false; hasError = false;
await baseAppClient.post(SEND_PRESCRIPTION_EMAIL, onSuccess: (response, statusCode) {}, await baseAppClient
.post(SEND_PRESCRIPTION_EMAIL, onSuccess: (response, statusCode) {},
onFailure: (String error, int statusCode) { onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: _requestSendPrescriptionEmail.toJson()); }, body: _requestSendPrescriptionEmail.toJson());
} }
RequestGetListPharmacyForPrescriptions requestGetListPharmacyForPrescriptions = RequestGetListPharmacyForPrescriptions( RequestGetListPharmacyForPrescriptions
requestGetListPharmacyForPrescriptions =
RequestGetListPharmacyForPrescriptions(
latitude: 0, latitude: 0,
longitude: 0, longitude: 0,
isDentalAllowedBackend: false, isDentalAllowedBackend: false,
); );
List<PharmacyPrescriptions> pharmacyPrescriptionsList = List(); List<PharmacyPrescriptions> pharmacyPrescriptionsList = List();
@ -139,18 +155,19 @@ class PrescriptionsService extends BaseService {
} }
RequestPrescriptionReportEnh _requestPrescriptionReportEnh = RequestPrescriptionReportEnh _requestPrescriptionReportEnh =
RequestPrescriptionReportEnh(isDentalAllowedBackend: false,); RequestPrescriptionReportEnh(
isDentalAllowedBackend: false,
);
List<PrescriptionReportEnh> prescriptionReportEnhList = List(); List<PrescriptionReportEnh> prescriptionReportEnhList = List();
Future getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder}) async { Future getPrescriptionReportEnh(
{PrescriptionsOrder prescriptionsOrder}) async {
///This logic copy from the old app from class [order-history.component.ts] in line 45 ///This logic copy from the old app from class [order-history.component.ts] in line 45
bool isInPatient = false; bool isInPatient = false;
prescriptionsList.forEach((element) { prescriptionsList.forEach((element) {
if (prescriptionsOrder.appointmentNo == "0") { if (prescriptionsOrder.appointmentNo == "0") {
if (element.dischargeNo == int.parse(prescriptionsOrder.dischargeID)) { if (element.dischargeNo == int.parse(prescriptionsOrder.dischargeID)) {
_requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo;
_requestPrescriptionReportEnh.clinicID = element.clinicID; _requestPrescriptionReportEnh.clinicID = element.clinicID;
_requestPrescriptionReportEnh.projectID = element.projectID; _requestPrescriptionReportEnh.projectID = element.projectID;
@ -160,46 +177,45 @@ class PrescriptionsService extends BaseService {
isInPatient = element.isInOutPatient; isInPatient = element.isInOutPatient;
} }
} else { } else {
if (int.parse(prescriptionsOrder.appointmentNo) == element.appointmentNo) { if (int.parse(prescriptionsOrder.appointmentNo) ==
element.appointmentNo) {
_requestPrescriptionReportEnh.appointmentNo = element.appointmentNo; _requestPrescriptionReportEnh.appointmentNo = element.appointmentNo;
_requestPrescriptionReportEnh.clinicID = element.clinicID; _requestPrescriptionReportEnh.clinicID = element.clinicID;
_requestPrescriptionReportEnh.projectID = element.projectID; _requestPrescriptionReportEnh.projectID = element.projectID;
_requestPrescriptionReportEnh.episodeID = element.episodeID; _requestPrescriptionReportEnh.episodeID = element.episodeID;
_requestPrescriptionReportEnh.setupID = element.setupID; _requestPrescriptionReportEnh.setupID = element.setupID;
_requestPrescriptionReportEnh.dischargeNo = element.dischargeNo; _requestPrescriptionReportEnh.dischargeNo = element.dischargeNo;
isInPatient = element.isInOutPatient;///call inpGetPrescriptionReport isInPatient = element.isInOutPatient;
///call inpGetPrescriptionReport
} }
} }
}); });
hasError = false; hasError = false;
await baseAppClient.post(isInPatient? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT, await baseAppClient.post(
isInPatient ? GET_PRESCRIPTION_REPORT_ENH : GET_PRESCRIPTION_REPORT,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
prescriptionReportEnhList.clear(); prescriptionReportEnhList.clear();
if(isInPatient){ if (isInPatient) {
response['ListPRM'].forEach((prescriptions) { response['ListPRM'].forEach((prescriptions) {
prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(prescriptions)); prescriptionReportEnhList
.add(PrescriptionReportEnh.fromJson(prescriptions));
}); });
}else{ } else {
response['INP_GetPrescriptionReport_List'].forEach((prescriptions) { response['INP_GetPrescriptionReport_List'].forEach((prescriptions) {
PrescriptionReportEnh reportEnh =
PrescriptionReportEnh reportEnh = PrescriptionReportEnh.fromJson(prescriptions); PrescriptionReportEnh.fromJson(prescriptions);
reportEnh.itemDescription = prescriptions['ItemDescriptionN']; reportEnh.itemDescription = prescriptions['ItemDescriptionN'];
prescriptionReportEnhList.add(reportEnh); prescriptionReportEnhList.add(reportEnh);
}); });
} }
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: _requestPrescriptionReportEnh.toJson()); }, body: _requestPrescriptionReportEnh.toJson());
} }
Future updatePressOrder({@required int presOrderID}) async { Future updatePressOrder({@required int presOrderID}) async {
@ -211,12 +227,10 @@ class PrescriptionsService extends BaseService {
body['PresOrderStatus'] = 4; body['PresOrderStatus'] = 4;
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
await baseAppClient.post(UPDATE_PRESS_ORDER, await baseAppClient.post(UPDATE_PRESS_ORDER,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {},
onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) { hasError = true;
hasError = true; super.error = error;
super.error = error; }, body: body);
}, body: body);
} }
} }

@ -6,6 +6,7 @@ import 'package:diplomaticquarterapp/core/model/health_calcolator/get_doctor_by_
import 'package:diplomaticquarterapp/core/model/health_calcolator/get_doctor_list_calcolation_model.dart'; import 'package:diplomaticquarterapp/core/model/health_calcolator/get_doctor_list_calcolation_model.dart';
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/health-calculator/bariatrics-service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:flutter/cupertino.dart';
import '../../../../locator.dart'; import '../../../../locator.dart';
@ -52,9 +53,9 @@ class BariatricsViewModel extends BaseViewModel {
} }
} }
void getDoctorList() async { void getDoctorList({@required DiseasesByClinic disease}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _service.getDoctorList(); await _service.getDoctorList(disease:disease);
if (_service.hasError) { if (_service.hasError) {
error = _service.error; error = _service.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -122,14 +122,17 @@ class LabsViewModel extends BaseViewModel {
error = _labsService.error; error = _labsService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
bool isShouldClear = false; /// commented out based on PAP-304
if (_labsService.labOrdersResultsList.length == 1) { // bool isShouldClear = false;
labOrdersResultsList.forEach((element) { // if (_labsService.labOrdersResultsList.length == 1) {
if (element.resultValue.contains('/') || element.resultValue.contains('*') || element.resultValue.isEmpty) // labOrdersResultsList.forEach((element) {
isShouldClear = true; // if (element.resultValue.contains('/') || element.resultValue.contains('*') || element.resultValue.isEmpty)
}); // isShouldClear = true;
} // });
if (isShouldClear) _labsService.labOrdersResultsList.clear(); // }
// if (isShouldClear)
//
// _labsService.labOrdersResultsList.clear();
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }

@ -4,7 +4,7 @@ import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_repor
import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart'; import 'package:diplomaticquarterapp/core/model/prescriptions/prescriptions_order.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_inp.dart';
import '../../../core/enum/filter_type.dart'; import '../../../core/enum/filter_type.dart';
import '../../../core/enum/viewstate.dart'; import '../../../core/enum/viewstate.dart';
import '../../../core/model/prescriptions/Prescriptions.dart'; import '../../../core/model/prescriptions/Prescriptions.dart';
@ -19,17 +19,20 @@ class PrescriptionsViewModel extends BaseViewModel {
List<PrescriptionsList> _prescriptionsOrderListClinic = List(); List<PrescriptionsList> _prescriptionsOrderListClinic = List();
List<PrescriptionsList> _prescriptionsOrderListHospital = List(); List<PrescriptionsList> _prescriptionsOrderListHospital = List();
List<PrescriptionReport> get prescriptionReportList => List<PrescriptionReport> get prescriptionReportList =>
_prescriptionsService.prescriptionReportList; _prescriptionsService.prescriptionReportList;
List<PrescriptionReportINP> get prescriptionReportListINP =>
_prescriptionsService.prescriptionReportListINP;
List<Prescriptions> get prescriptionsList => List<Prescriptions> get prescriptionsList =>
_prescriptionsService.prescriptionsList; _prescriptionsService.prescriptionsList;
List<PrescriptionsOrder> get prescriptionsHistory => _prescriptionsService.prescriptionsOrderList; List<PrescriptionsOrder> get prescriptionsHistory =>
_prescriptionsService.prescriptionsOrderList;
List<PharmacyPrescriptions> get pharmacyPrescriptionsList => _prescriptionsService.pharmacyPrescriptionsList ;
List<PharmacyPrescriptions> get pharmacyPrescriptionsList =>
_prescriptionsService.pharmacyPrescriptionsList;
List<PrescriptionsList> get prescriptionsOrderList => List<PrescriptionsList> get prescriptionsOrderList =>
filterType == FilterType.Clinic filterType == FilterType.Clinic
@ -105,7 +108,8 @@ class PrescriptionsViewModel extends BaseViewModel {
getPrescriptionReport({Prescriptions prescriptions}) async { getPrescriptionReport({Prescriptions prescriptions}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionsService.getPrescriptionReport(prescriptions: prescriptions); await _prescriptionsService.getPrescriptionReport(
prescriptions: prescriptions);
if (_prescriptionsService.hasError) { if (_prescriptionsService.hasError) {
error = _prescriptionsService.error; error = _prescriptionsService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -119,11 +123,12 @@ class PrescriptionsViewModel extends BaseViewModel {
int patientID, int patientID,
String clinicName, String clinicName,
String doctorName, String doctorName,
String mes, int doctorID,
String mes,
int projectID}) async { int projectID}) async {
setState(ViewState.BusyLocal); setState(ViewState.BusyLocal);
await _prescriptionsService.sendPrescriptionEmail( await _prescriptionsService.sendPrescriptionEmail(appointmentDate,
appointmentDate, patientID, clinicName, doctorName, projectID); patientID, clinicName, doctorName, doctorID, projectID);
if (_prescriptionsService.hasError) { if (_prescriptionsService.hasError) {
error = _prescriptionsService.error; error = _prescriptionsService.error;
setState(ViewState.ErrorLocal); setState(ViewState.ErrorLocal);
@ -145,12 +150,13 @@ class PrescriptionsViewModel extends BaseViewModel {
} }
} }
List<PrescriptionReportEnh> get prescriptionReportEnhList =>
List<PrescriptionReportEnh> get prescriptionReportEnhList => _prescriptionsService.prescriptionReportEnhList; _prescriptionsService.prescriptionReportEnhList;
getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder}) async { getPrescriptionReportEnh({PrescriptionsOrder prescriptionsOrder}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionsService.getPrescriptionReportEnh(prescriptionsOrder: prescriptionsOrder); await _prescriptionsService.getPrescriptionReportEnh(
prescriptionsOrder: prescriptionsOrder);
if (_prescriptionsService.hasError) { if (_prescriptionsService.hasError) {
error = _prescriptionsService.error; error = _prescriptionsService.error;
setState(ViewState.Error); setState(ViewState.Error);
@ -159,16 +165,14 @@ class PrescriptionsViewModel extends BaseViewModel {
} }
} }
Future updatePressOrder({@required int presOrderID}) async {
Future updatePressOrder({@required int presOrderID}) async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _prescriptionsService.updatePressOrder(presOrderID: presOrderID); await _prescriptionsService.updatePressOrder(presOrderID: presOrderID);
if (_prescriptionsService.hasError) { if (_prescriptionsService.hasError) {
error = _prescriptionsService.error; error = _prescriptionsService.error;
setState(ViewState.Error); setState(ViewState.Error);
} else { } else {
await getPrescriptions(); await getPrescriptions();
} }
} }
} }

@ -1,30 +1,29 @@
import 'package:diplomaticquarterapp/analytics/google-analytics.dart';
import 'package:diplomaticquarterapp/theme/theme_notifier.dart'; import 'package:diplomaticquarterapp/theme/theme_notifier.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/routes.dart'; import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart'; import 'package:diplomaticquarterapp/services/robo_search/search_provider.dart';
import 'package:diplomaticquarterapp/theme/theme_value.dart'; import 'package:diplomaticquarterapp/theme/theme_value.dart';
import 'package:diplomaticquarterapp/uitl/HMG_Geofence.dart';
import 'package:diplomaticquarterapp/uitl/LocalNotification.dart'; import 'package:diplomaticquarterapp/uitl/LocalNotification.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/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:firebase_analytics/firebase_analytics.dart';
import 'package:firebase_analytics/observer.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_localizations/flutter_localizations.dart'; import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'Constants.dart';
import 'config/shared_pref_kay.dart';
import 'config/size_config.dart'; import 'config/size_config.dart';
import 'core/model/geofencing/requests/GeoZonesRequestModel.dart';
import 'core/service/geofencing/GeofencingServices.dart';
import 'core/viewModels/project_view_model.dart'; import 'core/viewModels/project_view_model.dart';
import 'locator.dart'; import 'locator.dart';
import 'pages/pharmacies/compare-list.dart'; import 'pages/pharmacies/compare-list.dart';
import 'package:firebase_core/firebase_core.dart';
void main() async { void main() async {
WidgetsFlutterBinding.ensureInitialized();
FirebaseApp defaultApp = await Firebase.initializeApp();
setupLocator(); setupLocator();
runApp(MyApp()); runApp(MyApp());
} }
@ -35,6 +34,7 @@ class MyApp extends StatefulWidget {
} }
class _MyApp extends State<MyApp> { class _MyApp extends State<MyApp> {
@override @override
void initState() { void initState() {
// ProjectViewModel projectProvider; // ProjectViewModel projectProvider;
@ -52,6 +52,7 @@ class _MyApp extends State<MyApp> {
.showNow(title: "Payload", subtitle: payload, payload: payload); .showNow(title: "Payload", subtitle: payload, payload: payload);
}); });
// final themeNotifier = Provider.of<ThemeNotifier>(context); // final themeNotifier = Provider.of<ThemeNotifier>(context);
precacheImage(AssetImage('assets/images/powerd-by.jpg'), context); precacheImage(AssetImage('assets/images/powerd-by.jpg'), context);
return LayoutBuilder( return LayoutBuilder(
@ -82,6 +83,9 @@ class _MyApp extends State<MyApp> {
], ],
child: Consumer<ProjectViewModel>( child: Consumer<ProjectViewModel>(
builder: (context, projectProvider, child) => MaterialApp( builder: (context, projectProvider, child) => MaterialApp(
navigatorObservers: [
GAnalytics.shared.navObserver()
],
showSemanticsDebugger: false, showSemanticsDebugger: false,
title: 'Diplomatic Quarter App', title: 'Diplomatic Quarter App',
locale: projectProvider.appLocal, locale: projectProvider.appLocal,

@ -61,71 +61,72 @@ class AuthenticatedUser {
dynamic tempAddress; dynamic tempAddress;
dynamic zipCode; dynamic zipCode;
dynamic isFamily; dynamic isFamily;
dynamic cRSVerificationStatus;
// dynamic patientPayType; // dynamic patientPayType;
// dynamic patientType; // dynamic patientType;
// dynamic status; // dynamic status;
AuthenticatedUser({ AuthenticatedUser(
this.setupID, {this.setupID,
this.patientType, this.patientType,
this.patientID, this.patientID,
this.firstName, this.firstName,
this.middleName, this.middleName,
this.lastName, this.lastName,
this.firstNameN, this.firstNameN,
this.middleNameN, this.middleNameN,
this.lastNameN, this.lastNameN,
this.relationshipID, this.relationshipID,
this.gender, this.gender,
this.dateofBirth, this.dateofBirth,
this.dateofBirthN, this.dateofBirthN,
this.nationalityID, this.nationalityID,
this.phoneResi, this.phoneResi,
this.phoneOffice, this.phoneOffice,
this.mobileNumber, this.mobileNumber,
this.faxNumber, this.faxNumber,
this.emailAddress, this.emailAddress,
this.bloodGroup, this.bloodGroup,
this.rHFactor, this.rHFactor,
this.isEmailAlertRequired, this.isEmailAlertRequired,
this.isSMSAlertRequired, this.isSMSAlertRequired,
this.preferredLanguage, this.preferredLanguage,
this.isPrivilegedMember, this.isPrivilegedMember,
this.memberID, this.memberID,
this.expiryDate, this.expiryDate,
this.isHmgEmployee, this.isHmgEmployee,
this.employeeID, this.employeeID,
this.emergencyContactName, this.emergencyContactName,
this.emergencyContactNo, this.emergencyContactNo,
this.patientPayType, this.patientPayType,
this.dHCCPatientRefID, this.dHCCPatientRefID,
this.isPatientDummy, this.isPatientDummy,
this.status, this.status,
this.isStatusCleared, this.isStatusCleared,
this.patientIdentificationType, this.patientIdentificationType,
this.patientIdentificationNo, this.patientIdentificationNo,
this.projectID, this.projectID,
this.infoSourceID, this.infoSourceID,
this.address, this.address,
this.age, this.age,
this.ageDesc, this.ageDesc,
this.areaID, this.areaID,
this.createdBy, this.createdBy,
this.genderDescription, this.genderDescription,
this.iR, this.iR,
this.iSOCityID, this.iSOCityID,
this.iSOCountryID, this.iSOCountryID,
this.listPrivilege, this.listPrivilege,
this.marital, this.marital,
this.outSA, this.outSA,
this.pOBox, this.pOBox,
this.receiveHealthSummaryReport, this.receiveHealthSummaryReport,
this.sourceType, this.sourceType,
this.strDateofBirth, this.strDateofBirth,
this.tempAddress, this.tempAddress,
this.zipCode, this.zipCode,
this.isFamily this.isFamily,
}); this.cRSVerificationStatus});
AuthenticatedUser.fromJson(Map<String, dynamic> json) { AuthenticatedUser.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID']; setupID = json['SetupID'];
@ -193,6 +194,7 @@ class AuthenticatedUser {
tempAddress = json['TempAddress']; tempAddress = json['TempAddress'];
zipCode = json['ZipCode']; zipCode = json['ZipCode'];
isFamily = json['IsFamily']; isFamily = json['IsFamily'];
cRSVerificationStatus = json['CRSVerificationStatus'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -259,6 +261,7 @@ class AuthenticatedUser {
data['TempAddress'] = this.tempAddress; data['TempAddress'] = this.tempAddress;
data['ZipCode'] = this.zipCode; data['ZipCode'] = this.zipCode;
data['IsFamily'] = this.isFamily; data['IsFamily'] = this.isFamily;
data['CRSVerificationStatus'] = this.cRSVerificationStatus;
return data; return data;
} }
} }

@ -17,6 +17,7 @@ import 'package:diplomaticquarterapp/pages/DrawerPages/family/my-family.dart';
import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart'; import 'package:diplomaticquarterapp/pages/ErService/ErOptions.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart'; import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart'; import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart'; import 'package:diplomaticquarterapp/pages/livecare/livecare_home.dart';
import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart'; import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart';
import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart'; import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart';
@ -281,12 +282,10 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
title: TranslationBase.of(context).childVaccine, title: TranslationBase.of(context).childVaccine,
), ),
ServicesContainer( ServicesContainer(
onTap: () => Navigator.push( onTap: (){
context, Navigator.pop(context);
FadePage( LandingPage.shared.switchToDoFromHMGServices();
page: ToDo(isShowAppBar: true), },
),
),
imageLocation: imageLocation:
'assets/images/new-design/upcoming_icon_bottom_bar.png', 'assets/images/new-design/upcoming_icon_bottom_bar.png',
title: TranslationBase.of(context).todoList, title: TranslationBase.of(context).todoList,

@ -14,6 +14,7 @@ import 'package:flutter/material.dart';
import 'package:flutter/painting.dart'; import 'package:flutter/painting.dart';
import 'package:flutter/services.dart'; import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart'; import 'package:flutter/widgets.dart';
import 'package:manage_calendar_events/manage_calendar_events.dart';
import 'package:shared_preferences/shared_preferences.dart'; import 'package:shared_preferences/shared_preferences.dart';
import 'Dialog/setting_page_radio_button_list_dialog.dart'; import 'Dialog/setting_page_radio_button_list_dialog.dart';
@ -53,14 +54,14 @@ class _H2oSettingState extends State<H2oSetting> {
void initState() { void initState() {
super.initState(); super.initState();
_userDetailModel = widget.userDetailModel; _userDetailModel = widget.userDetailModel;
_heightValue = _userDetailModel.height; _heightValue = _userDetailModel?.height ?? 100;
_weightValue = _userDetailModel.weight; _weightValue = _userDetailModel?.weight ?? 50;
_heightController.text = _heightValue.toStringAsFixed(0); _heightController.text = _heightValue.toStringAsFixed(0);
_weightController.text = _weightValue.toStringAsFixed(0); _weightController.text = _weightValue.toStringAsFixed(0);
_nameController.text = _userDetailModel.firstName; _nameController.text = _userDetailModel.firstName;
_isWeightKG = _userDetailModel.isWeightInKG; _isWeightKG = _userDetailModel?.isWeightInKG ?? true;
_isHeightCM = _userDetailModel.isHeightInCM; _isHeightCM = _userDetailModel?.isHeightInCM ?? true;
_isGenderMale = _userDetailModel.gender == "M" ? true : false; _isGenderMale = (_userDetailModel?.gender ?? "M") == "M" ? true : false;
_dobDate = DateUtil.convertStringToDate(_userDetailModel.dOB); _dobDate = DateUtil.convertStringToDate(_userDetailModel.dOB);
_selectedActiveLevel = _userDetailModel.activityID ?? 1; _selectedActiveLevel = _userDetailModel.activityID ?? 1;
readPrefs(); readPrefs();
@ -70,6 +71,7 @@ class _H2oSettingState extends State<H2oSetting> {
void readPrefs() async { void readPrefs() async {
prefs = await SharedPreferences.getInstance(); prefs = await SharedPreferences.getInstance();
_isUnitML = (prefs.getString(H2O_UNIT) ?? "ml") == "ml" ? true : false; _isUnitML = (prefs.getString(H2O_UNIT) ?? "ml") == "ml" ? true : false;
_selectedRemindedTime = prefs.getInt(H2O_REMINDER) ?? 0;
setState(() {}); setState(() {});
} }
@ -450,14 +452,35 @@ class _H2oSettingState extends State<H2oSetting> {
_userDetailModel.dOB = tempDate; _userDetailModel.dOB = tempDate;
_userDetailModel.activityID = _selectedActiveLevel; _userDetailModel.activityID = _selectedActiveLevel;
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
await prefs.setString(H2O_UNIT, _isUnitML ? "ml" : "l"); await widget.viewModel.updateUserDetail(_userDetailModel, (tag) async {
await widget.viewModel.updateUserDetail(_userDetailModel, (tag) {
if (tag) { if (tag) {
AppToast.showSuccessToast(message: TranslationBase.of(context).success); AppToast.showSuccessToast(message: TranslationBase.of(context).success);
await prefs.setString(H2O_UNIT, _isUnitML ? "ml" : "l");
int _tempRemindTime = prefs.getInt(H2O_REMINDER) ?? _selectedRemindedTime;
if (_tempRemindTime != _selectedRemindedTime) {
await prefs.setInt(H2O_REMINDER, _selectedRemindedTime);
_addReminderToCalender(_selectedRemindedTime);
}
} }
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
}); });
Navigator.pop(context); Navigator.pop(context);
} }
final CalendarPlugin _myPlugin = CalendarPlugin();
void _addReminderToCalender(int _selectedRemindedTime) async {
bool _calendarPermission = await _myPlugin.hasPermissions();
if (_calendarPermission) {
} else {
await _myPlugin.requestPermissions();
}
_myPlugin.hasPermissions().then((value) {
if (!value) {
_myPlugin.requestPermissions();
} else {
_myPlugin.getCalendars().then((value) => {print(value.length)});
}
});
}
} }

@ -99,17 +99,8 @@ class _BariatricsPageState extends State<BariatricsPage> {
handler: () async { handler: () async {
Navigator.push( Navigator.push(
context, context,
FadePage(page: DoctorList()), FadePage(page: DoctorList(diseaseByClinic: _selectedDisease,)),
); );
// await model.searchDoctorsByTime(_selectedDisease);
// if (model.state == ViewState.ErrorLocal) {
// AppToast.showErrorToast(message: model.error);
// } else {}
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => BariatricsPage()),
// );
}, },
), ),
), ),
@ -131,15 +122,6 @@ class _BariatricsPageState extends State<BariatricsPage> {
context, context,
FadePage(page: DoctorList()), FadePage(page: DoctorList()),
); );
await model.searchDoctorsByTime(_selectedDisease);
if (model.state == ViewState.ErrorLocal) {
AppToast.showErrorToast(message: model.error);
}
// Navigator.push(
// context,
// MaterialPageRoute(builder: (context) => BariatricsPage()),
// );
}, },
), ),
), ),

@ -6,8 +6,10 @@ 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/services.dart'; import 'package:flutter/services.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'dart:math'; import 'dart:math';
import '../health_calc_desc.dart';
import 'result_page.dart'; import 'result_page.dart';
const activeCardColor = Color(0xff70777A); const activeCardColor = Color(0xff70777A);
@ -121,7 +123,25 @@ class _BMICalculatorState extends State<BMICalculator> {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
isShowDecPage: false, isShowDecPage: false,
appBarTitle: "${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}", showHomeAppBarIcon: false,
appBarIcons: [
IconButton(
icon: Icon(Icons.info_outline),
color: Colors.white,
onPressed: () {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) => HealthDescPage(
"${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}",
TranslationBase.of(context).bmiCalcDesc,
"assets/images/AlHabibMedicalService/health_calculator/bmi.png")),
);
},
)
],
appBarTitle:
"${TranslationBase.of(context).bmi} ${TranslationBase.of(context).calcHealth}",
body: SingleChildScrollView( body: SingleChildScrollView(
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment: CrossAxisAlignment.center,
@ -158,7 +178,8 @@ class _BMICalculatorState extends State<BMICalculator> {
Row( Row(
children: [ children: [
Padding( Padding(
padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 8.0), padding: EdgeInsets.symmetric(
vertical: 10.0, horizontal: 8.0),
child: Center( child: Center(
child: Container( child: Container(
width: 60.0, width: 60.0,
@ -179,7 +200,8 @@ class _BMICalculatorState extends State<BMICalculator> {
Container( Container(
height: 38.0, height: 38.0,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Container( Container(
@ -261,15 +283,18 @@ class _BMICalculatorState extends State<BMICalculator> {
color: Colors.grey.withOpacity(0.5), color: Colors.grey.withOpacity(0.5),
spreadRadius: 3, spreadRadius: 3,
blurRadius: 7, blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow offset:
Offset(0, 3), // changes position of shadow
), ),
], ],
color: cmCard, color: cmCard,
borderRadius: BorderRadius.circular(3.0), borderRadius: BorderRadius.circular(3.0),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(vertical: 0.0, horizontal: 18.0), padding: const EdgeInsets.symmetric(
child: Center(child: Texts(TranslationBase.of(context).cm)), vertical: 0.0, horizontal: 18.0),
child: Center(
child: Texts(TranslationBase.of(context).cm)),
), ),
), ),
), ),
@ -290,13 +315,16 @@ class _BMICalculatorState extends State<BMICalculator> {
color: Colors.grey.withOpacity(0.5), color: Colors.grey.withOpacity(0.5),
spreadRadius: 3, spreadRadius: 3,
blurRadius: 7, blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow offset:
Offset(0, 3), // changes position of shadow
), ),
], ],
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0), padding:
child: Center(child: Texts(TranslationBase.of(context).feet)), const EdgeInsets.symmetric(horizontal: 16.0),
child: Center(
child: Texts(TranslationBase.of(context).feet)),
), ),
), ),
), ),
@ -328,7 +356,8 @@ class _BMICalculatorState extends State<BMICalculator> {
Row( Row(
children: [ children: [
Padding( Padding(
padding: EdgeInsets.symmetric(vertical: 10.0, horizontal: 8.0), padding: EdgeInsets.symmetric(
vertical: 10.0, horizontal: 8.0),
child: Center( child: Center(
child: Container( child: Container(
width: 60.0, width: 60.0,
@ -349,7 +378,8 @@ class _BMICalculatorState extends State<BMICalculator> {
Container( Container(
height: 38.0, height: 38.0,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.center, crossAxisAlignment:
CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Container( Container(
@ -431,15 +461,18 @@ class _BMICalculatorState extends State<BMICalculator> {
color: Colors.grey.withOpacity(0.5), color: Colors.grey.withOpacity(0.5),
spreadRadius: 3, spreadRadius: 3,
blurRadius: 7, blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow offset:
Offset(0, 3), // changes position of shadow
), ),
], ],
color: kgCard, color: kgCard,
borderRadius: BorderRadius.circular(3.0), borderRadius: BorderRadius.circular(3.0),
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(vertical: 0.0, horizontal: 18.0), padding: const EdgeInsets.symmetric(
child: Center(child: Texts(TranslationBase.of(context).kg)), vertical: 0.0, horizontal: 18.0),
child: Center(
child: Texts(TranslationBase.of(context).kg)),
), ),
), ),
), ),
@ -460,13 +493,17 @@ class _BMICalculatorState extends State<BMICalculator> {
color: Colors.grey.withOpacity(0.5), color: Colors.grey.withOpacity(0.5),
spreadRadius: 3, spreadRadius: 3,
blurRadius: 7, blurRadius: 7,
offset: Offset(0, 3), // changes position of shadow offset:
Offset(0, 3), // changes position of shadow
), ),
], ],
), ),
child: Padding( child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 16.0), padding:
child: Center(child: Texts(TranslationBase.of(context).pound)), const EdgeInsets.symmetric(horizontal: 16.0),
child: Center(
child:
Texts(TranslationBase.of(context).pound)),
), ),
), ),
), ),

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/HealthCalculator/DiseasesByClinic.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/health-calculator/Bariatrics-viewmodel.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/health-calculator/Bariatrics-viewmodel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -8,13 +9,14 @@ import 'package:flutter/material.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
class DoctorList extends StatelessWidget { class DoctorList extends StatelessWidget {
const DoctorList({Key key}) : super(key: key); DiseasesByClinic diseaseByClinic;
DoctorList({Key key, this.diseaseByClinic}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<BariatricsViewModel>( return BaseView<BariatricsViewModel>(
allowAny: true, allowAny: true,
onModelReady: (model) => model.getDoctorList(), onModelReady: (model) => model.getDoctorList(disease: diseaseByClinic),
builder: (BuildContext context, BariatricsViewModel model, Widget child) => AppScaffold( builder: (BuildContext context, BariatricsViewModel model, Widget child) => AppScaffold(
isShowDecPage: false, isShowDecPage: false,
isShowAppBar: true, isShowAppBar: true,

@ -0,0 +1,40 @@
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
class HealthDescPage extends StatelessWidget {
final String title;
final String desc;
final String icon;
HealthDescPage(this.title, this.desc, this.icon);
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
appBarTitle: title,
body: Container(
margin: EdgeInsets.all(8.0),
child: Row(
children: [
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Image.asset(
icon,
fit: BoxFit.cover,
height: 80,
),
),
Expanded(
child: Text(
desc,
style: TextStyle(fontSize: 18.0),
),
)
],
),
),
);
}
}

@ -8,7 +8,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:maps_launcher/maps_launcher.dart'; import 'package:maps_launcher/maps_launcher.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import '../../d_q_icons_icons.dart'; import '../../d_q_icons_icons.dart';
class ParkingPage extends StatelessWidget { class ParkingPage extends StatelessWidget {
@ -19,6 +19,13 @@ class ParkingPage extends StatelessWidget {
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).parking, appBarTitle: TranslationBase.of(context).parking,
description: TranslationBase.of(context).parkingDescription,
imagesInfo: [
ImagesInfo(
imageAr: 'assets/images/bc_parking.png',
imageEn: 'assets/images/bc_parking.png',
isAsset: true)
],
body: SingleChildScrollView( body: SingleChildScrollView(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
child: !model.isSavePark child: !model.isSavePark

@ -13,8 +13,10 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; 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/dialogs/confirm_dialog.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:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:nfc_in_flutter/nfc_in_flutter.dart';
class QRCode extends StatefulWidget { class QRCode extends StatefulWidget {
PatientShareResponse patientShareResponse; PatientShareResponse patientShareResponse;
@ -30,17 +32,27 @@ class QRCode extends StatefulWidget {
class _QRCodeState extends State<QRCode> { class _QRCodeState extends State<QRCode> {
Uint8List _bytes; Uint8List _bytes;
bool _supportsNFC = false;
BuildContext _context;
@override @override
void initState() { void initState() {
// TODO: implement initState // TODO: implement initState
_bytes = base64.decode(widget.appoQR.split(',').last); _bytes = base64.decode(widget.appoQR.split(',').last);
widget.authUser = new AuthenticatedUser(); widget.authUser = new AuthenticatedUser();
NFC.isNDEFSupported.then((supported) {
setState(() {
print("nfc supprted");
_supportsNFC = true;
});
});
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
_context = context;
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).attendRegisterCode, appBarTitle: TranslationBase.of(context).attendRegisterCode,
isShowAppBar: true, isShowAppBar: true,
@ -51,9 +63,56 @@ class _QRCodeState extends State<QRCode> {
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Container( Container(
margin: EdgeInsets.only(top: 30.0), width: double.infinity,
alignment: Alignment.center, height: MediaQuery.of(context).size.width / 3,
child: Image.memory(_bytes, scale: 0.5), child: Row(
children: [
_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: () {
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( Container(
margin: EdgeInsets.only(top: 20.0, left: 20.0, right: 20.0), margin: EdgeInsets.only(top: 20.0, left: 20.0, right: 20.0),
@ -70,18 +129,20 @@ class _QRCodeState extends State<QRCode> {
EdgeInsets.only(top: 10.0, left: 40.0, bottom: 10.0), EdgeInsets.only(top: 10.0, left: 40.0, bottom: 10.0),
child: Image.asset( child: Image.asset(
"assets/images/new-design/device_icon.png", "assets/images/new-design/device_icon.png",
width: 120.0, width: MediaQuery.of(context).size.width / 3.4,
height: 120.0), height: MediaQuery.of(context).size.width / 3.4),
), ),
Container( Expanded(
width: MediaQuery.of(context).size.width * 0.5, child: Container(
margin: EdgeInsets.only( width: double.infinity,
top: 15.0, bottom: 10.0, left: 20.0, right: 20.0), margin: EdgeInsets.only(
child: Text(TranslationBase.of(context).scanQRHospital, top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
style: TextStyle( child: Text(TranslationBase.of(context).scanQRHospital,
color: Colors.red[700], style: TextStyle(
fontSize: 20.0, color: Colors.red[700],
fontWeight: FontWeight.bold)), fontSize: 18.0,
fontWeight: FontWeight.bold)),
),
), ),
], ],
), ),
@ -300,4 +361,51 @@ class _QRCodeState extends State<QRCode> {
} }
return docSpeciality; 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();
},
),
],
);
},
);
}
} }

@ -1,8 +1,12 @@
import 'dart:convert';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart'; import 'package:diplomaticquarterapp/uitl/location_util.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 '../../uitl/translations_delegate_base.dart'; import '../../uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart'; import 'package:diplomaticquarterapp/pages/ErService/widgets/card_common.dart';
@ -23,6 +27,7 @@ class ErOptions extends StatefulWidget {
class _ErOptionsState extends State<ErOptions> { class _ErOptionsState extends State<ErOptions> {
LocationUtils locationUtils; LocationUtils locationUtils;
ProjectViewModel projectViewModel;
@override @override
void initState() { void initState() {
@ -35,6 +40,9 @@ class _ErOptionsState extends State<ErOptions> {
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of<ProjectViewModel>(context);
final rrtLocked = !projectViewModel.havePrivilege(68);
return AppScaffold( return AppScaffold(
isShowAppBar: widget.isAppbar, isShowAppBar: widget.isAppbar,
appBarTitle: TranslationBase.of(context).bookAppo, appBarTitle: TranslationBase.of(context).bookAppo,
@ -46,6 +54,7 @@ class _ErOptionsState extends State<ErOptions> {
children: <Widget>[ children: <Widget>[
Container( Container(
height: 170,
margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0),
child: Row( child: Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
@ -83,6 +92,7 @@ class _ErOptionsState extends State<ErOptions> {
), ),
Container( Container(
margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0), margin: EdgeInsets.fromLTRB(0.0, 10.0, 0.0, 10.0),
height: 170,
child: Row( child: Row(
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
@ -95,14 +105,24 @@ class _ErOptionsState extends State<ErOptions> {
onTap: (){ onTap: (){
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(page: DdServicesPage())
page: DdServicesPage())); );
}, },
), ),
), ),
Expanded( Expanded(
child: Container(), child: CardCommonEr(
locked: rrtLocked,
image: 'assets/images/new-design/AM.PNG',
text: TranslationBase.of(context).rrtService,
subText: TranslationBase.of(context).RapidResponseTeam,
onTap:(){
Navigator.push(
context,
FadePage(
page: NearestEr()));
}),
) )
], ],
), ),

@ -10,51 +10,72 @@ class CardCommonEr extends StatelessWidget {
final image; final image;
final text; final text;
final subText; final subText;
final bool locked;
final Function onTap; final Function onTap;
const CardCommonEr( const CardCommonEr(
{@required this.image, {
@required this.text, this.locked = false,
@required this.subText, @required this.image,
@required this.onTap}); @required this.text,
@required this.subText,
@required this.onTap,
});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return GestureDetector( return GestureDetector(
onTap: () => onTap(), onTap: locked ? null : onTap,
child: Container( child: Opacity(
margin: EdgeInsets.fromLTRB(9.0, 9.0, 9.0, 9.0), opacity: locked ? 0.25 : 1.0,
decoration: BoxDecoration(boxShadow: [ child: Stack(
BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0) children: [
], borderRadius: BorderRadius.circular(10), color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container( Container(
margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), margin: EdgeInsets.fromLTRB(9.0, 9.0, 9.0, 9.0),
child: Text(this.text, decoration: BoxDecoration(boxShadow: [
overflow: TextOverflow.clip, BoxShadow(color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)
style: TextStyle( ], borderRadius: BorderRadius.circular(10), color: Colors.white),
color: new Color(0xFFc5272d), child: Column(
letterSpacing: 1.0, crossAxisAlignment: CrossAxisAlignment.start,
fontSize: 20.0)), children: <Widget>[
Container(
margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
child: Text(this.text,
overflow: TextOverflow.clip,
style: TextStyle(
color: new Color(0xFFc5272d),
letterSpacing: 1.0,
fontSize: 20.0)),
),
Container(
margin: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0),
child: Text(this.subText,
overflow: TextOverflow.clip,
style: TextStyle(
color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)),
),
Spacer(),
Container(
alignment: Alignment.bottomRight,
margin: EdgeInsets.fromLTRB(0.0, 0.0, 10.0, 8.0),
child: Image.asset(this.image, width: 60.0, height: 60.0),
),
],
), ),
Container( ),
margin: EdgeInsets.fromLTRB(10.0, 0.0, 10.0, 0.0), if(locked)
child: Text(this.subText, Align(
overflow: TextOverflow.clip, alignment: Alignment.center,
style: TextStyle( child: lock()
color: Colors.black, letterSpacing: 1.0, fontSize: 15.0)), )
), ] ,
Container(
alignment: Alignment.bottomRight,
margin: EdgeInsets.fromLTRB(0.0, 0.0, 10.0, 8.0),
child: Image.asset(this.image, width: 60.0, height: 60.0),
),
],
), ),
), ),
); );
} }
Widget lock(){
return Container(child: Icon(Icons.lock_rounded, size: 80),);
}
} }

@ -92,9 +92,16 @@ class _ToDoState extends State<ToDo> {
padding: EdgeInsets.all(0.0), padding: EdgeInsets.all(0.0),
itemCount: widget.appoList.length, itemCount: widget.appoList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
print("ttt "+getNextActionImage(widget
.appoList[index]
.nextAction));
print("ttt "+widget
.appoList[index]
.nextAction.toString());
return Container( return Container(
margin: EdgeInsets.all(10.0), margin: EdgeInsets.all(10.0),
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [ children: [
Container( Container(
child: Card( child: Card(
@ -366,44 +373,32 @@ class _ToDoState extends State<ToDo> {
color: Color(0xff20bc44), color: Color(0xff20bc44),
), ),
height: 30.0, height: 30.0,
margin: projectViewModel.isArabic padding: EdgeInsets.only(right:15),
? EdgeInsets.fromLTRB(160.0, 0.0, 30.0, 0.0) margin: EdgeInsets.symmetric(horizontal:20),
: EdgeInsets.fromLTRB(20.0, 0.0, 160.0, 0.0),
transform: Matrix4.translationValues(0.0, -8.0, 0.0), transform: Matrix4.translationValues(0.0, -8.0, 0.0),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.start, mainAxisAlignment: MainAxisAlignment.start,
children: [ children: [
widget.appoList[index].isLiveCareAppointment widget.appoList[index].isLiveCareAppointment
? Container( ? Image.asset(
margin: EdgeInsets.fromLTRB( "assets/images/new-design/video.png")
5.0, 0.0, 5.0, 0.0), : Image.asset(
child: Image.asset( "assets/images/new-design/walkin.png"),
"assets/images/new-design/video.png"),
)
: Container(
margin: EdgeInsets.fromLTRB(
5.0, 0.0, 5.0, 0.0),
child: Image.asset(
"assets/images/new-design/walkin.png"),
),
widget.appoList[index].isLiveCareAppointment widget.appoList[index].isLiveCareAppointment
? Container( ? Text(
child: Text( TranslationBase.of(context).videoAppo,
TranslationBase.of(context).videoAppo, style: TextStyle(
style: TextStyle( color: Colors.white,
color: Colors.white, fontWeight: FontWeight.bold,
fontWeight: FontWeight.bold, fontSize: 11.0))
fontSize: 11.0)), : Text(
) TranslationBase.of(context)
: Container( .walkinAppo,
child: Text( style: TextStyle(
TranslationBase.of(context) color: Colors.white,
.walkinAppo, fontWeight: FontWeight.bold,
style: TextStyle( fontSize: 11.0))
color: Colors.white,
fontWeight: FontWeight.bold,
fontSize: 11.0)),
)
], ],
), ),
), ),
@ -459,6 +454,10 @@ class _ToDoState extends State<ToDo> {
return "assets/images/new-design/waiting_for_doctor.png"; return "assets/images/new-design/waiting_for_doctor.png";
break; break;
case 90:
return "assets/images/new-design/check-in.png";
break;
default: default:
return ""; return "";
} }
@ -480,6 +479,9 @@ class _ToDoState extends State<ToDo> {
break; break;
case 60: case 60:
break; break;
case 90:
getAppoQR(context, appo);
break;
} }
} }
@ -516,6 +518,10 @@ class _ToDoState extends State<ToDo> {
return TranslationBase.of(context).waitingForDoctor; return TranslationBase.of(context).waitingForDoctor;
break; break;
case 90:
return TranslationBase.of(context).checkinOptions;
break;
default: default:
return ""; return "";
} }

@ -19,6 +19,7 @@ import 'package:diplomaticquarterapp/widgets/others/floating_button_search.dart'
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:speech_to_text/speech_recognition_error.dart'; import 'package:speech_to_text/speech_recognition_error.dart';
import 'dart:convert'; import 'dart:convert';
import 'dart:io'; import 'dart:io';
@ -167,7 +168,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Texts( Texts(
appointHistory.doctorNameObj, appointHistory.doctorNameObj,
@ -176,8 +177,8 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
Texts( Texts(
DateUtil DateUtil
.getMonthDayYearDateFormatted( .getMonthDayYearDateFormatted(
appointHistory appointHistory
.appointmentDate), .appointmentDate),
variant: 'caption3', variant: 'caption3',
), ),
StarRating( StarRating(
@ -235,7 +236,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
flex: 4, flex: 4,
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment.start, CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Padding( Padding(
padding: const EdgeInsets.all(10.0), padding: const EdgeInsets.all(10.0),
@ -246,11 +247,11 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
child: LargeAvatar( child: LargeAvatar(
name: model name: model
.appointHistoryList[ .appointHistoryList[
index] index]
.doctorNameObj, .doctorNameObj,
url: model url: model
.appointHistoryList[ .appointHistoryList[
index] index]
.doctorImageURL, .doctorImageURL,
), ),
), ),
@ -260,27 +261,27 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment:
CrossAxisAlignment CrossAxisAlignment
.start, .start,
children: <Widget>[ children: <Widget>[
Texts( Texts(
model model
.appointHistoryList[ .appointHistoryList[
index] index]
.doctorNameObj, .doctorNameObj,
bold: true, bold: true,
), ),
Texts( Texts(
DateUtil.getMonthDayYearDateFormatted(model DateUtil.getMonthDayYearDateFormatted(model
.appointHistoryList[ .appointHistoryList[
index] index]
.appointmentDate), .appointmentDate),
variant: 'caption3', variant: 'caption3',
), ),
StarRating( StarRating(
totalAverage: model totalAverage: model
.appointHistoryList[ .appointHistoryList[
index] index]
.doctorRate .doctorRate
.toDouble(), .toDouble(),
forceStars: true), forceStars: true),
@ -326,9 +327,9 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
fontSize: 13.5, fontSize: 13.5,
hintColor: Colors.black, hintColor: Colors.black,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
onChanged: (v){setState(() { onChanged: (v) {
setState(() {});
});}, },
validator: (value) { validator: (value) {
if (value.isEmpty) if (value.isEmpty)
return TranslationBase.of(context).emptySubject; return TranslationBase.of(context).emptySubject;
@ -349,11 +350,13 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
controller: messageController, controller: messageController,
suffixIcon: Icons.mic, suffixIcon: Icons.mic,
onSuffixTap: () { onSuffixTap: () {
requestPermissions();
openSpeechReco(); openSpeechReco();
}, },
onChanged: (v){setState(() { onChanged: (v) {
setState(() {});
});}, },
validator: (value) { validator: (value) {
if (value.isEmpty) if (value.isEmpty)
return TranslationBase.of(context).emptyMessage; return TranslationBase.of(context).emptyMessage;
@ -364,11 +367,11 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
InkWell( InkWell(
onTap: () { onTap: () {
ImageOptions.showImageOptions(context, ImageOptions.showImageOptions(context,
(String image, File file) { (String image, File file) {
setState(() { setState(() {
images.add(image); images.add(image);
}); });
}); });
}, },
child: Container( child: Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15), margin: EdgeInsets.only(left: 10, right: 10, top: 15),
@ -397,39 +400,39 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
), ),
...List.generate( ...List.generate(
images.length, images.length,
(index) => Container( (index) => Container(
margin: EdgeInsets.all(10), margin: EdgeInsets.all(10),
padding: EdgeInsets.all(8.0), padding: EdgeInsets.all(8.0),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: <Widget>[
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Icon(FontAwesomeIcons.paperclip), Row(
SizedBox( crossAxisAlignment: CrossAxisAlignment.start,
width: 8, children: <Widget>[
), Icon(FontAwesomeIcons.paperclip),
Texts( SizedBox(
'image ${index + 1}.png', width: 8,
),
Texts(
'image ${index + 1}.png',
),
],
), ),
InkWell(
onTap: () {
setState(() {
images.remove(images[index]);
});
},
child: Icon(
FontAwesomeIcons.trashAlt,
color: Colors.red[300],
))
], ],
), ),
InkWell( )),
onTap: () {
setState(() {
images.remove(images[index]);
});
},
child: Icon(
FontAwesomeIcons.trashAlt,
color: Colors.red[300],
))
],
),
)),
SizedBox( SizedBox(
height: 45, height: 100,
), ),
], ],
), ),
@ -437,7 +440,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: 80.0, height: 80,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(15.0), padding: EdgeInsets.all(15.0),
child: Center( child: Center(
@ -447,22 +450,21 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
label: TranslationBase.of(context).send, label: TranslationBase.of(context).send,
textColor: Colors.white, textColor: Colors.white,
disabled: (titleController.text.toString().isEmpty || disabled: (titleController.text.toString().isEmpty ||
messageController.text.toString().isEmpty ), messageController.text.toString().isEmpty),
onTap: () { onTap: () {
final form = formKey.currentState; final form = formKey.currentState;
if (form.validate()) { if (form.validate()) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
model model
.sendCOCItem( .sendCOCItem(
title: titleController.text, title: titleController.text,
attachment: images.length > 0 ? images[0] : "", attachment: images.length > 0 ? images[0] : "",
details: messageController.text, details: messageController.text,
cOCTypeName: getCOCName(), cOCTypeName: getCOCName(),
appointHistory: messageType == appointHistory: messageType ==
MessageType.ComplaintOnAnAppointment MessageType.ComplaintOnAnAppointment
? appointHistory ? appointHistory
: null) : null)
.then((value) { .then((value) {
if (value) { if (value) {
setState(() { setState(() {
@ -479,7 +481,6 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
} }
}); });
} }
}, },
), ),
@ -544,7 +545,7 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
if (available) { if (available) {
speech.listen( speech.listen(
onResult: resultListener, onResult: resultListener,
// listenMode: ListenMode.confirmation, listenMode: stt.ListenMode.confirmation,
localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA', localeId: _currentLocaleId == 'en' ? 'en-US' : 'ar-SA',
); );
} else { } else {
@ -552,12 +553,23 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
} }
} }
void errorListener(SpeechRecognitionError error) {} void errorListener(SpeechRecognitionError error) {
event.setValue({"searchText": 'null'});
//SpeechToText.closeAlertDialog(context);
print(error);
}
void statusListener(String status) { void statusListener(String status) {
reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....'; reconizedWord = status == 'listening' ? 'Lisening...' : 'Sorry....';
} }
void requestPermissions() async {
Map<Permission, PermissionStatus> statuses = await [
Permission.microphone,
].request();
print(statuses);
}
void resultListener(result) { void resultListener(result) {
reconizedWord = result.recognizedWords; reconizedWord = result.recognizedWords;
event.setValue({"searchText": reconizedWord}); event.setValue({"searchText": reconizedWord});
@ -565,10 +577,18 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
if (result.finalResult == true) { if (result.finalResult == true) {
setState(() { setState(() {
RoboSearch.closeAlertDialog(context); RoboSearch.closeAlertDialog(context);
messageController.text = reconizedWord; speech.stop();
messageController.text = reconizedWord + '\n';
}); });
} }
} }
Future<void> initSpeechState() async {
bool hasSpeech = await speech.initialize(
onError: errorListener, onStatus: statusListener);
print(hasSpeech);
if (!mounted) return;
}
} }
class FeedbackTypeDialog extends StatefulWidget { class FeedbackTypeDialog extends StatefulWidget {
@ -588,7 +608,6 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
setMessageDialogType(MessageType messageType) { setMessageDialogType(MessageType messageType) {
setState(() { setState(() {
messageTypeDialog = messageType; messageTypeDialog = messageType;
}); });
} }
@ -603,7 +622,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
return BaseView<FeedbackViewModel>( return BaseView<FeedbackViewModel>(
builder: (_, model, widge) => SimpleDialog( builder: (_, model, widge) => SimpleDialog(
title: Text( title: Text(
TranslationBase.of(context).feedbackType, TranslationBase.of(context).messageType,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
children: <Widget>[ children: <Widget>[
@ -623,7 +642,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
onTap: () => setMessageDialogType(MessageType.NON), onTap: () => setMessageDialogType(MessageType.NON),
child: ListTile( child: ListTile(
title: title:
Texts(TranslationBase.of(context).notClassified), Texts(TranslationBase.of(context).notClassified),
leading: Radio( leading: Radio(
value: MessageType.NON, value: MessageType.NON,
groupValue: messageTypeDialog, groupValue: messageTypeDialog,
@ -648,7 +667,7 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
MessageType.ComplaintOnAnAppointment), MessageType.ComplaintOnAnAppointment),
child: ListTile( child: ListTile(
title: title:
Texts(TranslationBase.of(context).complainAppo), Texts(TranslationBase.of(context).complainAppo),
leading: Radio( leading: Radio(
value: MessageType.ComplaintOnAnAppointment, value: MessageType.ComplaintOnAnAppointment,
groupValue: messageTypeDialog, groupValue: messageTypeDialog,
@ -805,9 +824,9 @@ class FeedbackTypeDialogState extends State<FeedbackTypeDialog> {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Center( child: Center(
child: Texts( child: Texts(
TranslationBase.of(context).ok, TranslationBase.of(context).ok,
fontWeight: FontWeight.w400, fontWeight: FontWeight.w400,
)), )),
), ),
)), )),
], ],

@ -93,16 +93,24 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
child: Center( child: Center(
child: Column( child: Column(
children: [ children: [
SizedBox(height: MediaQuery.of(context).size.height*0.4,), SizedBox(
Image.asset('assets/images/comments.png',width: 80,height: 80,), height: MediaQuery.of(context).size.height * 0.4,
SizedBox(height: 15,), ),
Image.asset(
'assets/images/comments.png',
width: 80,
height: 80,
),
SizedBox(
height: 15,
),
Texts(TranslationBase.of(context).noSearchResult), Texts(TranslationBase.of(context).noSearchResult),
], ],
), ),
), ),
), ),
bottomSheet: Container( bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.12, height: 80,
width: double.infinity, width: double.infinity,
padding: EdgeInsets.all(15.0), padding: EdgeInsets.all(15.0),
child: Center( child: Center(
@ -112,8 +120,7 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
label: TranslationBase.of(context).search, label: TranslationBase.of(context).search,
textColor: Colors.white, textColor: Colors.white,
disabled: true, disabled: true,
onTap: () { onTap: () {},
},
), ),
), ),
), ),

@ -24,23 +24,13 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
imagesInfo.add(ImagesInfo( imagesInfo
imageEn: .add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/0.png'));
'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/0.png', imagesInfo
imageAr: .add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/1.png'));
'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/0.png'));
imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/1.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/1.png'));
return BaseView<InsuranceViewModel>( return BaseView<InsuranceViewModel>(
onModelReady: widget.appointmentNo != null onModelReady: widget.appointmentNo != null ? (model) => model.getInsuranceApproval(appointmentNo: widget.appointmentNo) : (model) => model.getInsuranceApproval(),
? (model) => builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold(
model.getInsuranceApproval(appointmentNo: widget.appointmentNo)
: (model) => model.getInsuranceApproval(),
builder: (BuildContext context, InsuranceViewModel model, Widget child) =>
AppScaffold(
isShowAppBar: true, isShowAppBar: true,
baseViewModel: model, baseViewModel: model,
appBarTitle: TranslationBase.of(context).approvals, appBarTitle: TranslationBase.of(context).approvals,
@ -65,153 +55,121 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
children: <Widget>[ children: <Widget>[
Texts( Texts(
TranslationBase.of(context).totalApproval, TranslationBase.of(context).totalApproval,
color: Color(0xff60688B), color: Color(0xff60688B),
fontSize: 19.0, fontSize: 19.0,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
), ),
if (model.insuranceApproval.length > 0) if (model.insuranceApproval.length > 0)
Container( Container(
width: 60, width: 60,
height: 40, height: 40,
decoration: BoxDecoration( decoration: BoxDecoration(color: Theme.of(context).primaryColor, borderRadius: BorderRadius.circular(19.0)),
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.circular(19.0)),
child: Center( child: Center(
child: Texts( child: Texts(
model.insuranceApproval[0].unUsedCount model.insuranceApproval[0].unUsedCount.toString(),
.toString(), color: Colors.white,
color: Colors.white, fontSize: 17.0, fontSize: 17.0,
), ),
)) ))
], ],
)), )),
...List.generate( ...List.generate(model.insuranceApproval.length, (index) {
model.insuranceApproval.length, print(model.insuranceApproval[index].isLiveCareAppointment);
(index) => RoundedContainer( return RoundedContainer(
backgroundColor: Colors.white, backgroundColor: Colors.white,
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
ExpansionTile( ExpansionTile(
title: Container( title: Container(
//height: 120.0, //height: 120.0,
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start, children: <Widget>[
children: <Widget>[ model.insuranceApproval[index].isLiveCareAppointment
model.insuranceApproval[index].patientDescription == "In Patient" ? sideBadge(TranslationBase.of(context).liveCare, 0xffA9A089)
? Container( : model.insuranceApproval[index].isInOutPatient
decoration: BoxDecoration( ? sideBadge(TranslationBase.of(context).outpatient, 0xff505a5d)
color: Theme.of(context).primaryColor, : sideBadge(TranslationBase.of(context).inPatient, 0xffb8372c),
borderRadius: Padding(
BorderRadius.circular( padding: EdgeInsets.symmetric(vertical: 10.0),
16.0)), child: Texts(
width: 115.0, model.insuranceApproval[index].clinicName,
padding: fontSize: 20.0,
EdgeInsets.only(left: 11.5), color: Color(0xff60686B),
child: Center( fontWeight: FontWeight.w600,
child: Texts( ),
TranslationBase.of(context).inPatient, ),
color: Colors.white, Texts(
), model.insuranceApproval[index].doctorName,
), fontSize: 17.0,
) ),
: Container( ],
decoration: BoxDecoration( ),
color: Color(0xff505A5D), ),
borderRadius: children: <Widget>[
BorderRadius.circular( Padding(
16.0)), padding: EdgeInsets.symmetric(vertical: 12.0, horizontal: 12.0),
width: 115.0, child: Column(
padding: crossAxisAlignment: CrossAxisAlignment.start,
EdgeInsets.only(left: 11.5), children: <Widget>[
child: Center( Row(
child: Texts( children: [
TranslationBase.of(context).outpatient, Texts(
color: Colors.white, TranslationBase.of(context).approvalNo,
), fontSize: 18.0,
),
),
Padding(
padding: EdgeInsets.symmetric(
vertical: 10.0),
child: Texts(
model.insuranceApproval[index]
.clinicName,
fontSize: 20.0,
color: Color(0xff60686B),
fontWeight: FontWeight.w600,
),
), ),
Texts( Texts(
model.insuranceApproval[index] model.insuranceApproval[index].approvalNo.toString(),
.doctorName, fontSize: 18.0,
fontSize: 17.0, fontWeight: FontWeight.w600,
), ),
], ],
), ),
), Divider(
children: <Widget>[ color: Colors.black,
Padding( height: 25.0,
padding: EdgeInsets.symmetric( thickness: 1.0,
vertical: 12.0, horizontal: 12.0), ),
child: Column( Row(
crossAxisAlignment: children: [
CrossAxisAlignment.start, Texts(
children: <Widget>[ TranslationBase.of(context).procedureStatus,
Row( fontSize: 17.5,
children: [ ),
Texts( SizedBox(
TranslationBase.of(context).approvalNo, width: 12,
fontSize: 18.0, ),
), Texts(
Texts(model.insuranceApproval[index].approvalNo.toString(), model.insuranceApproval[index].approvalStatusDescption,
fontSize: 18.0, fontWeight: FontWeight.w600,
fontWeight: FontWeight.w600,), fontSize: 17.5,
], ),
), ],
Divider( ),
color: Colors.black, Divider(
height: 25.0, color: Colors.black,
thickness: 1.0, height: 25.0,
), thickness: 1.0,
Row( ),
children: [ Row(
Texts( children: [
TranslationBase.of(context).procedureStatus , Texts(
fontSize: 17.5, TranslationBase.of(context).unusedCount,
), fontSize: 17.5,
SizedBox(width: 12,), ),
Texts( Texts(
model.insuranceApproval[index].approvalStatusDescption, model.insuranceApproval[index].unUsedCount.toString(),
fontWeight: FontWeight.w600, fontSize: 17.5,
fontSize: 17.5, fontWeight: FontWeight.w600,
), ),
], ],
), ),
Divider( Divider(
color: Colors.black, color: Colors.black,
height: 25.0, height: 25.0,
thickness: 1.0, thickness: 1.0,
), ),
Row(
children: [
Texts(
TranslationBase.of(context).unusedCount,
fontSize: 17.5,
),
Texts(
model.insuranceApproval[index].unUsedCount.toString(),
fontSize: 17.5,
fontWeight: FontWeight.w600,
),
],
),
Divider(
color: Colors.black,
height: 25.0,
thickness: 1.0,
),
// Text( // Text(
// 'Company Name: ' + // 'Company Name: ' +
// model.insuranceApproval[index] // model.insuranceApproval[index]
@ -224,190 +182,131 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
// fontSize: 17.5, // fontSize: 17.5,
// fontWeight: FontWeight.w600), // fontWeight: FontWeight.w600),
// ), // ),
Texts( Texts(
TranslationBase.of(context).companyName, TranslationBase.of(context).companyName,
fontWeight: FontWeight.w600, fontWeight: FontWeight.w600,
fontSize: 17.5, fontSize: 17.5,
), ),
Divider(
color: Colors.black,
height: 25.0,
thickness: 1.0,
),
Row(
children: [
Texts(
TranslationBase.of(context).receiptOn ,
fontSize: 17.5,
fontWeight: FontWeight.w600,
),
Texts(
convertDateFormat(model.insuranceApproval[index].rceiptOn),
fontSize: 17.5,
fontWeight: FontWeight.w600,
), Divider(
], color: Colors.black,
height: 25.0,
thickness: 1.0,
),
Row(
children: [
Texts(
TranslationBase.of(context).receiptOn,
fontSize: 17.5,
fontWeight: FontWeight.w600,
),
Texts(
convertDateFormat(model.insuranceApproval[index].receiptOn),
fontSize: 17.5,
fontWeight: FontWeight.w600,
),
],
),
Divider(
color: Colors.black,
height: 25.0,
thickness: 1.0,
),
Row(
children: [
Texts(
TranslationBase.of(context).expiryDate,
fontSize: 17.5,
fontWeight: FontWeight.w600,
),
Texts(
convertDateFormat(model.insuranceApproval[index].expiryDate),
fontSize: 17.5,
fontWeight: FontWeight.w600,
),
],
),
Divider(
color: Colors.black,
height: 55.0,
thickness: 1.2,
),
IntrinsicHeight(
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Expanded(
flex: 1,
child: Column(
children: <Widget>[
Text(TranslationBase.of(context).procedureName),
Padding(
padding: EdgeInsets.only(top: SizeConfig.heightMultiplier * 3.0),
child: Text(
model.insuranceApproval[index].apporvalDetails?.procedureName ?? '',
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 15.5),
),
),
],
),
), ),
Divider( VerticalDivider(
width: 10.0,
thickness: 1.2,
color: Colors.black, color: Colors.black,
height: 25.0,
thickness: 1.0,
), ),
Row( Expanded(
children: [ flex: 1,
Texts( child: Column(
TranslationBase.of(context).expiryDate, children: <Widget>[
fontSize: 17.5, Text(TranslationBase.of(context).procedureStatus),
fontWeight: FontWeight.w600, Padding(
padding: EdgeInsets.only(top: SizeConfig.heightMultiplier * 3.0),
), child: Text(
Texts( model.insuranceApproval[index].apporvalDetails?.status ?? '',
convertDateFormat(model.insuranceApproval[index].expiryDate), style: TextStyle(fontSize: 17.5, fontWeight: FontWeight.w600),
fontSize: 17.5, ),
fontWeight: FontWeight.w600, ),
],
), ),
],
), ),
Divider( VerticalDivider(
color: Colors.black, width: 2.3,
height: 55.0,
thickness: 1.2, thickness: 1.2,
color: Colors.black,
), ),
IntrinsicHeight( Expanded(
child: Row( flex: 1,
crossAxisAlignment: child: Column(
CrossAxisAlignment.center,
children: <Widget>[ children: <Widget>[
Expanded( Text(TranslationBase.of(context).usageStatus),
flex: 1, Padding(
child: Column( padding: EdgeInsets.only(top: SizeConfig.heightMultiplier * 3.0),
children: <Widget>[ child: Text(
Text(TranslationBase.of( model.insuranceApproval[index].apporvalDetails?.isInvoicedDesc ?? '',
context) style: TextStyle(fontWeight: FontWeight.w600, fontSize: 17.5),
.procedureName),
Padding(
padding: EdgeInsets.only(
top: SizeConfig
.heightMultiplier *
3.0),
child: Text(
model
.insuranceApproval[
index]
.approvalDetails ==
null
? ''
: model
.insuranceApproval[
index]
.approvalDetails
.procedureName,
style: TextStyle(
fontWeight:
FontWeight.w600,
fontSize: 15.5),
),
),
],
),
),
VerticalDivider(
width: 10.0,
thickness: 1.2,
color: Colors.black,
),
Expanded(
flex: 1,
child: Column(
children: <Widget>[
Text(TranslationBase.of(
context)
.procedureStatus),
Padding(
padding: EdgeInsets.only(
top: SizeConfig
.heightMultiplier *
3.0),
child: Text(
model
.insuranceApproval[
index]
.approvalDetails ==
null
? ''
: model
.insuranceApproval[
index]
.approvalDetails
.status,
style: TextStyle(
fontSize: 17.5,
fontWeight:
FontWeight
.w600),
),
),
],
),
),
VerticalDivider(
width: 2.3,
thickness: 1.2,
color: Colors.black,
),
Expanded(
flex: 1,
child: Column(
children: <Widget>[
Text(TranslationBase.of(
context)
.usageStatus),
Padding(
padding: EdgeInsets.only(
top: SizeConfig
.heightMultiplier *
3.0),
child: Text(
model
.insuranceApproval[
index]
.approvalDetails ==
null
? ''
: model
.insuranceApproval[
index]
.approvalDetails
.isInvoicedDesc,
style: TextStyle(
fontWeight:
FontWeight.w600,
fontSize: 17.5),
),
),
],
), ),
), ),
], ],
), ),
), ),
Divider(
color: Colors.black,
height: 25.0,
thickness: 1.0,
),
], ],
), ),
), ),
Divider(
color: Colors.black,
height: 25.0,
thickness: 1.0,
),
], ],
), ),
], ),
), ],
)), ),
],
),
);
}),
], ],
), ),
), ),
@ -416,6 +315,22 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
); );
} }
Widget sideBadge(String title, int color) {
return Container(
decoration: BoxDecoration(
color: Color(color),
borderRadius: BorderRadius.circular(16.0),
),
width: 115.0,
padding: EdgeInsets.only(top: 1, bottom: 1),
alignment: Alignment.center,
child: Texts(
title,
color: Colors.white,
),
);
}
convertDateFormat(String Date) { convertDateFormat(String Date) {
const start = "/Date("; const start = "/Date(";
const end = "+0300)"; const end = "+0300)";
@ -423,13 +338,8 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
final startIndex = Date.indexOf(start); final startIndex = Date.indexOf(start);
final endIndex = Date.indexOf(end, startIndex + start.length); final endIndex = Date.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch( var date = new DateTime.fromMillisecondsSinceEpoch(int.parse(Date.substring(startIndex + start.length, endIndex)));
int.parse(Date.substring(startIndex + start.length, endIndex))); String newDate = date.year.toString() + "-" + date.month.toString().padLeft(2, '0') + "-" + date.day.toString().padLeft(2, '0');
String newDate = date.year.toString() +
"-" +
date.month.toString().padLeft(2, '0') +
"-" +
date.day.toString().padLeft(2, '0');
return newDate.toString(); return newDate.toString();
} }

@ -1,10 +1,11 @@
import 'package:diplomaticquarterapp/config/config.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/core/viewModels/dashboard_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.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/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart'; import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/ComprehensiveMedicalCheckup/cmc_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/home_health_care_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/all_habib_medical_service_page.dart';
import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart'; import 'package:diplomaticquarterapp/pages/ContactUs/contact_us_page.dart';
@ -20,6 +21,7 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.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:feather_icons_flutter/feather_icons_flutter.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:flutter_svg/flutter_svg.dart';
@ -38,14 +40,16 @@ class HomePage extends StatefulWidget {
} }
class _HomePageState extends State<HomePage> { class _HomePageState extends State<HomePage> {
PharmacyModuleViewModel pharmacyModuleViewModel = PharmacyModuleViewModel pharmacyModuleViewModel = locator<PharmacyModuleViewModel>();
locator<PharmacyModuleViewModel>();
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<DashboardViewModel>( return BaseView<DashboardViewModel>(
onModelReady: (model) => model.getPatientRadOrders(), onModelReady: (model) => () async {
model.getPatientRadOrders();
var user = await sharedPref.getObject(USER_PROFILE);
},
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
isShowDecPage: false, isShowDecPage: false,
isHelp: true, isHelp: true,
@ -64,9 +68,7 @@ class _HomePageState extends State<HomePage> {
height: 210, height: 210,
decoration: BoxDecoration( decoration: BoxDecoration(
image: DecorationImage( image: DecorationImage(
image: ExactAssetImage( image: ExactAssetImage('assets/images/dashboard_top_bg.png'), fit: BoxFit.cover),
'assets/images/dashboard_top_bg.png'),
fit: BoxFit.cover),
), ),
child: Stack( child: Stack(
children: <Widget>[ children: <Widget>[
@ -75,129 +77,103 @@ class _HomePageState extends State<HomePage> {
left: 5, left: 5,
right: 5, right: 5,
child: Container( child: Container(
width: width: MediaQuery.of(context).size.width * 0.8,
MediaQuery.of(context).size.width * 0.8,
child: Row( child: Row(
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Container( child: Visibility(
height: 125, visible: model.user.outSA == 1 ? false : true,
padding: EdgeInsets.all(5),
margin: EdgeInsets.all(5),
decoration: BoxDecoration(
image: DecorationImage(
image: AssetImage(
"assets/images/new-design/covid_bg_transparent.png"),
fit: BoxFit.fill,
),
color:
Colors.white.withOpacity(0.3),
borderRadius: BorderRadius.all(
Radius.circular(5))),
child: Container( child: Container(
child: Column( height: 125,
children: <Widget>[ padding: EdgeInsets.all(5),
Texts( margin: EdgeInsets.all(5),
TranslationBase.of(context) decoration: BoxDecoration(
.covidTest, image: DecorationImage(
fontSize: 15.0, image:
color: Colors.white, AssetImage("assets/images/new-design/covid_bg_transparent.png"),
fontWeight: FontWeight.w700, fit: BoxFit.fill,
), ),
Row( color: Colors.white.withOpacity(0.3),
mainAxisAlignment: borderRadius: BorderRadius.all(Radius.circular(5))),
MainAxisAlignment child: Container(
.spaceAround, child: Column(
children: <Widget>[ children: <Widget>[
Container( Texts(
margin: EdgeInsets.only( TranslationBase.of(context).covidTest,
top: 15.0, color: Colors.white,
fontWeight: FontWeight.w700,
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: <Widget>[
Container(
margin: EdgeInsets.only(
top: 15.0,
),
child: SvgPicture.asset(
'assets/images/new-design/covid-19-car.svg',
width: 45.0,
height: 45.0),
), ),
child: SvgPicture.asset( Container(
'assets/images/new-design/covid-19-car.svg', margin: EdgeInsets.only(top: 5.0),
width: 35.0, child: Column(
height: 35.0), children: <Widget>[
), Texts(
Container( TranslationBase.of(context).driveThru,
margin: EdgeInsets.only( fontWeight: FontWeight.w700,
top: 5.0), color: Colors.white,
child: Column(
children: <Widget>[
Texts(
TranslationBase.of(
context)
.driveThru,
fontWeight:
FontWeight.w700,
fontSize: 15.0,
color: Colors.white,
),
ButtonTheme(
shape:
RoundedRectangleBorder(
borderRadius:
BorderRadius
.circular(
5.0),
), ),
minWidth: MediaQuery.of( ButtonTheme(
context) shape: RoundedRectangleBorder(
.size borderRadius: BorderRadius.circular(5.0),
.width * ),
0.1, minWidth: MediaQuery.of(context).size.width * 0.15,
height: 25.0, height: 25.0,
child: RaisedButton( child: RaisedButton(
color: Colors color: Colors.red[800],
.red[800], textColor: Colors.white,
textColor: disabledTextColor: Colors.white,
Colors.white, disabledColor: new Color(0xFFbcc2c4),
disabledTextColor: onPressed: () {
Colors.white, navigateToCovidDriveThru();
disabledColor: },
new Color( child: Center(
0xFFbcc2c4), child: Center(
onPressed: () {
navigateToCovidDriveThru();
},
child: Center( child: Center(
child: Texts( child: Center(
TranslationBase.of( child: Texts(
context) TranslationBase.of(context).bookNow,
.bookNow, fontWeight: FontWeight.w700,
fontWeight: color: Colors.white,
FontWeight ),
.w700,
color: Colors
.white,
), ),
),
),
),
), ),
), ),
), ],
], ),
), ),
), ],
], ),
), ],
], ),
), ),
), ),
), ),
), ),
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () => Navigator.push(context, onTap: () => Navigator.push(context, FadePage(page: LiveCareHome())),
FadePage(page: LiveCareHome())),
child: Container( child: Container(
height: 125, height: 125,
padding: EdgeInsets.all(15), padding: EdgeInsets.all(15),
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
decoration: BoxDecoration( decoration: BoxDecoration(
color: Colors.white color: Colors.white.withOpacity(0.3),
.withOpacity(0.3), borderRadius: BorderRadius.all(Radius.circular(5))),
borderRadius: BorderRadius.all(
Radius.circular(5))),
child: SvgPicture.asset( child: SvgPicture.asset(
projectViewModel.isArabic projectViewModel.isArabic
? 'assets/images/new-design/livecare_arabic_logo.svg' ? 'assets/images/new-design/livecare_arabic_logo.svg'
@ -213,23 +189,15 @@ class _HomePageState extends State<HomePage> {
], ],
), ),
), ),
Container( Container(width: double.infinity, height: projectViewModel.isArabic ? 110 : 80)
width: double.infinity,
height: projectViewModel.isArabic ? 110 : 80)
], ],
), ),
Positioned( Positioned(
top: 155, top: 155,
left: MediaQuery.of(context).size.width * left: MediaQuery.of(context).size.width *
(MediaQuery.of(context).orientation == (MediaQuery.of(context).orientation == Orientation.landscape ? 0.02 : 0.03),
Orientation.landscape
? 0.02
: 0.03),
right: MediaQuery.of(context).size.width * right: MediaQuery.of(context).size.width *
(MediaQuery.of(context).orientation == (MediaQuery.of(context).orientation == Orientation.landscape ? 0.02 : 0.03),
Orientation.landscape
? 0.02
: 0.03),
child: (!model.isLogin) child: (!model.isLogin)
? Container( ? Container(
width: double.infinity, width: double.infinity,
@ -237,14 +205,10 @@ class _HomePageState extends State<HomePage> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#A59E9E'), color: HexColor('#A59E9E'),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all( border: Border.all(color: Colors.transparent, width: 0.5),
color: Colors.transparent, width: 0.5), borderRadius: BorderRadius.all(Radius.circular(9)),
borderRadius:
BorderRadius.all(Radius.circular(9)),
image: DecorationImage( image: DecorationImage(
image: ExactAssetImage( image: ExactAssetImage('assets/images/bg_graphic.png'), fit: BoxFit.cover)),
'assets/images/bg_graphic.png'),
fit: BoxFit.cover)),
child: Container( child: Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
child: Column( child: Column(
@ -260,37 +224,30 @@ class _HomePageState extends State<HomePage> {
fontSize: 23, fontSize: 23,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).myMedicalFileSubTitle,
.myMedicalFileSubTitle,
color: Colors.black, color: Colors.black,
fontSize: 16, fontSize: 16,
), ),
Align( Align(
alignment: projectViewModel.isArabic alignment:
? Alignment.bottomLeft projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight,
: Alignment.bottomRight,
child: InkWell( child: InkWell(
onTap: () { onTap: () {
widget.goToMyProfile(); widget.goToMyProfile();
}, },
child: Container( child: Container(
margin: EdgeInsets.only( margin: EdgeInsets.only(left: 15, right: 15),
left: 15, right: 15),
width: 90, width: 90,
height: 30, height: 30,
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#D81A2E'), color: HexColor('#D81A2E'),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all( border: Border.all(color: Colors.transparent, width: 0.5),
color: Colors.transparent, borderRadius: BorderRadius.all(Radius.circular(0)),
width: 0.5),
borderRadius: BorderRadius.all(
Radius.circular(0)),
), ),
child: Center( child: Center(
child: Texts( child: Texts(
TranslationBase.of(context) TranslationBase.of(context).viewMore,
.viewMore,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: 12, fontSize: 12,
@ -309,14 +266,10 @@ class _HomePageState extends State<HomePage> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#A59E9E'), color: HexColor('#A59E9E'),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all( border: Border.all(color: Colors.transparent, width: 0.5),
color: Colors.transparent, width: 0.5), borderRadius: BorderRadius.all(Radius.circular(9)),
borderRadius:
BorderRadius.all(Radius.circular(9)),
image: DecorationImage( image: DecorationImage(
image: ExactAssetImage( image: ExactAssetImage('assets/images/bg_graphic.png'), fit: BoxFit.cover),
'assets/images/bg_graphic.png'),
fit: BoxFit.cover),
), ),
child: Container( child: Container(
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
@ -324,38 +277,56 @@ class _HomePageState extends State<HomePage> {
children: <Widget>[ children: <Widget>[
Row( Row(
children: <Widget>[ children: <Widget>[
if (projectViewModel.user != null && if (projectViewModel.user != null && model.isLogin)
model.isLogin)
Expanded( Expanded(
child: Column( child: Column(
crossAxisAlignment: crossAxisAlignment: CrossAxisAlignment.start,
CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
SizedBox( SizedBox(
height: 8, height: 8,
), ),
Row( model.user.cRSVerificationStatus == 2
children: [ ? Row(
Texts( children: [
model.user.firstName + Texts(
" " + model.user.firstName + " " + model.user.lastName,
model.user.lastName, color: Colors.grey[100],
color: Colors.grey[100], bold: true,
bold: true, fontSize: 15,
fontSize: 15, ),
), Container(
Container( margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0),
margin: child: SvgPicture.asset(
EdgeInsets.fromLTRB( "assets/images/new-design/verification_check.svg"),
8.0, ),
0.0, ],
8.0, )
0.0), : model.user.cRSVerificationStatus == 3
child: SvgPicture.asset( ? Row(
"assets/images/new-design/verification_check.svg"), children: [
), Texts(
], model.user.firstName + " " + model.user.lastName,
), color: Colors.grey[100],
bold: true,
fontSize: 15,
),
Container(
margin: EdgeInsets.fromLTRB(8.0, 0.0, 8.0, 0.0),
child: SvgPicture.asset(
"assets/images/new-design/pending.svg"),
),
],
)
: Row(
children: [
Texts(
model.user.firstName + " " + model.user.lastName,
color: Colors.grey[100],
bold: true,
fontSize: 15,
),
],
),
Texts( Texts(
'${model.user.patientID}', '${model.user.patientID}',
color: Colors.white, color: Colors.white,
@ -384,17 +355,14 @@ class _HomePageState extends State<HomePage> {
decoration: BoxDecoration( decoration: BoxDecoration(
color: HexColor('#D81A2E'), color: HexColor('#D81A2E'),
shape: BoxShape.rectangle, shape: BoxShape.rectangle,
border: Border.all( border: Border.all(color: Colors.transparent, width: 0.5),
color: Colors.transparent,
width: 0.5),
borderRadius: BorderRadius.all( borderRadius: BorderRadius.all(
Radius.circular(5), Radius.circular(5),
), ),
), ),
child: Center( child: Center(
child: Texts( child: Texts(
TranslationBase.of(context) TranslationBase.of(context).myMedicalFile,
.myMedicalFile,
color: Colors.white, color: Colors.white,
fontSize: 12, fontSize: 12,
textAlign: TextAlign.center, textAlign: TextAlign.center,
@ -434,8 +402,7 @@ class _HomePageState extends State<HomePage> {
height: 40, height: 40,
), ),
Texts('${model.weightKg} ${TranslationBase.of(context).kg}', Texts('${model.weightKg} ${TranslationBase.of(context).kg}',
color: Colors.white, color: Colors.white, fontSize: 17)
fontSize: 17)
], ],
), ),
), ),
@ -450,11 +417,7 @@ class _HomePageState extends State<HomePage> {
width: 35, width: 35,
height: 40, height: 40,
), ),
Texts( Texts('${model.booldType}', color: Colors.white, fontSize: 17)
'${model.booldType}',
color: Colors.white,
fontSize: 17
)
], ],
), ),
), ),
@ -468,12 +431,10 @@ class _HomePageState extends State<HomePage> {
], ],
), ),
Padding( Padding(
padding: padding: const EdgeInsets.only(bottom: 15, right: 15, left: 15),
const EdgeInsets.only(bottom: 15, right: 15, left: 15),
child: InkWell( child: InkWell(
onTap: () { onTap: () {
Navigator.of(context).push(MaterialPageRoute( Navigator.of(context).push(MaterialPageRoute(builder: (context) => PackagesHomePage()));
builder: (context) => PackagesHomePage()));
}, },
child: Container( child: Container(
decoration: BoxDecoration( decoration: BoxDecoration(
@ -501,131 +462,126 @@ class _HomePageState extends State<HomePage> {
if (projectViewModel.havePrivilege(64) || if (projectViewModel.havePrivilege(64) ||
projectViewModel.havePrivilege(65) || projectViewModel.havePrivilege(65) ||
projectViewModel.havePrivilege(67)) projectViewModel.havePrivilege(67))
Container( if (model.user.outSA == 0)
margin: EdgeInsets.only(left: 15, right: 15), Container(
child: Row( margin: EdgeInsets.only(left: 15, right: 15),
mainAxisAlignment: MainAxisAlignment.spaceBetween, child: Row(
children: <Widget>[ mainAxisAlignment: MainAxisAlignment.spaceBetween,
if (projectViewModel.havePrivilege(64)) children: <Widget>[
DashboardItem( if (projectViewModel.havePrivilege(64))
onTap: () { DashboardItem(
Navigator.push( onTap: () {
context, Navigator.push(
FadePage( context,
page: HomeHealthCarePage(), FadePage(
), page: HomeHealthCarePage(),
); ),
}, );
child: Center( },
child: Padding( child: Center(
padding: const EdgeInsets.all(15.0), child: Padding(
child: Column( padding: const EdgeInsets.all(15.0),
children: <Widget>[ child: Column(
Image.asset( children: <Widget>[
'assets/images/home_health_care_icon.png', Image.asset(
width: 50, 'assets/images/home_health_care_icon.png',
height: 50, width: 50,
), height: 50,
SizedBox( ),
height: 10, SizedBox(
), height: 10,
Texts( ),
TranslationBase.of(context) Texts(
.homeHealthCare, TranslationBase.of(context).homeHealthCare,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.w700, fontWeight: FontWeight.w700,
fontSize: fontSize: SizeConfig.textMultiplier * 1.55,
SizeConfig.textMultiplier * 1.55, )
) ],
], ),
), ),
), ),
height: MediaQuery.of(context).size.width * 0.4,
imageName: 'home_healthcare_service_bg.png',
opacity: 0.5,
), ),
height: MediaQuery.of(context).size.width * 0.4, if (projectViewModel.havePrivilege(65))
imageName: 'home_healthcare_service_bg.png', DashboardItem(
opacity: 0.5, onTap: () => getPharmacyToken(model),
), child: Center(
if (projectViewModel.havePrivilege(65)) child: Padding(
DashboardItem( padding: const EdgeInsets.all(15.0),
onTap: () => getPharmacyToken(model), child: Column(
child: Center( children: <Widget>[
child: Padding( Image.asset(
padding: const EdgeInsets.all(15.0), 'assets/images/pharmacy_logo.png',
child: Column( width: 40,
children: <Widget>[ height: 40,
Image.asset( ),
'assets/images/pharmacy_logo.png', SizedBox(
width: 40, height: 20,
height: 40, ),
), Texts(
SizedBox( TranslationBase.of(context).onlinePharmacy,
height: 20, textAlign: TextAlign.center,
), color: Colors.white,
Texts( fontWeight: FontWeight.w700,
TranslationBase.of(context) fontSize: SizeConfig.textMultiplier * 1.55,
.onlinePharmacy, )
textAlign: TextAlign.center, ],
color: Colors.white, ),
fontWeight: FontWeight.w700,
fontSize:
SizeConfig.textMultiplier * 1.55,
)
],
), ),
), ),
height: MediaQuery.of(context).size.width * 0.4,
imageName: 'al-habib_onlne_pharmacy_bg.png',
), ),
height: MediaQuery.of(context).size.width * 0.4, if (projectViewModel.havePrivilege(67))
imageName: 'al-habib_onlne_pharmacy_bg.png', DashboardItem(
), onTap: () {
if (projectViewModel.havePrivilege(67)) Navigator.push(
DashboardItem( context,
onTap: () { FadePage(
Navigator.push( page: CMCPage(),
context, ),
FadePage( );
page: CMCPage(), },
), child: Center(
); child: Padding(
}, padding: const EdgeInsets.all(15.0),
child: Center( child: Column(
child: Padding( children: <Widget>[
padding: const EdgeInsets.all(15.0), Image.asset(
child: Column( 'assets/images/comprehensive_medical_checkup_logo.png',
children: <Widget>[ width: 50,
Image.asset( height: 50,
'assets/images/comprehensive_medical_checkup_logo.png', ),
width: 50, SizedBox(
height: 50, height: 10,
), ),
SizedBox( Texts(
height: 10, TranslationBase.of(context).cmcHeading,
), textAlign: TextAlign.center,
Texts( color: Colors.white,
TranslationBase.of(context).cmcHeading, fontWeight: FontWeight.w700,
textAlign: TextAlign.center, fontSize: SizeConfig.textMultiplier * 1.55,
color: Colors.white, )
fontWeight: FontWeight.w700, ],
fontSize: ),
SizeConfig.textMultiplier * 1.55,
)
],
), ),
), ),
height: MediaQuery.of(context).size.width * 0.4,
color: HexColor("#747C80"),
imageName: 'emergency_service_image.png',
), ),
height: MediaQuery.of(context).size.width * 0.4, ],
color: HexColor("#747C80"), ),
imageName: 'emergency_service_image.png',
),
],
), ),
),
SizedBox( SizedBox(
height: 8, height: 8,
), ),
InkWell( InkWell(
onTap: () => onTap: () => Navigator.push(context, FadePage(page: PaymentService())),
Navigator.push(context, FadePage(page: PaymentService())),
child: Container( child: Container(
margin: EdgeInsets.only(left: 15, right: 15), margin: EdgeInsets.only(left: 15, right: 15),
child: Row( child: Row(
@ -646,8 +602,7 @@ class _HomePageState extends State<HomePage> {
height: 5, height: 5,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).onlinePaymentService,
.onlinePaymentService,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.black87, color: Colors.black87,
bold: false, bold: false,
@ -663,41 +618,37 @@ class _HomePageState extends State<HomePage> {
color: Colors.white, color: Colors.white,
), ),
), ),
InkWell( Container(
onTap: () => Navigator.push(context, FadePage(page: EReferralPage())), child: Center(
child: Container( child: Padding(
child: Center( padding: const EdgeInsets.all(15.0),
child: Padding( child: Column(
padding: const EdgeInsets.all(15.0), children: <Widget>[
child: Column( Image.asset(
children: <Widget>[ 'assets/images/ereferral_service_icon.png',
Image.asset( width: 50,
'assets/images/ereferral_service_icon.png', height: 55,
width: 50, ),
height: 55, SizedBox(
), height: 10,
SizedBox( ),
height: 10, Texts(
), TranslationBase.of(context).offersAndPackages,
Texts( textAlign: TextAlign.center,
TranslationBase.of(context) color: Colors.black87,
.offersAndPackages, bold: false,
textAlign: TextAlign.center, fontSize: SizeConfig.textMultiplier * 1.7,
color: Colors.black87, )
bold: false, ],
fontSize: SizeConfig.textMultiplier * 1.7,
)
],
),
), ),
), ),
width: MediaQuery.of(context).size.width * 0.29, ),
height: MediaQuery.of(context).size.width * 0.4, width: MediaQuery.of(context).size.width * 0.29,
decoration: BoxDecoration( height: MediaQuery.of(context).size.width * 0.4,
borderRadius: BorderRadius.circular(6.0), decoration: BoxDecoration(
color: Colors.white, borderRadius: BorderRadius.circular(6.0),
)), color: Colors.white,
), )),
if (projectViewModel.havePrivilege(60)) if (projectViewModel.havePrivilege(60))
Container( Container(
width: MediaQuery.of(context).size.width * 0.29, width: MediaQuery.of(context).size.width * 0.29,
@ -722,13 +673,11 @@ class _HomePageState extends State<HomePage> {
height: 10, height: 10,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).emergencyServices,
.emergencyServices,
textAlign: TextAlign.center, textAlign: TextAlign.center,
color: Colors.black87, color: Colors.black87,
bold: false, bold: false,
fontSize: fontSize: SizeConfig.textMultiplier * 1.7,
SizeConfig.textMultiplier * 1.7,
) )
], ],
), ),
@ -766,8 +715,7 @@ class _HomePageState extends State<HomePage> {
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
Texts( Texts(
TranslationBase.of(context) TranslationBase.of(context).viewAllHabibMedicalService,
.viewAllHabibMedicalService,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
fontSize: 10, fontSize: 10,
@ -788,15 +736,13 @@ class _HomePageState extends State<HomePage> {
opacity: 0.5, opacity: 0.5,
color: Colors.grey[700], color: Colors.grey[700],
width: MediaQuery.of(context).size.width * 0.45, width: MediaQuery.of(context).size.width * 0.45,
onTap: () => Navigator.push( onTap: () => Navigator.push(context, FadePage(page: AllHabibMedicalService())),
context, FadePage(page: AllHabibMedicalService())),
), ),
DashboardItem( DashboardItem(
onTap: () { onTap: () {
// Navigator.push( // Navigator.push(
// context, FadePage(page: FeedbackHomePage())); // context, FadePage(page: FeedbackHomePage()));
Navigator.push( Navigator.push(context, FadePage(page: ContactUsPage()));
context, FadePage(page: ContactUsPage()));
}, },
child: Container( child: Container(
width: double.infinity, width: double.infinity,
@ -805,7 +751,7 @@ class _HomePageState extends State<HomePage> {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Texts( Texts(
TranslationBase.of(context).reachUs, TranslationBase.of(context).contactUs,
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
), ),
@ -918,10 +864,8 @@ class DashboardItem extends StatelessWidget {
? DecorationImage( ? DecorationImage(
image: ExactAssetImage('assets/images/$imageName'), image: ExactAssetImage('assets/images/$imageName'),
fit: BoxFit.cover, fit: BoxFit.cover,
colorFilter: hasColorFilter colorFilter:
? new ColorFilter.mode( hasColorFilter ? new ColorFilter.mode(Colors.black.withOpacity(0.2), BlendMode.dstIn) : null,
Colors.black.withOpacity(0.2), BlendMode.dstIn)
: null,
) )
: null, : null,
), ),

@ -1,5 +1,6 @@
import 'dart:io'; import 'dart:io';
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/model/geofencing/requests/GeoZonesRequestModel.dart'; import 'package:diplomaticquarterapp/core/model/geofencing/requests/GeoZonesRequestModel.dart';
@ -31,9 +32,11 @@ import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart'; import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart';
import 'package:firebase_analytics/observer.dart';
import 'package:firebase_messaging/firebase_messaging.dart'; import 'package:firebase_messaging/firebase_messaging.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart'; import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:permission_handler/permission_handler.dart'; import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
@ -43,12 +46,22 @@ import '../../routes.dart';
import 'home_page.dart'; import 'home_page.dart';
class LandingPage extends StatefulWidget { class LandingPage extends StatefulWidget {
static LandingPage shared;
_LandingPageState state;
LandingPage() {
LandingPage.shared = this;
}
static bool isOpenCallPage = false; static bool isOpenCallPage = false;
static IncomingCallData incomingCallData = new IncomingCallData(); static IncomingCallData incomingCallData = new IncomingCallData();
@override @override
_LandingPageState createState() => _LandingPageState(); _LandingPageState createState() => state = _LandingPageState();
switchToDoFromHMGServices(){
state.changeCurrentTab(4);
}
} }
class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver { class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
@ -66,6 +79,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging(); final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
final authService = new AuthProvider(); final authService = new AuthProvider();
var event = RobotProvider(); var event = RobotProvider();
var familyFileProvider = family.FamilyFilesProvider(); var familyFileProvider = family.FamilyFilesProvider();
@ -83,18 +97,22 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
bool isPageNavigated = false; bool isPageNavigated = false;
LocationUtils locationUtils; LocationUtils locationUtils;
_changeCurrentTab(int tab) { changeCurrentTab(int tab) {
setState(() { setState(() {
currentTab = tab; if(currentTab > 0 && tab == 2)
if (tab != 0) pageController.jumpToPage(0);
else if (tab != 0)
pageController.jumpToPage(tab); pageController.jumpToPage(tab);
else { else {
IS_VOICE_COMMAND_CLOSED = false; IS_VOICE_COMMAND_CLOSED = false;
pageController.jumpToPage(tab); pageController.jumpToPage(tab);
} }
currentTab = tab;
}); });
} }
@override @override
void didChangeAppLifecycleState(AppLifecycleState state) { void didChangeAppLifecycleState(AppLifecycleState state) {
super.didChangeAppLifecycleState(state); super.didChangeAppLifecycleState(state);
@ -188,6 +206,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// if (results[Permission.calendar].isGranted) ; // if (results[Permission.calendar].isGranted) ;
}); });
requestPermissions(); requestPermissions();
// }); // });
// //
// //_firebase Background message handler // //_firebase Background message handler
@ -366,7 +385,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
checkValue(projectProvider) { checkValue(projectProvider) {
if (projectProvider.searchValue != null) { if (projectProvider.searchValue != null) {
_changeCurrentTab(2); changeCurrentTab(2);
} }
} }
@ -401,6 +420,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
authService authService
.selectDeviceImei(DEVICE_TOKEN) .selectDeviceImei(DEVICE_TOKEN)
.then((SelectDeviceIMEIRES value) { .then((SelectDeviceIMEIRES value) {
this.getNotificationCount(DEVICE_TOKEN);
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (value != null) { if (value != null) {
setUserValues(value); setUserValues(value);
@ -543,7 +563,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
children: [ children: [
HomePage( HomePage(
goToMyProfile: () { goToMyProfile: () {
_changeCurrentTab(1); changeCurrentTab(1);
}, },
), ),
MedicalProfilePage(), MedicalProfilePage(),
@ -553,16 +573,16 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
], // Please do not remove the BookingOptions from this array ], // Please do not remove the BookingOptions from this array
), ),
bottomNavigationBar: BottomNavBar( bottomNavigationBar: BottomNavBar(
changeIndex: _changeCurrentTab, changeIndex: changeCurrentTab,
index: currentTab, index: currentTab,
), ),
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked, floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked ,
floatingActionButton: floatingActionButton:
(projectViewModel.havePrivilege(34) && currentTab == 0) (projectViewModel.havePrivilege(34) && currentTab == 0)
? FloatingButton( ? FloatingButton(
elevation: true, elevation: true,
onTap: () { onTap: () {
_changeCurrentTab(2); changeCurrentTab(2);
}) })
: null); : null);
} }

@ -9,7 +9,9 @@ class LiveCarePaymentDialog extends StatefulWidget {
String clinicName; String clinicName;
LiveCarePaymentDialog( LiveCarePaymentDialog(
{@required this.getERAppointmentFeesList, @required this.waitingTime, @required this.clinicName}); {@required this.getERAppointmentFeesList,
@required this.waitingTime,
@required this.clinicName});
@override @override
_LiveCarePaymentDialogState createState() => _LiveCarePaymentDialogState(); _LiveCarePaymentDialogState createState() => _LiveCarePaymentDialogState();
@ -32,14 +34,15 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
height: MediaQuery.of(context).size.height * 0.691, height: MediaQuery.of(context).size.height * 0.691,
margin: EdgeInsets.all(20.0), margin: EdgeInsets.all(20.0),
width: 450.0, width: 450.0,
child: Column( child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max, mainAxisSize: MainAxisSize.max,
children: <Widget>[ children: <Widget>[
Container( Container(
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.only(bottom: 10.0), margin: EdgeInsets.only(bottom: 10.0),
child: Text("Online Consultation", child: Text(TranslationBase.of(context).onlineConsultation,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: style:
TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)), TextStyle(fontSize: 20.0, fontWeight: FontWeight.bold)),
@ -52,7 +55,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
direction: Axis.horizontal, direction: Axis.horizontal,
children: <Widget>[ children: <Widget>[
Expanded( Expanded(
child: Text("Waiting time to start LiveCare consultation", child: Text(TranslationBase.of(context).expectedWaiting,
textAlign: TextAlign.end, textAlign: TextAlign.end,
style: TextStyle(fontSize: 13.0)), style: TextStyle(fontSize: 13.0)),
), ),
@ -92,7 +95,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.only(top: 5.0), margin: EdgeInsets.only(top: 5.0),
padding: EdgeInsets.all(5.0), padding: EdgeInsets.all(5.0),
child: Text("Consultation fee", child: Text(TranslationBase.of(context).erConsultFee,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: TextStyle( style: TextStyle(
fontSize: 14.0, fontSize: 14.0,
@ -155,8 +158,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
Container( Container(
margin: EdgeInsets.only(left: 10.0), margin: EdgeInsets.only(left: 10.0),
width: MediaQuery.of(context).size.width * 0.55, width: MediaQuery.of(context).size.width * 0.55,
child: Text( child: Text(TranslationBase.of(context).insuredPatient,
"If you're Insurance patient, you have only have to pay the co-payment",
style: TextStyle(fontSize: 13.0)), style: TextStyle(fontSize: 13.0)),
), ),
], ],
@ -175,7 +177,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
), ),
Container( Container(
child: new Text( child: new Text(
'I Accept the Terms And Conditions', TranslationBase.of(context).iAcceptTerms,
style: new TextStyle(fontSize: 14.0), style: new TextStyle(fontSize: 14.0),
), ),
), ),
@ -198,7 +200,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
alignment: Alignment.center, alignment: Alignment.center,
margin: EdgeInsets.only(top: 10.0), margin: EdgeInsets.only(top: 10.0),
child: new Text( child: new Text(
'You can pay by the following Options:', TranslationBase.of(context).upComingPayOption,
textAlign: TextAlign.center, textAlign: TextAlign.center,
style: new TextStyle(fontSize: 14.0), style: new TextStyle(fontSize: 14.0),
), ),
@ -236,8 +238,10 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
Expanded( Expanded(
child: InkWell( child: InkWell(
onTap: () { onTap: () {
if(_selected == 0) { if (_selected == 0) {
AppToast.showErrorToast(message: "Please accept terms & conditions to continue"); AppToast.showErrorToast(
message: TranslationBase.of(context)
.pleaseAcceptTerms);
} else { } else {
Navigator.pop(context, true); Navigator.pop(context, true);
} }
@ -255,7 +259,7 @@ class _LiveCarePaymentDialogState extends State<LiveCarePaymentDialog> {
), ),
), ),
], ],
), )),
), ),
), ),
); );

@ -535,7 +535,8 @@ class _clinic_listState extends State<ClinicList> {
isDataLoaded isDataLoaded
? Container( ? Container(
height: MediaQuery.of(context).size.height * 0.7, height: MediaQuery.of(context).size.height * 0.7,
child: Column( child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Container( Container(
@ -575,7 +576,7 @@ class _clinic_listState extends State<ClinicList> {
height: 10.0, height: 10.0,
), ),
], ],
), )),
) )
: Container(), : Container(),
isDataLoaded isDataLoaded
@ -584,7 +585,7 @@ class _clinic_listState extends State<ClinicList> {
child: Container( child: Container(
width: MediaQuery.of(context).size.width, width: MediaQuery.of(context).size.width,
height: 50.0, height: 50.0,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 10.0), margin: EdgeInsets.fromLTRB(20.0, 10.0, 20.0, 20.0),
child: ButtonTheme( child: ButtonTheme(
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0), borderRadius: BorderRadius.circular(10.0),

@ -543,6 +543,7 @@ class _ConfirmLogin extends State<ConfirmLogin> {
// sharedPref.setString( // sharedPref.setString(
// BLOOD_TYPE, result['PatientBloodType']), // BLOOD_TYPE, result['PatientBloodType']),
authenticatedUserObject.user = result.list, authenticatedUserObject.user = result.list,
sharedPref.setObject(MAIN_USER, result.list), sharedPref.setObject(MAIN_USER, result.list),
sharedPref.setObject(USER_PROFILE, result.list), sharedPref.setObject(USER_PROFILE, result.list),
loginTokenID = result.logInTokenID, loginTokenID = result.logInTokenID,

@ -1,3 +1,4 @@
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/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart'; import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
@ -40,6 +41,7 @@ class Login extends StatefulWidget {
class _Login extends State<Login> { class _Login extends State<Login> {
final util = Utils(); final util = Utils();
final nationalIDorFile = TextEditingController(); final nationalIDorFile = TextEditingController();
final mobileNumberController = TextEditingController();
final int loginType = LoginType.loginType; final int loginType = LoginType.loginType;
String mobileNo; String mobileNo;
String countryCode = '966'; String countryCode = '966';
@ -62,6 +64,11 @@ class _Login extends State<Login> {
void initState() { void initState() {
// getDeviceToken(); // getDeviceToken();
super.initState(); super.initState();
if(BASE_URL.contains("uat.")){
nationalIDorFile.text = "1231755";
mobileNumberController.text = mobileNo = "537503378";
}
} }
getDeviceToken() async { getDeviceToken() async {
@ -102,6 +109,7 @@ class _Login extends State<Login> {
Directionality( Directionality(
textDirection: TextDirection.ltr, textDirection: TextDirection.ltr,
child: MobileNo( child: MobileNo(
controller: mobileNumberController,
onNumberChange: (value) => onNumberChange: (value) =>
{mobileNo = value, validateForm()}, {mobileNo = value, validateForm()},
onCountryChange: (value) => countryCode = value)), onCountryChange: (value) => countryCode = value)),
@ -266,6 +274,8 @@ class _Login extends State<Login> {
appointmentRateViewModel.isLogin = true; appointmentRateViewModel.isLogin = true;
projectViewModel.isLogin = true; projectViewModel.isLogin = true;
authenticatedUserObject.user = result.list; authenticatedUserObject.user = result.list;
// authenticatedUserObject.user.cRSVerificationStatus =
// result['CRSVerificationStatus'];
projectViewModel.user = authenticatedUserObject.user; projectViewModel.user = authenticatedUserObject.user;
await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { await pharmacyModuleViewModel.generatePharmacyToken().then((value) async {

@ -359,7 +359,8 @@ class _RegisterInfo extends State<RegisterInfo> {
"DateofBirth": DateUtil.convertISODateToJsonDate( "DateofBirth": DateUtil.convertISODateToJsonDate(
registerInfo.dateOfBirth.replaceAll('/', '-')), registerInfo.dateOfBirth.replaceAll('/', '-')),
"Gender": registerInfo.gender == 'M' ? 1 : 2, "Gender": registerInfo.gender == 'M' ? 1 : 2,
"NationalityID": registerInfo.nationality, "NationalityID": registerInfo.nationalityCode,
"eHealthIDField": registerInfo.healthId,
"DateofBirthN": date, "DateofBirthN": date,
"EmailAddress": email, "EmailAddress": email,
"SourceType": location, "SourceType": location,

@ -49,7 +49,8 @@ class ActiveMedicationsPage extends StatelessWidget {
height: 5, height: 5,
), ),
Texts( Texts(
TranslationBase.of(context).expDate+' :' + TranslationBase.of(context).expDate +
' :' +
DateUtil.getDayMonthYearDateFormatted(model DateUtil.getDayMonthYearDateFormatted(model
.activePrescriptionReport[index].orderDate), .activePrescriptionReport[index].orderDate),
), ),
@ -57,21 +58,24 @@ class ActiveMedicationsPage extends StatelessWidget {
height: 5, height: 5,
), ),
Texts( Texts(
TranslationBase.of(context).route+ ' :' + TranslationBase.of(context).route +
' :' +
model.activePrescriptionReport[index].route, model.activePrescriptionReport[index].route,
), ),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
Texts( Texts(
TranslationBase.of(context).frequency+ ' :' + TranslationBase.of(context).frequency +
' :' +
model.activePrescriptionReport[index].frequency, model.activePrescriptionReport[index].frequency,
), ),
SizedBox( SizedBox(
height: 5, height: 5,
), ),
Texts( Texts(
TranslationBase.of(context).dailyQuantity + ' :${model.activePrescriptionReport[index].doseDailyQuantity}', TranslationBase.of(context).dailyQuantity +
' :${model.activePrescriptionReport[index].doseDailyQuantity}',
), ),
], ],
), ),
@ -86,16 +90,20 @@ class ActiveMedicationsPage extends StatelessWidget {
color: Colors.red, color: Colors.red,
size: 28, size: 28,
), ),
SizedBox(height: 25,), SizedBox(
height: 25,
),
InkWell( InkWell(
onTap: (){ onTap: () {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: ReminderPage( page: ReminderPage(
frequency: model.activePrescriptionReport[index] frequency: model
.activePrescriptionReport[index]
.frequencyNumber, .frequencyNumber,
days: model.activePrescriptionReport[index].days, days: model
.activePrescriptionReport[index].days,
itemDescription: model itemDescription: model
.activePrescriptionReport[index] .activePrescriptionReport[index]
.itemDescription, .itemDescription,

@ -32,7 +32,16 @@ class WeightMonthlyPage extends StatelessWidget {
body: model.weighMonthTimeSeriesData.isEmpty body: model.weighMonthTimeSeriesData.isEmpty
? Container( ? Container(
child: Center( child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable), child: Container(
child: Center(
child: MonthLineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weighMonthTimeSeriesData,
indexes: model.weighMonthTimeSeriesData.length ~/ 5.5 ?? 0,
),
),
),
), ),
) )
: ListView( : ListView(

@ -30,7 +30,12 @@ class WeightWeeklyPage extends StatelessWidget {
child: Center( child: Center(
child: Container( child: Container(
child: Center( child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable), child: LineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightWeekTimeSeriesData,
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0,
),
), ),
), ),
), ),

@ -31,7 +31,16 @@ class WeightYearPage extends StatelessWidget {
body: model.weightYearTimeSeriesData.isEmpty body: model.weightYearTimeSeriesData.isEmpty
? Container( ? Container(
child: Center( child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable), child: Container(
child: Center(
child: LineChartCurved(
horizontalInterval: 1.0,
title: TranslationBase.of(context).weight,
timeSeries: model.weightYearTimeSeriesData,
indexes: model.weightWeekTimeSeriesData.length ~/ 5.5 ?? 0,
),
),
),
), ),
) )
: ListView( : ListView(

@ -27,13 +27,13 @@ class AddBloodPressurePage extends StatefulWidget {
const AddBloodPressurePage( const AddBloodPressurePage(
{Key key, {Key key,
this.bloodSugarDate, this.bloodSugarDate,
this.measureTimeSelectedType, this.measureTimeSelectedType,
this.isUpdate = false, this.isUpdate = false,
this.lineItemNo, this.lineItemNo,
this.model, this.model,
this.bloodSystolicValue, this.bloodSystolicValue,
this.bloodDiastolicValue}) this.bloodDiastolicValue})
: super(key: key); : super(key: key);
@override @override
@ -42,15 +42,14 @@ class AddBloodPressurePage extends StatefulWidget {
class _AddBloodPressurePageState extends State<AddBloodPressurePage> { class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
TextEditingController _bloodSystolicValueController = TextEditingController(); TextEditingController _bloodSystolicValueController = TextEditingController();
TextEditingController _bloodDiastolicValueController = TextEditingController _bloodDiastolicValueController = TextEditingController();
TextEditingController();
DateTime bloodSugarDate = DateTime.now(); DateTime bloodSugarDate = DateTime.now();
DateTime timeSugarDate = DateTime.now(); DateTime timeSugarDate = DateTime.now();
int measuredArm = 1; int measuredArm = 1;
bool isButtonDisabled = false; bool isButtonDisabled = false;
final List<String> measureTimeEnList = [ final List<String> measureTimeEnList = [
'Left', 'Left arm ',
'Right', 'Right arm',
]; ];
final List<String> measureTimeArList = [ final List<String> measureTimeArList = [
'الذراع الأيسر', 'الذراع الأيسر',
@ -81,44 +80,38 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: widget.isUpdate appBarTitle: widget.isUpdate ? TranslationBase.of(context).update : TranslationBase.of(context).add,
? TranslationBase.of(context).update
: TranslationBase.of(context).add,
appBarIcons: widget.isUpdate appBarIcons: widget.isUpdate
? [ ? [
IconButton( IconButton(
icon: Icon(Icons.delete), icon: Icon(Icons.delete),
color: Colors.white, color: Colors.white,
onPressed: () { onPressed: () {
ConfirmDialog dialog = new ConfirmDialog( ConfirmDialog dialog = new ConfirmDialog(
context: context, context: context,
confirmMessage: 'Remove this measure', confirmMessage: 'Remove this measure',
okText: TranslationBase.of(context).ok, okText: TranslationBase.of(context).ok,
cancelText: TranslationBase.of(context).cancel, cancelText: TranslationBase.of(context).cancel,
okFunction: () async { okFunction: () async {
ConfirmDialog.closeAlertDialog(context); ConfirmDialog.closeAlertDialog(context);
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.model widget.model.deactivateDiabeticStatus(lineItemNo: widget.lineItemNo).then((value) {
.deactivateDiabeticStatus( GifLoaderDialogUtils.hideDialog(context);
lineItemNo: widget.lineItemNo) if (widget.model.state == ViewState.ErrorLocal)
.then((value) { AppToast.showErrorToast(message: widget.model.error);
GifLoaderDialogUtils.hideDialog(context); else
if (widget.model.state == ViewState.ErrorLocal) Navigator.pop(context);
AppToast.showErrorToast( }).catchError((e) {
message: widget.model.error); GifLoaderDialogUtils.hideDialog(context);
else AppToast.showErrorToast(message: widget.model.error);
Navigator.pop(context); });
}).catchError((e) { },
GifLoaderDialogUtils.hideDialog(context); cancelFunction: () => {});
AppToast.showErrorToast(message: widget.model.error); dialog.showAlertDialog(context);
}); },
}, )
cancelFunction: () => {}); ]
dialog.showAlertDialog(context);
},
)
]
: null, : null,
body: SingleChildScrollView( body: SingleChildScrollView(
physics: BouncingScrollPhysics(), physics: BouncingScrollPhysics(),
@ -151,17 +144,13 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
confirmSelectMeasureTimeDialog(projectViewModel.isArabic confirmSelectMeasureTimeDialog(!projectViewModel.isArabic ? measureTimeArList : measureTimeEnList);
? measureTimeEnList
: measureTimeArList);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -183,22 +172,18 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
showTitleActions: true, showTitleActions: true,
minTime: DateTime(DateTime.now().year - 1, 1, 1), minTime: DateTime(DateTime.now().year - 1, 1, 1),
maxTime: DateTime.now(), onConfirm: (date) { maxTime: DateTime.now(), onConfirm: (date) {
setState( setState(
() { () {
bloodSugarDate = date; bloodSugarDate = date;
},
);
}, },
currentTime: bloodSugarDate, );
locale: projectViewModel.localeType); }, currentTime: bloodSugarDate, locale: projectViewModel.localeType);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [
@ -213,30 +198,22 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
), ),
InkWell( InkWell(
onTap: () { onTap: () {
DatePicker.showTimePicker(context, showTitleActions: true, DatePicker.showTimePicker(context, showTitleActions: true, onConfirm: (date) {
onConfirm: (date) { setState(
setState( () {
() { timeSugarDate = date;
timeSugarDate = date;
},
);
}, },
currentTime: timeSugarDate, );
locale: projectViewModel.localeType); }, currentTime: timeSugarDate, locale: projectViewModel.localeType);
}, },
child: Container( child: Container(
padding: EdgeInsets.all(12), padding: EdgeInsets.all(12),
width: double.infinity, width: double.infinity,
height: 65, height: 65,
decoration: BoxDecoration( decoration: BoxDecoration(borderRadius: BorderRadius.circular(12), color: Colors.white),
borderRadius: BorderRadius.circular(12),
color: Colors.white),
child: Row( child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween, mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [ children: [Texts(TranslationBase.of(context).time), Texts(getTime())],
Texts(TranslationBase.of(context).time),
Texts(getTime())
],
), ),
), ),
), ),
@ -254,23 +231,18 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
loading: widget.model.state == ViewState.BusyLocal, loading: widget.model.state == ViewState.BusyLocal,
label: TranslationBase.of(context).save.toUpperCase(), label: TranslationBase.of(context).save.toUpperCase(),
textColor: Colors.white, textColor: Colors.white,
color: isButtonDisabled color: isButtonDisabled ? Colors.grey[900] : Colors.grey,
? Colors.grey[900]
: Colors.grey,
onTap: () async { onTap: () async {
if (_bloodSystolicValueController.text.isNotEmpty && if (_bloodSystolicValueController.text.isNotEmpty && _bloodDiastolicValueController.text.isNotEmpty) {
_bloodDiastolicValueController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.model widget.model
.addORUpdateDiabtecResult( .addORUpdateDiabtecResult(
isUpdate: widget.isUpdate, isUpdate: widget.isUpdate,
bloodPressureDate: bloodPressureDate:
'${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
diastolicPressure: diastolicPressure: _bloodDiastolicValueController.text.toString(),
_bloodDiastolicValueController.text.toString(), systolicePressure: _bloodSystolicValueController.text.toString(),
systolicePressure:
_bloodSystolicValueController.text.toString(),
measuredArm: measuredArm, measuredArm: measuredArm,
) )
.then((value) { .then((value) {
@ -318,7 +290,7 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
} }
void validateForm() { void validateForm() {
print("_bloodSystolicValueController "+_bloodSystolicValueController.text.length.toString()); print("_bloodSystolicValueController " + _bloodSystolicValueController.text.length.toString());
if (measureTimeSelectedType != 'Left Arm' && if (measureTimeSelectedType != 'Left Arm' &&
_bloodSystolicValueController.text.length > 0 && _bloodSystolicValueController.text.length > 0 &&
_bloodDiastolicValueController.text.length > 0) { _bloodDiastolicValueController.text.length > 0) {
@ -348,5 +320,4 @@ class _AddBloodPressurePageState extends State<AddBloodPressurePage> {
// }); // });
// } // }
} }
} }

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthCurvedChartBloodPressure.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -21,7 +22,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
body: model.weighMonthTimeSeriesDataTop.isEmpty? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):ListView( body: ListView(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8), margin: EdgeInsets.only(top: 12, left: 8, right: 8),
@ -29,8 +30,8 @@ class BloodPressureMonthlyPage extends StatelessWidget {
child: MonthCurvedChartBloodPressure( child: MonthCurvedChartBloodPressure(
horizontalInterval: 20.0, horizontalInterval: 20.0,
title: TranslationBase.of(context).bloodPressure, title: TranslationBase.of(context).bloodPressure,
timeSeries1: model.weighMonthTimeSeriesDataTop, timeSeries1: model.weighMonthTimeSeriesDataTop.isEmpty?[TimeSeriesSales3(0,0.0)]:model.weighMonthTimeSeriesDataTop,
timeSeries2: model.weighMonthTimeSeriesDataLow, timeSeries2: model.weighMonthTimeSeriesDataLow.isEmpty?[TimeSeriesSales3(0,0.0)]:model.weighMonthTimeSeriesDataLow,
indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5, indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5,
), ),
), ),
@ -47,7 +48,7 @@ class BloodPressureMonthlyPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Table( model.weighMonthTimeSeriesDataTop.isEmpty? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):Table(
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), inside: BorderSide(width: 2.0, color: Colors.grey[300]),
), ),

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
@ -18,7 +19,7 @@ class BloodPressureYearPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
body: model.weightYearTimeSeriesDataTop.isEmpty? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):ListView( body:ListView(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8), margin: EdgeInsets.only(top: 12, left: 8, right: 8),
@ -26,8 +27,8 @@ class BloodPressureYearPage extends StatelessWidget {
child: CurvedChartBloodPressure( child: CurvedChartBloodPressure(
horizontalInterval: 3.0,// model.weightWeekTimeSeriesDataLow.length==1 ?1 :20.0, horizontalInterval: 3.0,// model.weightWeekTimeSeriesDataLow.length==1 ?1 :20.0,
title: TranslationBase.of(context).bloodPressure, title: TranslationBase.of(context).bloodPressure,
timeSeries1: model.weightYearTimeSeriesDataTop, timeSeries1: model.weightYearTimeSeriesDataTop.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:model.weightYearTimeSeriesDataTop,
timeSeries2: model.weightYearTimeSeriesDataLow, timeSeries2: model.weightYearTimeSeriesDataLow.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:model.weightYearTimeSeriesDataLow,
indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5, indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5,
), ),
), ),
@ -44,7 +45,7 @@ class BloodPressureYearPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Table( model.weightYearTimeSeriesDataTop.isEmpty? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),):Table(
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), inside: BorderSide(width: 2.0, color: Colors.grey[300]),
), ),

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/CurvedChartBloodPressure.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.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';
@ -21,7 +22,7 @@ class BloodPressureWeeklyPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
body: model.weightWeekTimeSeriesDataTop.isEmpty? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),): ListView( body: ListView(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8), margin: EdgeInsets.only(top: 12, left: 8, right: 8),
@ -29,8 +30,8 @@ class BloodPressureWeeklyPage extends StatelessWidget {
child: CurvedChartBloodPressure( child: CurvedChartBloodPressure(
horizontalInterval:3.0, horizontalInterval:3.0,
title: TranslationBase.of(context).bloodPressure, title: TranslationBase.of(context).bloodPressure,
timeSeries1: model.weightWeekTimeSeriesDataTop, timeSeries1: model.weightWeekTimeSeriesDataTop.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:model.weightWeekTimeSeriesDataTop,
timeSeries2: model.weightWeekTimeSeriesDataLow, timeSeries2: model.weightWeekTimeSeriesDataLow.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:model.weightWeekTimeSeriesDataLow,
indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5, indexes: model.weightWeekTimeSeriesDataLow.length ~/ 5.5,
), ),
), ),
@ -47,7 +48,7 @@ class BloodPressureWeeklyPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Table( model.weightWeekTimeSeriesDataTop.isEmpty? Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),): Table(
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), inside: BorderSide(width: 2.0, color: Colors.grey[300]),
), ),

@ -282,11 +282,11 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
label: TranslationBase.of(context).save.toUpperCase(), label: TranslationBase.of(context).save.toUpperCase(),
textColor: Colors.white, textColor: Colors.white,
color: isButtonDisabled ? Colors.grey[900] : Colors.grey, color: isButtonDisabled ? Colors.grey[900] : Colors.grey,
onTap: () { onTap: () async {
if (_bloodSugarValueController.text.isNotEmpty) { if (_bloodSugarValueController.text.isNotEmpty) {
if (widget.isUpdate) { if (widget.isUpdate) {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
widget.bloodSugarViewMode await widget.bloodSugarViewMode
.updateDiabtecResult( .updateDiabtecResult(
month: bloodSugarDate, month: bloodSugarDate,
hour: timeSugarDate, hour: timeSugarDate,
@ -294,8 +294,8 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
measuredTime: measuredTime, measuredTime: measuredTime,
lineItemNo: widget.lineItemNo, lineItemNo: widget.lineItemNo,
bloodSugerResult: bloodSugerResult:
_bloodSugarValueController.text.toString()) _bloodSugarValueController.text.toString());
.then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state == if (widget.bloodSugarViewMode.state ==
ViewState.ErrorLocal) ViewState.ErrorLocal)
@ -303,9 +303,10 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
message: widget.bloodSugarViewMode.error); message: widget.bloodSugarViewMode.error);
else else
Navigator.pop(context); Navigator.pop(context);
});
} else } else {
widget.bloodSugarViewMode GifLoaderDialogUtils.showMyDialog(context);
await widget.bloodSugarViewMode
.addDiabtecResult( .addDiabtecResult(
diabtecUnit: measureUnitSelectedType, diabtecUnit: measureUnitSelectedType,
measuredTime: measuredTime, measuredTime: measuredTime,
@ -313,15 +314,17 @@ class _AddBloodSugarPageState extends State<AddBloodSugarPage> {
_bloodSugarValueController.text.toString(), _bloodSugarValueController.text.toString(),
bloodSugerDateChart: bloodSugerDateChart:
'${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00', '${bloodSugarDate.year}-${bloodSugarDate.month}-${bloodSugarDate.day} ${timeSugarDate.hour}:${timeSugarDate.minute}:00',
) );
.then((value) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (widget.bloodSugarViewMode.state == ViewState.Error) if (widget.bloodSugarViewMode.state == ViewState.Error)
AppToast.showErrorToast( AppToast.showErrorToast(
message: widget.bloodSugarViewMode.error); message: widget.bloodSugarViewMode.error);
else else
Navigator.pop(context); Navigator.pop(context);
});
}
} }
}), }),
), ),

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/YearMonthlyChartDate.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthLineChartCurved.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/MonthLineChartCurved.dart';
@ -17,25 +18,32 @@ import 'package:provider/provider.dart';
class BloodMonthlyPage extends StatelessWidget { class BloodMonthlyPage extends StatelessWidget {
final List<DiabtecPatientResult> diabtecPatientResult; final List<DiabtecPatientResult> diabtecPatientResult;
final List<TimeSeriesSales3> timeSeriesData ; final List<TimeSeriesSales3> timeSeriesData;
final BloodSugarViewMode bloodSugarViewMode;
const BloodMonthlyPage({Key key, this.diabtecPatientResult, this.timeSeriesData})
const BloodMonthlyPage(
{Key key, this.diabtecPatientResult, this.timeSeriesData, this.bloodSugarViewMode})
: super(key: key); : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
body: timeSeriesData.isEmpty?Container(child: Center(child: Texts(TranslationBase.of(context).noDataAvailable),),): ListView( baseViewModel: bloodSugarViewMode,
body: ListView(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8),
width: double.maxFinite, width: double.maxFinite,
color: Colors.white, color: Colors.white,
child: MonthLineChartCurved( child: MonthLineChartCurved(
title: 'Sugar', title: '${TranslationBase.of(context).bloodSugar}',
timeSeries: timeSeriesData, timeSeries: timeSeriesData.isEmpty
? [TimeSeriesSales3(0, 0.0)]
: timeSeriesData,
indexes: timeSeriesData.length ~/ 5.5, indexes: timeSeriesData.length ~/ 5.5,
) )),
),
SizedBox( SizedBox(
height: 12, height: 12,
), ),
@ -49,12 +57,20 @@ class BloodMonthlyPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Table( timeSeriesData.isEmpty
border: TableBorder.symmetric( ? Container(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), child: Center(
), child: Texts(
children: fullData(context,projectViewModel), TranslationBase.of(context).noDataAvailable),
), ),
)
: Table(
border: TableBorder.symmetric(
inside:
BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(context, projectViewModel),
),
], ],
), ),
) )
@ -63,7 +79,8 @@ class BloodMonthlyPage extends StatelessWidget {
); );
} }
List<TableRow> fullData(BuildContext context,ProjectViewModel projectViewModel) { List<TableRow> fullData(
BuildContext context, ProjectViewModel projectViewModel) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
@ -73,8 +90,12 @@ class BloodMonthlyPage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), topLeft: projectViewModel.isArabic
topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0), ? Radius.circular(0.0)
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
), ),
), ),
child: Center( child: Center(
@ -120,8 +141,12 @@ class BloodMonthlyPage extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0), topLeft: projectViewModel.isArabic
topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0), ? Radius.circular(10.0)
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
), ),
), ),
child: Center( child: Center(
@ -133,7 +158,6 @@ class BloodMonthlyPage extends StatelessWidget {
), ),
height: 40), height: 40),
), ),
], ],
), ),
); );
@ -149,7 +173,7 @@ class BloodMonthlyPage extends StatelessWidget {
color: Colors.white, color: Colors.white,
child: Center( child: Center(
child: Texts( child: Texts(
'${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart):DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ', '${projectViewModel.isArabic ? DateUtil.getMonthDayYearDateFormattedAr(diabtec.dateChart) : DateUtil.getMonthDayYearDateFormatted(diabtec.dateChart)} ',
textAlign: TextAlign.center, textAlign: TextAlign.center,
fontSize: 12, fontSize: 12,
), ),

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/blood_sugar/DiabtecPatientResult.dart';
import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart'; import 'package:diplomaticquarterapp/core/model/my_trakers/chartData/WeekChartDate.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/blood_sugar_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart'; import 'package:diplomaticquarterapp/pages/medical/my_trackers/widget/LineChartCurved.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
@ -16,27 +17,24 @@ import 'package:provider/provider.dart';
class BloodYearPage extends StatelessWidget { class BloodYearPage extends StatelessWidget {
final List<DiabtecPatientResult> diabtecPatientResult; final List<DiabtecPatientResult> diabtecPatientResult;
final List<TimeSeriesSales2> timeSeriesData; final List<TimeSeriesSales2> timeSeriesData;
final BloodSugarViewMode bloodSugarViewMode;
const BloodYearPage({Key key, this.diabtecPatientResult, this.timeSeriesData}) : super(key: key); const BloodYearPage({Key key, this.diabtecPatientResult, this.timeSeriesData, this.bloodSugarViewMode}) : super(key: key);
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
body: timeSeriesData.isEmpty baseViewModel: bloodSugarViewMode,
? Container( body: ListView(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
: ListView(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8),
width: double.maxFinite, width: double.maxFinite,
color: Colors.white, color: Colors.white,
child: LineChartCurved( child: LineChartCurved(
title: 'Sugar', title: '${TranslationBase.of(context).bloodSugar}',
timeSeries: timeSeriesData, timeSeries: timeSeriesData.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:timeSeriesData,
indexes: timeSeriesData.length ~/ 5.5 ?? 0, indexes: timeSeriesData.length ~/ 5.5 ?? 0,
)), )),
SizedBox( SizedBox(
@ -52,7 +50,13 @@ class BloodYearPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Table( timeSeriesData.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
:Table(
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), inside: BorderSide(width: 2.0, color: Colors.grey[300]),
), ),

@ -75,7 +75,7 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage>
),], ),],
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).bloodSugar, appBarTitle: TranslationBase.of(context).bloodSugar,
baseViewModel: model, // baseViewModel: model,
body: Scaffold( body: Scaffold(
extendBodyBehindAppBar: true, extendBodyBehindAppBar: true,
appBar: TabBarWidget(tabController: _tabController,), appBar: TabBarWidget(tabController: _tabController,),
@ -93,11 +93,12 @@ class _BloodSugarHomePageState extends State<BloodSugarHomePage>
), ),
BloodMonthlyPage( BloodMonthlyPage(
timeSeriesData: model.monthTimeSeriesData, timeSeriesData: model.monthTimeSeriesData,
diabtecPatientResult: model.monthDiabtecPatientResult, diabtecPatientResult: model.monthDiabtecPatientResult, bloodSugarViewMode: model,
), ),
BloodYearPage( BloodYearPage(
timeSeriesData: model.yearTimeSeriesData, timeSeriesData: model.yearTimeSeriesData,
diabtecPatientResult: model.yearDiabtecPatientResult, diabtecPatientResult: model.yearDiabtecPatientResult,
bloodSugarViewMode: model,
) )
], ],
), ),

@ -31,20 +31,15 @@ class BloodSugarWeeklyPage extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold( return AppScaffold(
body: timeSeriesData.isEmpty baseViewModel: bloodSugarViewMode,
? Container( body: ListView(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
: ListView(
children: [ children: [
Container( Container(
margin: EdgeInsets.only(top: 12, left: 8, right: 8), margin: EdgeInsets.only(top: 12, left: 8, right: 8),
color: Colors.white, color: Colors.white,
child: LineChartCurved( child: LineChartCurved(
title: 'Sugar', title: '${TranslationBase.of(context).bloodSugar}',
timeSeries: timeSeriesData, timeSeries: timeSeriesData.isEmpty?[TimeSeriesSales2(DateTime.now(),0.0)]:timeSeriesData,
indexes: timeSeriesData.length ~/ 5.5, indexes: timeSeriesData.length ~/ 5.5,
), ),
), ),
@ -61,7 +56,13 @@ class BloodSugarWeeklyPage extends StatelessWidget {
child: Column( child: Column(
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Table( timeSeriesData.isEmpty
? Container(
child: Center(
child: Texts(TranslationBase.of(context).noDataAvailable),
),
)
:Table(
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]), inside: BorderSide(width: 2.0, color: Colors.grey[300]),
), ),

@ -10,11 +10,7 @@ class LineChartCurved extends StatelessWidget {
final int indexes; final int indexes;
final double horizontalInterval; final double horizontalInterval;
LineChartCurved( LineChartCurved({this.title, this.timeSeries, this.indexes, this.horizontalInterval = 20.0});
{this.title,
this.timeSeries,
this.indexes,
this.horizontalInterval = 20.0});
List<int> xAxixs = List(); List<int> xAxixs = List();
List<double> yAxixs = List(); List<double> yAxixs = List();
@ -24,7 +20,7 @@ class LineChartCurved extends StatelessWidget {
getXaxix(); getXaxix();
getYaxix(); getYaxix();
return AspectRatio( return AspectRatio(
aspectRatio: 1.1, aspectRatio: 1.0,
child: Container( child: Container(
decoration: const BoxDecoration( decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(18)), borderRadius: BorderRadius.all(Radius.circular(18)),
@ -40,8 +36,7 @@ class LineChartCurved extends StatelessWidget {
), ),
Text( Text(
title, title,
style: TextStyle( style: TextStyle(color: Colors.black, fontSize: 15, letterSpacing: 2),
color: Colors.black, fontSize: 15, letterSpacing: 2),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
SizedBox( SizedBox(
@ -49,8 +44,7 @@ class LineChartCurved extends StatelessWidget {
), ),
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15, bottom: 15),
right: 18.0, left: 16.0, top: 15, bottom: 15),
child: LineChart( child: LineChart(
sampleData1(context), sampleData1(context),
swapAnimationDuration: const Duration(milliseconds: 250), swapAnimationDuration: const Duration(milliseconds: 250),
@ -97,10 +91,7 @@ class LineChartCurved extends StatelessWidget {
handleBuiltInTouches: true, handleBuiltInTouches: true,
), ),
gridData: FlGridData( gridData: FlGridData(
horizontalInterval: horizontalInterval, horizontalInterval: horizontalInterval, show: true, drawVerticalLine: true, drawHorizontalLine: true),
show: true,
drawVerticalLine: true,
drawHorizontalLine: true),
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: SideTitles( bottomTitles: SideTitles(
showTitles: true, showTitles: true,
@ -137,12 +128,19 @@ class LineChartCurved extends StatelessWidget {
fontSize: 10, fontSize: 10,
), ),
getTitles: (value) { getTitles: (value) {
if (value.toInt() == 0) // if (value.toInt() == 0)
return '${value.toInt()}'; // return '${value.toInt()}';
else if (value.toInt() % horizontalInterval == 0) // else if (value.toInt() % horizontalInterval == 0)
return '${value.toInt()}'; // return '${value.toInt()}';
else // else
return ''; // return '';
// if (value.toInt() == 0)
// return '${value.toInt()}';
// else if (value.toInt() % horizontalInterval == 0)
// return '${value.toInt()}';
// else
return '${value.toInt()}';//'${(value.toInt() +(horizontalInterval - value.toInt() % horizontalInterval) )}';
}, },
margin: 12, margin: 12,
), ),
@ -196,6 +194,9 @@ class LineChartCurved extends StatelessWidget {
List<LineChartBarData> getData(context) { List<LineChartBarData> getData(context) {
List<FlSpot> spots = List(); List<FlSpot> spots = List();
if (timeSeries.length == 0) {
spots.add(FlSpot(0, 0));
}
for (int index = 0; index < timeSeries.length; index++) { for (int index = 0; index < timeSeries.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries[index].sales)); spots.add(FlSpot(index.toDouble(), timeSeries[index].sales));
} }

@ -21,7 +21,7 @@ class MonthCurvedChartBloodPressure extends StatelessWidget {
Widget build(BuildContext context) { Widget build(BuildContext context) {
getXaxix(); getXaxix();
return AspectRatio( return AspectRatio(
aspectRatio: 1.1, aspectRatio: 1.0,
child: Container( child: Container(
decoration: const BoxDecoration( decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(18)), borderRadius: BorderRadius.all(Radius.circular(18)),
@ -143,12 +143,12 @@ class MonthCurvedChartBloodPressure extends StatelessWidget {
fontSize: 10, fontSize: 10,
), ),
getTitles: (value) { getTitles: (value) {
if (value.toInt() == 0) // if (value.toInt() == 0)
// return '${value.toInt()}';
// else if (value.toInt() % horizontalInterval == 0)
// return '${value.toInt()}';
// else
return '${value.toInt()}'; return '${value.toInt()}';
else if (value.toInt() % horizontalInterval == 0)
return '${value.toInt()}';
else
return '';
}, },
margin: 12, margin: 12,
), ),

@ -10,11 +10,7 @@ class MonthLineChartCurved extends StatelessWidget {
final int indexes; final int indexes;
final double horizontalInterval; final double horizontalInterval;
MonthLineChartCurved( MonthLineChartCurved({this.title, this.timeSeries, this.indexes, this.horizontalInterval = 15.0});
{this.title,
this.timeSeries,
this.indexes,
this.horizontalInterval = 15.0});
List<int> xAxixs = List(); List<int> xAxixs = List();
List<double> yAxixs = List(); List<double> yAxixs = List();
@ -40,8 +36,7 @@ class MonthLineChartCurved extends StatelessWidget {
), ),
Text( Text(
title, title,
style: TextStyle( style: TextStyle(color: Colors.black, fontSize: 15, letterSpacing: 2),
color: Colors.black, fontSize: 15, letterSpacing: 2),
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
SizedBox( SizedBox(
@ -49,8 +44,7 @@ class MonthLineChartCurved extends StatelessWidget {
), ),
Expanded( Expanded(
child: Padding( child: Padding(
padding: const EdgeInsets.only( padding: const EdgeInsets.only(right: 18.0, left: 16.0, top: 15, bottom: 15),
right: 18.0, left: 16.0, top: 15, bottom: 15),
child: LineChart( child: LineChart(
sampleData1(context), sampleData1(context),
swapAnimationDuration: const Duration(milliseconds: 250), swapAnimationDuration: const Duration(milliseconds: 250),
@ -97,10 +91,7 @@ class MonthLineChartCurved extends StatelessWidget {
handleBuiltInTouches: true, handleBuiltInTouches: true,
), ),
gridData: FlGridData( gridData: FlGridData(
horizontalInterval: horizontalInterval, horizontalInterval: horizontalInterval, show: true, drawVerticalLine: true, drawHorizontalLine: true),
show: true,
drawVerticalLine: true,
drawHorizontalLine: true),
titlesData: FlTitlesData( titlesData: FlTitlesData(
bottomTitles: SideTitles( bottomTitles: SideTitles(
showTitles: true, showTitles: true,
@ -180,6 +171,9 @@ class MonthLineChartCurved extends StatelessWidget {
List<LineChartBarData> getData(context) { List<LineChartBarData> getData(context) {
List<FlSpot> spots = List(); List<FlSpot> spots = List();
if (timeSeries.length == 0) {
spots.add(FlSpot(0, 0));
}
for (int index = 0; index < timeSeries.length; index++) { for (int index = 0; index < timeSeries.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries[index].sales)); spots.add(FlSpot(index.toDouble(), timeSeries[index].sales));
} }

@ -10,92 +10,94 @@ import 'package:maps_launcher/maps_launcher.dart';
import 'package:url_launcher/url_launcher.dart'; import 'package:url_launcher/url_launcher.dart';
class PharmacyForPrescriptionsPage extends StatelessWidget { class PharmacyForPrescriptionsPage extends StatelessWidget {
final PrescriptionReport prescriptionReport; final itemID;
PharmacyForPrescriptionsPage({Key key, this.prescriptionReport}); PharmacyForPrescriptionsPage({Key key, this.itemID});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<PrescriptionsViewModel>( return BaseView<PrescriptionsViewModel>(
onModelReady: (model) => model.getListPharmacyForPrescriptions(itemId: prescriptionReport.itemID), onModelReady: (model) =>
builder: (_, model, widget) => AppScaffold( model.getListPharmacyForPrescriptions(itemId: itemID),
isShowAppBar: true, builder: (_, model, widget) => AppScaffold(
appBarTitle: TranslationBase.of(context).availability, isShowAppBar: true,
baseViewModel: model, appBarTitle: TranslationBase.of(context).availability,
body: ListView.builder( baseViewModel: model,
itemBuilder: (context, index) => Container( body: ListView.builder(
width: double.infinity, itemBuilder: (context, index) => Container(
margin: EdgeInsets.only(top: 10, left: 10, right: 10), width: double.infinity,
padding: EdgeInsets.all(8.0), margin: EdgeInsets.only(top: 10, left: 10, right: 10),
decoration: BoxDecoration( padding: EdgeInsets.all(8.0),
color: Colors.white, decoration: BoxDecoration(
borderRadius: BorderRadius.all( color: Colors.white,
Radius.circular(10.0), borderRadius: BorderRadius.all(
), Radius.circular(10.0),
border: Border.all(color: Colors.grey[200], width: 0.5),
), ),
child: Row( border: Border.all(color: Colors.grey[200], width: 0.5),
children: <Widget>[ ),
ClipRRect( child: Row(
borderRadius: BorderRadius.all(Radius.circular(5)), children: <Widget>[
child: Image.network( ClipRRect(
model.pharmacyPrescriptionsList[index].projectImageURL, borderRadius: BorderRadius.all(Radius.circular(5)),
fit: BoxFit.cover, child: Image.network(
width: 60, model.pharmacyPrescriptionsList[index].projectImageURL,
height: 70, fit: BoxFit.cover,
), width: 60,
height: 70,
), ),
Expanded( ),
child: Padding( Expanded(
padding: const EdgeInsets.all(8.0), child: Padding(
child: Column( padding: const EdgeInsets.all(8.0),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: <Widget>[ crossAxisAlignment: CrossAxisAlignment.start,
Texts(model.pharmacyPrescriptionsList[index] children: <Widget>[
.locationDescription), Texts(model.pharmacyPrescriptionsList[index]
SizedBox( .locationDescription),
height: 5, SizedBox(
), height: 5,
Texts(model.pharmacyPrescriptionsList[index].cityName), ),
], Texts(model.pharmacyPrescriptionsList[index].cityName),
), ],
), ),
), ),
InkWell( ),
onTap: () { InkWell(
MapsLauncher.launchCoordinates( onTap: () {
double.parse( MapsLauncher.launchCoordinates(
model.pharmacyPrescriptionsList[index].latitude), double.parse(
double.parse( model.pharmacyPrescriptionsList[index].latitude),
model.pharmacyPrescriptionsList[index].longitude)); double.parse(
}, model.pharmacyPrescriptionsList[index].longitude));
},
child: Icon(
Icons.pin_drop,
size: 18,
color: Colors.red[900],
),
),
SizedBox(
width: 15,
),
InkWell(
onTap: Feedback.wrapForTap(() {
launch(
"tel://${model.pharmacyPrescriptionsList[index].phoneNumber}");
}, context),
child: Container(
child: Icon( child: Icon(
Icons.pin_drop, Icons.call,
size: 18, size: 18,
color: Colors.red[900], color: Colors.red[900],
), ),
), ),
SizedBox( )
width: 15, ],
),
InkWell(
onTap: Feedback.wrapForTap((){
launch("tel://${model.pharmacyPrescriptionsList[index].phoneNumber}");
},context),
child: Container(
child: Icon(
Icons.call,
size: 18,
color: Colors.red[900],
),
),
)
],
),
), ),
itemCount: model.pharmacyPrescriptionsList.length,
), ),
itemCount: model.pharmacyPrescriptionsList.length,
), ),
); ),
);
} }
} }

@ -0,0 +1,310 @@
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report_inp.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/reminder_dialog.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/pharmacy_for_prescriptions_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class PrescriptionDetailsPageINP extends StatelessWidget {
final PrescriptionReportINP prescriptionReport;
PrescriptionDetailsPageINP({Key key, this.prescriptionReport});
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).prescriptions,
body: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Container(
width: double.infinity,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
padding: EdgeInsets.all(8.0),
decoration: BoxDecoration(
color: Colors.white,
borderRadius: BorderRadius.all(
Radius.circular(10.0),
),
border: Border.all(color: Colors.grey[200], width: 0.5),
),
child: Row(
children: <Widget>[
ClipRRect(
borderRadius: BorderRadius.all(Radius.circular(5)),
child: Image.network(
prescriptionReport.imageSRCUrl,
fit: BoxFit.cover,
width: 60,
height: 70,
),
),
Expanded(
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(
prescriptionReport.itemDescription.isNotEmpty
? prescriptionReport.itemDescription
: prescriptionReport.itemDescriptionN ?? ''),
),
),
)
],
),
),
Container(
margin: EdgeInsets.all(8),
child: Row(
children: [
Expanded(
child: InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: PharmacyForPrescriptionsPage(
itemID: prescriptionReport.itemID),
),
),
child: Center(
child: Column(
children: <Widget>[
Container(
width: 50,
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.rectangle),
child: Column(
children: <Widget>[
Icon(
Icons.pin_drop,
color: Colors.red[800],
size: 55,
),
],
),
),
SizedBox(
height: 5,
),
Texts(TranslationBase.of(context).availability)
],
),
)),
),
_addReminderButton(context)
],
),
),
Container(
color: Colors.white,
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
child: Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 0.5),
outside: BorderSide(width: 0.5)),
children: [
TableRow(
children: [
Container(
color: Colors.white,
height: 40,
width: double.infinity,
child: Center(
child: Texts(
TranslationBase.of(context).route,
fontSize: 14,
))),
Container(
color: Colors.white,
height: 40,
width: double.infinity,
child: Center(
child: Texts(
TranslationBase.of(context).frequency,
fontSize: 14,
))),
Container(
color: Colors.white,
height: 40,
width: double.infinity,
padding: EdgeInsets.symmetric(horizontal: 4),
child: Center(
child: Texts(
"${TranslationBase.of(context).dailyDoses}",
fontSize: 14,
))),
Container(
color: Colors.white,
height: 40,
width: double.infinity,
child: Center(
child: Texts(
TranslationBase.of(context).duration,
fontSize: 14,
))),
],
),
TableRow(
children: [
Container(
color: Colors.white,
height: 50,
width: double.infinity,
child: Center(
child: Text(prescriptionReport.routeN ?? ''))),
Container(
color: Colors.white,
height: 50,
width: double.infinity,
child: Center(
child:
Text(prescriptionReport.frequencyN ?? ''))),
Container(
color: Colors.white,
height: 50,
width: double.infinity,
child: Center(
child: Text(
'${prescriptionReport.doseDailyQuantity}'))),
Container(
color: Colors.white,
height: 50,
width: double.infinity,
child:
Center(child: Text('${prescriptionReport.days}')))
],
),
],
),
),
Container(
margin: EdgeInsets.only(top: 10, left: 10, right: 10),
width: double.infinity,
color: Colors.white,
padding: EdgeInsets.all(5),
child: Center(
child: Column(
children: <Widget>[
Texts(TranslationBase.of(context).notes),
SizedBox(
height: 5,
),
Divider(
height: 0.5,
color: Colors.grey[300],
),
SizedBox(
height: 5,
),
Texts(prescriptionReport.remarks ?? ''),
],
),
),
)
],
),
),
);
}
Widget _addReminderButton(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return GestureDetector(
onTap: () {
DateTime startDate = DateTime.now();
DateTime endDate = DateTime(startDate.year, startDate.month,
startDate.day + prescriptionReport.days);
print(prescriptionReport);
showGeneralDialog(
barrierColor: Colors.black.withOpacity(0.5),
transitionBuilder: (context, a1, a2, widget) {
final curvedValue =
Curves.easeInOutBack.transform(a1.value) - 1.0;
return Transform(
transform:
Matrix4.translationValues(0.0, curvedValue * 200, 0.0),
child: Opacity(
opacity: a1.value,
child: ReminderDialog(
eventId: prescriptionReport.itemID.toString(),
title: "Prescription Reminder",
description:
"${prescriptionReport.itemDescriptionN} ${prescriptionReport.frequencyN} ${prescriptionReport.routeN} ",
startDate:
"/Date(${startDate.millisecondsSinceEpoch}+0300)/",
endDate: "/Date(${endDate.millisecondsSinceEpoch}+0300)/",
location: prescriptionReport.remarks,
),
),
);
},
transitionDuration: Duration(milliseconds: 500),
barrierDismissible: true,
barrierLabel: '',
context: context,
pageBuilder: (context, animation1, animation2) {});
},
child: Column(
mainAxisSize: MainAxisSize.max,
children: [
Container(
// height: 100.0,
margin: EdgeInsets.all(7.0),
padding: EdgeInsets.only(bottom: 4.0),
decoration: BoxDecoration(boxShadow: [
BoxShadow(
color: Colors.grey[400], blurRadius: 2.0, spreadRadius: 0.0)
], borderRadius: BorderRadius.circular(10), color: Colors.white),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
margin: EdgeInsets.fromLTRB(5.0, 5.0, 5.0, 0.0),
child: Text("add",
overflow: TextOverflow.clip,
style: TextStyle(
color: new Color(0xffB8382C),
letterSpacing: 1.0,
fontSize: 18.0)),
),
Container(
margin: EdgeInsets.fromLTRB(5.0, 0.0, 5.0, 0.0),
child: Text("reminder",
overflow: TextOverflow.clip,
style: TextStyle(
color: Colors.black,
letterSpacing: 1.0,
fontSize: 15.0)),
),
Container(
alignment: projectViewModel.isArabic
? Alignment.bottomLeft
: Alignment.bottomRight,
margin: projectViewModel.isArabic
? EdgeInsets.fromLTRB(10.0, 7.0, 0.0, 8.0)
: EdgeInsets.fromLTRB(0.0, 7.0, 10.0, 8.0),
child: Image.asset(
"assets/images/new-design/reminder_icon.png",
width: 45.0,
height: 45.0),
),
],
),
),
],
),
);
}
}

@ -53,7 +53,7 @@ class PrescriptionDetailsPage extends StatelessWidget {
child: Texts( child: Texts(
prescriptionReport.itemDescription.isNotEmpty prescriptionReport.itemDescription.isNotEmpty
? prescriptionReport.itemDescription ? prescriptionReport.itemDescription
: prescriptionReport.itemDescriptionN), : prescriptionReport.itemDescriptionN ?? ''),
), ),
), ),
) )
@ -70,7 +70,7 @@ class PrescriptionDetailsPage extends StatelessWidget {
context, context,
FadePage( FadePage(
page: PharmacyForPrescriptionsPage( page: PharmacyForPrescriptionsPage(
prescriptionReport: prescriptionReport), itemID: prescriptionReport.itemID),
), ),
), ),
child: Center( child: Center(
@ -118,14 +118,19 @@ class PrescriptionDetailsPage extends StatelessWidget {
height: 40, height: 40,
width: double.infinity, width: double.infinity,
child: Center( child: Center(
child: Texts(TranslationBase.of(context).route, fontSize: 14,))), child: Texts(
TranslationBase.of(context).route,
fontSize: 14,
))),
Container( Container(
color: Colors.white, color: Colors.white,
height: 40, height: 40,
width: double.infinity, width: double.infinity,
child: Center( child: Center(
child: child: Texts(
Texts(TranslationBase.of(context).frequency, fontSize: 14,))), TranslationBase.of(context).frequency,
fontSize: 14,
))),
Container( Container(
color: Colors.white, color: Colors.white,
height: 40, height: 40,
@ -133,14 +138,18 @@ class PrescriptionDetailsPage extends StatelessWidget {
padding: EdgeInsets.symmetric(horizontal: 4), padding: EdgeInsets.symmetric(horizontal: 4),
child: Center( child: Center(
child: Texts( child: Texts(
"${TranslationBase.of(context).dailyDoses}", fontSize: 14,))), "${TranslationBase.of(context).dailyDoses}",
fontSize: 14,
))),
Container( Container(
color: Colors.white, color: Colors.white,
height: 40, height: 40,
width: double.infinity, width: double.infinity,
child: Center( child: Center(
child: child: Texts(
Texts(TranslationBase.of(context).duration, fontSize: 14,))), TranslationBase.of(context).duration,
fontSize: 14,
))),
], ],
), ),
TableRow( TableRow(
@ -149,8 +158,8 @@ class PrescriptionDetailsPage extends StatelessWidget {
color: Colors.white, color: Colors.white,
height: 50, height: 50,
width: double.infinity, width: double.infinity,
child: child: Center(
Center(child: Text(prescriptionReport.routeN))), child: Text(prescriptionReport.routeN ?? ''))),
Container( Container(
color: Colors.white, color: Colors.white,
height: 50, height: 50,

@ -4,6 +4,7 @@ import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_repor
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_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/pages/medical/prescriptions/prescription_details_inp.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart'; import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
@ -24,7 +25,7 @@ class PrescriptionItemsPage extends StatelessWidget {
//TODO //TODO
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context); ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PrescriptionsViewModel>( return BaseView<PrescriptionsViewModel>(
onModelReady: (model) => onModelReady: (model) =>
model.getPrescriptionReport(prescriptions: prescriptions), model.getPrescriptionReport(prescriptions: prescriptions),
@ -38,14 +39,14 @@ class PrescriptionItemsPage extends StatelessWidget {
children: [ children: [
if (!prescriptions.isInOutPatient) if (!prescriptions.isInOutPatient)
...List.generate( ...List.generate(
model.prescriptionReportList.length, model.prescriptionReportListINP.length,
(index) => InkWell( (index) => InkWell(
onTap: () => Navigator.push( onTap: () => Navigator.push(
context, context,
FadePage( FadePage(
page: PrescriptionDetailsPage( page: PrescriptionDetailsPageINP(
prescriptionReport: prescriptionReport:
model.prescriptionReportList[index], model.prescriptionReportListINP[index],
), ),
), ),
), ),
@ -68,7 +69,7 @@ class PrescriptionItemsPage extends StatelessWidget {
borderRadius: borderRadius:
BorderRadius.all(Radius.circular(5)), BorderRadius.all(Radius.circular(5)),
child: Image.network( child: Image.network(
model.prescriptionReportList[index] model.prescriptionReportListINP[index]
.imageSRCUrl, .imageSRCUrl,
fit: BoxFit.cover, fit: BoxFit.cover,
width: 60, width: 60,
@ -83,13 +84,17 @@ class PrescriptionItemsPage extends StatelessWidget {
padding: const EdgeInsets.all(8.0), padding: const EdgeInsets.all(8.0),
child: Center( child: Center(
child: Texts(model child: Texts(model
.prescriptionReportList[index] .prescriptionReportListINP[index]
.itemDescription .itemDescription
.isNotEmpty .isNotEmpty
? model.prescriptionReportList[index] ? model
.prescriptionReportListINP[index]
.itemDescription .itemDescription
: model.prescriptionReportList[index] : model
.itemDescriptionN)), .prescriptionReportListINP[
index]
.itemDescriptionN ??
'')),
)), )),
Icon( Icon(
Icons.arrow_forward_ios, Icons.arrow_forward_ios,
@ -163,7 +168,12 @@ class PrescriptionItemsPage extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Texts(model.prescriptionReportEnhList[index] Texts(model.prescriptionReportEnhList[index]
.itemDescription), .itemDescription.isNotEmpty
? model.prescriptionReportEnhList[index]
.itemDescription
: model.prescriptionReportEnhList[index]
.itemDescriptionN ??
''),
], ],
), ),
), ),
@ -188,36 +198,37 @@ class PrescriptionItemsPage extends StatelessWidget {
child: Column( child: Column(
children: <Widget>[ children: <Widget>[
Divider(), Divider(),
if(projectViewModel.havePrivilege(13)) if (projectViewModel.havePrivilege(13))
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
label: TranslationBase.of(context).sendCopy,
onTap: () {
showConfirmMessage(context,model);
},
loading: model.state == ViewState.BusyLocal,
),
),
Container( Container(
width: MediaQuery.of(context).size.width * 0.8, width: MediaQuery.of(context).size.width * 0.8,
child: Button( child: Button(
label: TranslationBase.of(context).resendOrder, label: TranslationBase.of(context).sendCopy,
backgroundColor: Colors.green[800], onTap: () {
onTap: (){ showConfirmMessage(context, model);
},
Navigator.push( loading: model.state == ViewState.BusyLocal,
context, ),
FadePage( ),
page: PrescriptionDeliveryAddressPage( Container(
prescriptions: prescriptions, width: MediaQuery.of(context).size.width * 0.8,
prescriptionReportList: model.prescriptionReportList, child: Button(
prescriptionReportEnhList: model.prescriptionReportEnhList, label: TranslationBase.of(context).resendOrder,
), backgroundColor: Colors.green[800],
onTap: () {
Navigator.push(
context,
FadePage(
page: PrescriptionDeliveryAddressPage(
prescriptions: prescriptions,
prescriptionReportList:
model.prescriptionReportList,
prescriptionReportEnhList:
model.prescriptionReportEnhList,
), ),
); ),
}, );
)) },
))
], ],
), ),
), ),
@ -236,6 +247,7 @@ class PrescriptionItemsPage extends StatelessWidget {
patientID: prescriptions.patientID, patientID: prescriptions.patientID,
clinicName: prescriptions.companyName, clinicName: prescriptions.companyName,
doctorName: prescriptions.doctorName, doctorName: prescriptions.doctorName,
doctorID: prescriptions.doctorID,
mes: TranslationBase.of(context).sendSuc, mes: TranslationBase.of(context).sendSuc,
projectID: prescriptions.projectID); projectID: prescriptions.projectID);
}, },

@ -94,6 +94,11 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
height: 8, height: 8,
), ),
LargeAvatar( LargeAvatar(
url:
'https://hmgwebservices.com/Images/Hospitals/' +
model.appointmentDetails.projectID
.toString() +
'.jpg',
name: model.appointmentDetails.clinicName, name: model.appointmentDetails.clinicName,
width: 110, width: 110,
height: 110, height: 110,
@ -146,19 +151,17 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
child: Container( child: Container(
key: ValueKey<int>(rating), key: ValueKey<int>(rating),
child: IconButton( child: IconButton(
iconSize: 45.0, //iconSize: 45.0,
onPressed: () { onPressed: () {
setState(() { setState(() {
rating = index + 1; rating = index + 1;
}); });
}, },
color: rating >= (index + 1) iconSize: rating == (index + 1) ? 60 : 40,
? Color.fromRGBO(255, 186, 0, 1.0)
: Colors.grey[400],
// Theme.of(context).hintColor, // Theme.of(context).hintColor,
icon: Icon(rating >= (index + 1) icon: Image.asset('assets/images/' +
? EvaIcons.star (index + 1).toString() +
: EvaIcons.star)), '.png')),
), ),
), ),
) )
@ -208,8 +211,8 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
} }
}, },
label: TranslationBase.of(context).submit, label: TranslationBase.of(context).submit,
disabled: (model.state == ViewState.Busy || rating==0), disabled: (model.state == ViewState.Busy || rating == 0),
// loading: model.state == ViewState.BusyLocal, // loading: model.state == ViewState.BusyLocal,
textColor: Theme.of(context).backgroundColor), textColor: Theme.of(context).backgroundColor),
), ),
SizedBox( SizedBox(
@ -225,7 +228,7 @@ class _RateAppointmentClinicState extends State<RateAppointmentClinic> {
); );
}, },
child: Texts( child: Texts(
TranslationBase.of(context).later, TranslationBase.of(context).later,
decoration: TextDecoration.underline, decoration: TextDecoration.underline,
color: HexColor('#151DFE'), color: HexColor('#151DFE'),
fontSize: 18, fontSize: 18,

@ -1446,4 +1446,24 @@ class DoctorsListService extends BaseService {
}, body: request); }, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> sendCheckinNfcRequest(
int appointmentNo, String nfcCode,int projectId, BuildContext context) async {
Map<String, dynamic> request;
Request req = appGlobal.getPublicRequest();
request = {
"AppointmentNo":appointmentNo,
"NFC_Code": nfcCode,
"ProjectID": projectId,
};
dynamic localRes;
await baseAppClient.post(SEND_CHECK_IN_NFC_REQUEST,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
} }

@ -117,8 +117,8 @@ class AuthProvider with ChangeNotifier {
var imei = await sharedPref.getString(PUSH_TOKEN); var imei = await sharedPref.getString(PUSH_TOKEN);
// if (!request.) { // if (!request.) {
newRequest.iMEI = imei; //imei!=null ? imei : ''; newRequest.iMEI = imei; //imei!=null ? imei : '';
newRequest.firstName = request.firstName + " " + request.lastName; newRequest.firstName = request.firstName??"" + " " + request.lastName??"";
newRequest.firstNameN = request.firstNameN + " " + request.lastNameN; newRequest.firstNameN = request.firstNameN??"" + " " + request.lastNameN??"";
newRequest.lastNameN = request.lastNameN ?? ""; newRequest.lastNameN = request.lastNameN ?? "";
newRequest.outSA = request.outSA == 1 ? true : false; newRequest.outSA = request.outSA == 1 ? true : false;
newRequest.biometricEnabled = false; newRequest.biometricEnabled = false;

@ -35,8 +35,7 @@ class ClinicListService extends BaseService {
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_CLINICS_LIST_URL, await baseAppClient.post(GET_CLINICS_LIST_URL, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
@ -54,7 +53,7 @@ class ClinicListService extends BaseService {
"VersionID": req.VersionID, "VersionID": req.VersionID,
"Channel": req.Channel, "Channel": req.Channel,
"generalid": 'Cs2020@2016\$2958', "generalid": 'Cs2020@2016\$2958',
"PatientOutSA": 0, "PatientOutSA": user.outSA,
"TokenID": "", "TokenID": "",
"IsActiveAppointment": true, "IsActiveAppointment": true,
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
@ -65,12 +64,11 @@ class ClinicListService extends BaseService {
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_ACTIVE_APPOINTMENTS_LIST_URL, await baseAppClient.post(GET_ACTIVE_APPOINTMENTS_LIST_URL, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async { localRes = response;
localRes = response; }, onFailure: (String error, int statusCode) {
}, onFailure: (String error, int statusCode) { throw error;
throw error; }, body: request);
}, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
@ -92,8 +90,7 @@ class ClinicListService extends BaseService {
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_PROJECTS_LIST, await baseAppClient.post(GET_PROJECTS_LIST, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
@ -101,15 +98,12 @@ class ClinicListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getChiefComplaintsList( Future<Map> getChiefComplaintsList(int clinicID, int projectID, BuildContext context, {doctorId}) async {
int clinicID, int projectID, BuildContext context,
{doctorId}) async {
//Utils.showProgressDialog(context); //Utils.showProgressDialog(context);
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
@ -137,8 +131,7 @@ class ClinicListService extends BaseService {
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_DOCTORS_LIST_URL, await baseAppClient.post(GET_DOCTORS_LIST_URL, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
@ -146,19 +139,15 @@ class ClinicListService extends BaseService {
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> getChiefComplaintDoctorList( Future<Map> getChiefComplaintDoctorList(int chiefComplaintID, int projectID, BuildContext context, {doctorId}) async {
int chiefComplaintID, int projectID, BuildContext context,
{doctorId}) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson( var data = AuthenticatedUser.fromJson(await this.sharedPref.getObject(USER_PROFILE));
await this.sharedPref.getObject(USER_PROFILE));
authUser = data; authUser = data;
} }
if (await this.sharedPref.getDouble(USER_LAT) != null && if (await this.sharedPref.getDouble(USER_LAT) != null && await this.sharedPref.getDouble(USER_LONG) != null) {
await this.sharedPref.getDouble(USER_LONG) != null) {
lat = await this.sharedPref.getDouble(USER_LAT); lat = await this.sharedPref.getDouble(USER_LAT);
long = await this.sharedPref.getDouble(USER_LONG); long = await this.sharedPref.getDouble(USER_LONG);
} }
@ -179,13 +168,12 @@ class ClinicListService extends BaseService {
"Latitude": lat.toString(), "Latitude": lat.toString(),
"Longitude": long.toString(), "Longitude": long.toString(),
"DeviceTypeID": req.DeviceTypeID, "DeviceTypeID": req.DeviceTypeID,
"IsPublicRequest" : true "IsPublicRequest": true
}; };
dynamic localRes; dynamic localRes;
await baseAppClient.post(GET_DENTAL_DOCTORS_LIST_URL, await baseAppClient.post(GET_DENTAL_DOCTORS_LIST_URL, onSuccess: (response, statusCode) async {
onSuccess: (response, statusCode) async {
localRes = response; localRes = response;
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;

@ -3,9 +3,12 @@ import 'package:diplomaticquarterapp/pages/landing/landing_page.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/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:firebase_analytics/observer.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'analytics/google-analytics.dart';
import 'config/shared_pref_kay.dart'; import 'config/shared_pref_kay.dart';
import 'config/size_config.dart'; import 'config/size_config.dart';
import 'core/service/AuthenticatedUserObject.dart'; import 'core/service/AuthenticatedUserObject.dart';

@ -471,6 +471,8 @@ class TranslationBase {
String get medicalProfile => String get medicalProfile =>
localizedValues['medicalProfile'][locale.languageCode]; localizedValues['medicalProfile'][locale.languageCode];
String get parking => localizedValues['parking'][locale.languageCode]; String get parking => localizedValues['parking'][locale.languageCode];
String get parkingDescription => localizedValues['parkingDescription'][locale.languageCode];
String get checkinOptions => localizedValues['checkinOption'][locale.languageCode];
String get alhabiServices => String get alhabiServices =>
localizedValues['alhabiServices'][locale.languageCode]; localizedValues['alhabiServices'][locale.languageCode];
String get parkingTitle => String get parkingTitle =>
@ -1159,6 +1161,8 @@ class TranslationBase {
String get stretcher => localizedValues['stretcher'][locale.languageCode]; String get stretcher => localizedValues['stretcher'][locale.languageCode];
String get none => localizedValues['none'][locale.languageCode]; String get none => localizedValues['none'][locale.languageCode];
String get RRTSummary => localizedValues['RRT-Summary'][locale.languageCode]; String get RRTSummary => localizedValues['RRT-Summary'][locale.languageCode];
String get RapidResponseTeam => localizedValues['Rapid-Response-Team'][locale.languageCode];
String get rrtService => localizedValues['rrtService'][locale.languageCode];
String get billAmount => localizedValues['bill-amount'][locale.languageCode]; String get billAmount => localizedValues['bill-amount'][locale.languageCode];
String get transportMethod => String get transportMethod =>
localizedValues['transport-method'][locale.languageCode]; localizedValues['transport-method'][locale.languageCode];
@ -1634,6 +1638,21 @@ class TranslationBase {
localizedValues["searchForReferrals"][locale.languageCode]; localizedValues["searchForReferrals"][locale.languageCode];
String get covidSelectProcedure => String get covidSelectProcedure =>
localizedValues["covid-select-procedure"][locale.languageCode]; localizedValues["covid-select-procedure"][locale.languageCode];
String get onlineConsultation =>
localizedValues["online-consultation"][locale.languageCode];
String get expectedWaiting =>
localizedValues["expected-weiting"][locale.languageCode];
String get erConsultFee =>
localizedValues["er-consult-fee"][locale.languageCode];
String get insuredPatient =>
localizedValues["insured-patient"][locale.languageCode];
String get iAcceptTerms =>
localizedValues["i-accept-terms"][locale.languageCode];
String get upComingPayOption =>
localizedValues["upcoming-pay-options"][locale.languageCode];
String get pleaseAcceptTerms =>
localizedValues["please-accept-terms"][locale.languageCode];
} }
class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> { class TranslationBaseDelegate extends LocalizationsDelegate<TranslationBase> {

@ -61,10 +61,8 @@ class Utils {
/// Check The Internet Connection /// Check The Internet Connection
static Future<bool> checkConnection() async { static Future<bool> checkConnection() async {
ConnectivityResult connectivityResult = ConnectivityResult connectivityResult = await (Connectivity().checkConnectivity());
await (Connectivity().checkConnectivity()); if ((connectivityResult == ConnectivityResult.mobile) || (connectivityResult == ConnectivityResult.wifi)) {
if ((connectivityResult == ConnectivityResult.mobile) ||
(connectivityResult == ConnectivityResult.wifi)) {
return true; return true;
} else { } else {
return false; return false;
@ -128,19 +126,11 @@ class Utils {
} }
static String getAppointmentTransID(int projectID, int clinicID, int appoNo) { static String getAppointmentTransID(int projectID, int clinicID, int appoNo) {
return projectID.toString() + return projectID.toString() + '-' + clinicID.toString() + '-' + appoNo.toString();
'-' +
clinicID.toString() +
'-' +
appoNo.toString();
} }
static String getAdvancePaymentTransID(int projectID, int fileNumber) { static String getAdvancePaymentTransID(int projectID, int fileNumber) {
return projectID.toString() + return projectID.toString() + '-' + fileNumber.toString() + '-' + DateTime.now().millisecondsSinceEpoch.toString();
'-' +
fileNumber.toString() +
'-' +
DateTime.now().millisecondsSinceEpoch.toString();
} }
bool validateIDBox(String value, type) { bool validateIDBox(String value, type) {
@ -151,7 +141,7 @@ class Utils {
} }
String loginIDPattern(loginType) { String loginIDPattern(loginType) {
var length = loginType == 1 ? 10 : 7; var length = loginType == 1 ? 10 : 6;
return "([0-9]{" + length.toString() + "})"; return "([0-9]{" + length.toString() + "})";
} }
@ -198,60 +188,45 @@ class Utils {
} }
static validEmail(email) { static validEmail(email) {
return RegExp( return RegExp(r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+").hasMatch(email);
r"^[a-zA-Z0-9.a-zA-Z0-9.!#$%&'*+-/=?^_`{|}~]+@[a-zA-Z0-9]+\.[a-zA-Z]+")
.hasMatch(email);
} }
static List<Widget> myMedicalList( static List<Widget> myMedicalList({ProjectViewModel projectViewModel, BuildContext context, bool isLogin, count}) {
{ProjectViewModel projectViewModel,
BuildContext context,
bool isLogin,
count}) {
List<Widget> medical = List(); List<Widget> medical = List();
if (projectViewModel.havePrivilege(5)) {
medical.add(InkWell( medical.add(InkWell(
onTap: () { onTap: () => projectViewModel.havePrivilege(5) ? Navigator.push(context, FadePage(page: MyAppointments())) : null,
Navigator.push( child: isLogin
context, ? Stack(children: [
FadePage( MedicalProfileItem(
page: MyAppointments(),
),
);
},
child: isLogin
? Stack(children: [
MedicalProfileItem(
title: TranslationBase.of(context).myAppointments, title: TranslationBase.of(context).myAppointments,
imagePath: 'my_appointment_icon.png', imagePath: 'my_appointment_icon.png',
subTitle: TranslationBase.of(context).myAppointmentsList, subTitle: TranslationBase.of(context).myAppointmentsList,
hasBadge: true, hasBadge: true,
), isEnable: projectViewModel.havePrivilege(5)),
Positioned( Positioned(
right: 0.0, right: 0.0,
child: Badge( child: Badge(
toAnimate: false, toAnimate: false,
position: BadgePosition.topEnd(), position: BadgePosition.topEnd(),
shape: BadgeShape.circle, shape: BadgeShape.circle,
badgeColor: secondaryColor.withOpacity(1.0), badgeColor: secondaryColor.withOpacity(1.0),
borderRadius: BorderRadius.circular(8), borderRadius: BorderRadius.circular(8),
badgeContent: Container( badgeContent: Container(
padding: EdgeInsets.all(2.0), padding: EdgeInsets.all(2.0),
child: Text(count.toString(), child: Text(count.toString(), style: TextStyle(color: Colors.white, fontSize: 16.0)),
style:
TextStyle(color: Colors.white, fontSize: 16.0)),
),
), ),
), ),
])
: MedicalProfileItem(
title: TranslationBase.of(context).myAppointments,
imagePath: 'my_appointment_icon.png',
subTitle: TranslationBase.of(context).myAppointmentsList,
hasBadge: true,
), ),
)); ])
} : MedicalProfileItem(
title: TranslationBase.of(context).myAppointments,
imagePath: 'my_appointment_icon.png',
subTitle: TranslationBase.of(context).myAppointmentsList,
hasBadge: true,
isEnable: projectViewModel.havePrivilege(5),
),
));
if (projectViewModel.havePrivilege(10)) { if (projectViewModel.havePrivilege(10)) {
medical.add(InkWell( medical.add(InkWell(
onTap: () => Navigator.push(context, FadePage(page: LabsHomePage())), onTap: () => Navigator.push(context, FadePage(page: LabsHomePage())),
@ -263,106 +238,91 @@ class Utils {
)); ));
} }
if (projectViewModel.havePrivilege(7)) { medical.add(InkWell(
medical.add(InkWell( onTap: () =>
onTap: () => projectViewModel.havePrivilege(7) ? Navigator.push(context, FadePage(page: RadiologyHomePage())) : null,
Navigator.push(context, FadePage(page: RadiologyHomePage())), child: MedicalProfileItem(
child: MedicalProfileItem( title: TranslationBase.of(context).radiology,
title: TranslationBase.of(context).radiology, imagePath: 'radiology_icon.png',
imagePath: 'radiology_icon.png', subTitle: TranslationBase.of(context).radiologySubtitle,
subTitle: TranslationBase.of(context).radiologySubtitle, isEnable: projectViewModel.havePrivilege(7),
), ),
)); ));
}
if (projectViewModel.havePrivilege(12)) { medical.add(InkWell(
medical.add(InkWell( onTap: () =>
onTap: () { projectViewModel.havePrivilege(12) ? Navigator.push(context, FadePage(page: HomePrescriptionsPage())) : null,
Navigator.push( child: MedicalProfileItem(
context, title: TranslationBase.of(context).medicines,
FadePage( imagePath: 'prescription_icon.png',
page: HomePrescriptionsPage(), subTitle: TranslationBase.of(context).medicinesSubtitle,
), isEnable: projectViewModel.havePrivilege(12),
); ),
}, ));
child: MedicalProfileItem(
title: TranslationBase.of(context).medicines,
imagePath: 'prescription_icon.png',
subTitle: TranslationBase.of(context).medicinesSubtitle,
),
));
}
if (projectViewModel.havePrivilege(25)) { medical.add(InkWell(
medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(25)
onTap: () => Navigator.push( ? Navigator.push(
context, context,
FadePage( FadePage(page: VitalSignDetailsScreen()),
page: VitalSignDetailsScreen(), )
), : null,
), child: MedicalProfileItem(
child: MedicalProfileItem( title: TranslationBase.of(context).vitalSigns,
title: TranslationBase.of(context).vitalSigns, imagePath: 'vital_signs.png',
imagePath: 'vital_signs.png', subTitle: TranslationBase.of(context).vitalSignsSubtitle,
subTitle: TranslationBase.of(context).vitalSignsSubtitle, isEnable: projectViewModel.havePrivilege(25),
), ),
)); ));
}
if (projectViewModel.havePrivilege(48)) { medical.add(InkWell(
medical.add(InkWell( onTap: () =>
onTap: () => projectViewModel.havePrivilege(48) ? Navigator.push(context, FadePage(page: ActiveMedicationsPage())) : null,
Navigator.push(context, FadePage(page: ActiveMedicationsPage())), child: MedicalProfileItem(
child: MedicalProfileItem( title: TranslationBase.of(context).myMedical,
title: TranslationBase.of(context).myMedical, imagePath: 'active_medications.png',
imagePath: 'active_medications.png', subTitle: TranslationBase.of(context).myMedicalSubtitle,
subTitle: TranslationBase.of(context).myMedicalSubtitle, isEnable: false,
), ),
)); ));
}
if (projectViewModel.havePrivilege(6)) { medical.add(InkWell(
medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(6)
onTap: () { ? Navigator.push(
Navigator.push( context,
context, FadePage(
FadePage( page: DoctorHomePage(),
page: DoctorHomePage(), ),
), )
); : null,
}, child: MedicalProfileItem(
child: MedicalProfileItem(
title: TranslationBase.of(context).myDoctor, title: TranslationBase.of(context).myDoctor,
imagePath: 'doctor_icon.png', imagePath: 'doctor_icon.png',
subTitle: TranslationBase.of(context).myDoctorSubtitle, subTitle: TranslationBase.of(context).myDoctorSubtitle,
), isEnable: projectViewModel.havePrivilege(6)),
)); ));
}
medical.add(InkWell(
onTap: () =>
projectViewModel.havePrivilege(14) ? Navigator.push(context, FadePage(page: EyeMeasurementsPage())) : null,
child: MedicalProfileItem(
title: TranslationBase.of(context).eye,
imagePath: 'eye_measurement_icon.png',
subTitle: TranslationBase.of(context).eyeSubtitle,
isEnable: projectViewModel.havePrivilege(14),
),
));
medical.add(InkWell(
onTap: () => projectViewModel.havePrivilege(22) ? Navigator.push(context, FadePage(page: InsuranceCard())) : null,
child: MedicalProfileItem(
title: TranslationBase.of(context).insurance,
imagePath: 'insurance_card_icon.png',
subTitle: TranslationBase.of(context).insuranceSubtitle,
isEnable: projectViewModel.havePrivilege(22),
),
));
if (projectViewModel.havePrivilege(14)) {
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: EyeMeasurementsPage()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).eye,
imagePath: 'eye_measurement_icon.png',
subTitle: TranslationBase.of(context).eyeSubtitle,
),
));
}
if (projectViewModel.havePrivilege(22)) {
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: InsuranceCard()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).insurance,
imagePath: 'insurance_card_icon.png',
subTitle: TranslationBase.of(context).insuranceSubtitle,
),
));
}
medical.add(InkWell( medical.add(InkWell(
onTap: () { onTap: () {
Navigator.push(context, FadePage(page: InsuranceUpdate())); Navigator.push(context, FadePage(page: InsuranceUpdate()));
@ -374,137 +334,119 @@ class Utils {
), ),
)); ));
if (projectViewModel.havePrivilege(18)) { medical.add(InkWell(
medical.add(InkWell( onTap: () =>
onTap: () { projectViewModel.havePrivilege(18) ? Navigator.push(context, FadePage(page: InsuranceApproval())) : null,
Navigator.push(context, FadePage(page: InsuranceApproval())); child: MedicalProfileItem(
}, title: TranslationBase.of(context).insuranceApproval,
child: MedicalProfileItem( imagePath: 'insurance_approvals_icon.png',
title: TranslationBase.of(context).insuranceApproval, subTitle: TranslationBase.of(context).insuranceApprovalSubtitle,
imagePath: 'insurance_approvals_icon.png', isEnable: projectViewModel.havePrivilege(18),
subTitle: TranslationBase.of(context).insuranceApprovalSubtitle, ),
), ));
));
}
if (projectViewModel.havePrivilege(23)) { medical.add(InkWell(
medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(23) ? Navigator.push(context, FadePage(page: AllergiesPage())) : null,
onTap: () => Navigator.push(context, FadePage(page: AllergiesPage())), child: MedicalProfileItem(
child: MedicalProfileItem( title: TranslationBase.of(context).allergies,
title: TranslationBase.of(context).allergies, imagePath: 'my_allergies_icon.png',
imagePath: 'my_allergies_icon.png', subTitle: TranslationBase.of(context).allergiesSubtitle,
subTitle: TranslationBase.of(context).allergiesSubtitle, isEnable: projectViewModel.havePrivilege(23),
), ),
)); ));
}
if (projectViewModel.havePrivilege(26)) { medical.add(InkWell(
medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(26) ? Navigator.push(context, FadePage(page: MyVaccines())) : null,
onTap: () { child: MedicalProfileItem(
Navigator.push(context, FadePage(page: MyVaccines())); title: TranslationBase.of(context).myVaccines,
}, imagePath: 'my_vaccines_icon.png',
child: MedicalProfileItem( subTitle: TranslationBase.of(context).myVaccinesSubtitle,
title: TranslationBase.of(context).myVaccines, isEnable: projectViewModel.havePrivilege(26),
imagePath: 'my_vaccines_icon.png', ),
subTitle: TranslationBase.of(context).myVaccinesSubtitle, ));
),
));
}
if (projectViewModel.havePrivilege(20))
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: HomeReportPage()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).medical,
imagePath: 'medical_reports_icon.png',
subTitle: TranslationBase.of(context).medicalSubtitle,
),
));
if (projectViewModel.havePrivilege(19)) { medical.add(InkWell(
medical.add(InkWell( onTap: () =>
onTap: () { projectViewModel.havePrivilege(20) ? Navigator.push(context, FadePage(page: HomeReportPage())) : null,
Navigator.push(context, FadePage(page: MonthlyReportsPage())); child: MedicalProfileItem(
}, title: TranslationBase.of(context).medical,
child: MedicalProfileItem( imagePath: 'medical_reports_icon.png',
title: TranslationBase.of(context).monthly, subTitle: TranslationBase.of(context).medicalSubtitle,
imagePath: 'monthly_reports_icon.png', isEnable: projectViewModel.havePrivilege(20),
subTitle: TranslationBase.of(context).monthlySubtitle, ),
), ));
));
}
if (projectViewModel.havePrivilege(16)) { medical.add(InkWell(
medical.add(InkWell( onTap: () =>
onTap: () { projectViewModel.havePrivilege(19) ? Navigator.push(context, FadePage(page: MonthlyReportsPage())) : null,
Navigator.push(context, FadePage(page: PatientSickLeavePage())); child: MedicalProfileItem(
}, title: TranslationBase.of(context).monthly,
child: MedicalProfileItem( imagePath: 'monthly_reports_icon.png',
title: TranslationBase.of(context).sick, subTitle: TranslationBase.of(context).monthlySubtitle,
imagePath: 'sick_leaves_icons.png', isEnable: projectViewModel.havePrivilege(19),
subTitle: TranslationBase.of(context).sickSubtitle, ),
), ));
));
}
if (projectViewModel.havePrivilege(47)) { medical.add(InkWell(
medical.add(InkWell( onTap: () =>
onTap: () { projectViewModel.havePrivilege(16) ? Navigator.push(context, FadePage(page: PatientSickLeavePage())) : null,
Navigator.push(context, FadePage(page: MyBalancePage())); child: MedicalProfileItem(
}, title: TranslationBase.of(context).sick,
child: MedicalProfileItem( imagePath: 'sick_leaves_icons.png',
title: TranslationBase.of(context).myBalance, subTitle: TranslationBase.of(context).sickSubtitle,
imagePath: 'check-in.png', isEnable: projectViewModel.havePrivilege(16),
subTitle: TranslationBase.of(context).myBalanceSubtitle, ),
), ));
));
}
if (projectViewModel.havePrivilege(61)) { medical.add(InkWell(
medical.add(MedicalProfileItem( onTap: () => projectViewModel.havePrivilege(47) ? Navigator.push(context, FadePage(page: MyBalancePage())) : null,
title: TranslationBase.of(context).patientCall, child: MedicalProfileItem(
imagePath: 'medical_history_icon.png', title: TranslationBase.of(context).myBalance,
subTitle: TranslationBase.of(context).patientCallSubtitle, imagePath: 'check-in.png',
)); subTitle: TranslationBase.of(context).myBalanceSubtitle,
} isEnable: projectViewModel.havePrivilege(47),
),
));
if (projectViewModel.havePrivilege(24)) { // TODO mosa check it
medical.add(InkWell( medical.add(MedicalProfileItem(
onTap: () { title: TranslationBase.of(context).patientCall,
Navigator.push(context, FadePage(page: MyTrackers())); imagePath: 'medical_history_icon.png',
}, subTitle: TranslationBase.of(context).patientCallSubtitle,
child: MedicalProfileItem( isEnable: projectViewModel.havePrivilege(61),
title: TranslationBase.of(context).myTrackers, ));
imagePath: 'my_tracker_icon.png',
subTitle: TranslationBase.of(context).myTrackersSubtitle,
),
));
}
if (projectViewModel.havePrivilege(30))
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: SmartWatchInstructions()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).smartWatches,
imagePath: 'smartwatch_icon.png',
subTitle: TranslationBase.of(context).smartWatchesSubtitle,
),
));
if (projectViewModel.havePrivilege(28)) { medical.add(InkWell(
medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(24) ? Navigator.push(context, FadePage(page: MyTrackers())) : null,
onTap: () { child: MedicalProfileItem(
Navigator.push(context, FadePage(page: AskDoctorHomPage())); title: TranslationBase.of(context).myTrackers,
}, imagePath: 'my_tracker_icon.png',
child: MedicalProfileItem( subTitle: TranslationBase.of(context).myTrackersSubtitle,
isEnable: projectViewModel.havePrivilege(24),
),
));
medical.add(InkWell(
onTap: () =>
projectViewModel.havePrivilege(30) ? Navigator.push(context, FadePage(page: SmartWatchInstructions())) : null,
child: MedicalProfileItem(
title: TranslationBase.of(context).smartWatches,
imagePath: 'smartwatch_icon.png',
subTitle: TranslationBase.of(context).smartWatchesSubtitle,
isEnable: projectViewModel.havePrivilege(30),
),
));
medical.add(InkWell(
onTap: () =>
projectViewModel.havePrivilege(28) ? Navigator.push(context, FadePage(page: AskDoctorHomPage())) : null,
child: MedicalProfileItem(
title: TranslationBase.of(context).askYour, title: TranslationBase.of(context).askYour,
imagePath: 'ask_doctor_icon.png', imagePath: 'ask_doctor_icon.png',
subTitle: TranslationBase.of(context).askYourSubtitle, subTitle: TranslationBase.of(context).askYourSubtitle,
), isEnable: projectViewModel.havePrivilege(28)),
)); ));
}
if (projectViewModel.havePrivilege(32) || true) { if (projectViewModel.havePrivilege(32) || true) {
medical.add(InkWell( medical.add(InkWell(
onTap: () { onTap: () {
@ -519,8 +461,7 @@ class Utils {
} else { } else {
AlertDialogBox( AlertDialogBox(
context: context, context: context,
confirmMessage: confirmMessage: "Please login with your account first to use this feature",
"Please login with your account first to use this feature",
okText: "OK", okText: "OK",
okFunction: () { okFunction: () {
AlertDialogBox.closeAlertDialog(context); AlertDialogBox.closeAlertDialog(context);
@ -536,43 +477,42 @@ class Utils {
)); ));
} }
if (projectViewModel.havePrivilege(40)) { medical.add(InkWell(
medical.add(InkWell( onTap: () => projectViewModel.havePrivilege(40) ? launch('whatsapp://send?phone=18885521858&text=') : null,
onTap: () { child: MedicalProfileItem(
launch('whatsapp://send?phone=18885521858&text='); title: TranslationBase.of(context).chatbot,
}, imagePath: 'insurance_approvals_icon.png',
child: MedicalProfileItem( subTitle: TranslationBase.of(context).chatbotSubtitle,
title: TranslationBase.of(context).chatbot, isEnable: projectViewModel.havePrivilege(40),
imagePath: 'insurance_approvals_icon.png', ),
subTitle: TranslationBase.of(context).chatbotSubtitle, ));
),
));
}
return medical; return medical;
} }
static Widget loadNetworkImage({@required String url, BoxFit fitting = BoxFit.cover}){ static Widget loadNetworkImage({@required String url, BoxFit fitting = BoxFit.cover}) {
return CachedNetworkImage( return CachedNetworkImage(
placeholderFadeInDuration: Duration(milliseconds: 250), placeholderFadeInDuration: Duration(milliseconds: 250),
fit: fitting, fit: fitting,
imageUrl: url, imageUrl: url,
placeholder: (context, url) => Container( placeholder: (context, url) => Container(child: Center(child: CircularProgressIndicator())),
child: Center( errorWidget: (context, url, error) {
child: CircularProgressIndicator() return Icon(
) Icons.error,
), color: Colors.red,
errorWidget: (context, url, error){ size: 50,
return Icon(Icons.error, color: Colors.red, size: 50,); );
} });
);
} }
} }
Widget applyShadow(
{Color color = Colors.grey,
double shadowOpacity = 0.5,
Widget applyShadow({ Color color = Colors.grey, double shadowOpacity = 0.5, double spreadRadius = 2, double blurRadius = 7, Offset offset = const Offset(2, 2), @required Widget child}){ double spreadRadius = 2,
double blurRadius = 7,
Offset offset = const Offset(2, 2),
@required Widget child}) {
return Container( return Container(
decoration: BoxDecoration( decoration: BoxDecoration(
boxShadow: [ boxShadow: [
@ -588,10 +528,8 @@ Widget applyShadow({ Color color = Colors.grey, double shadowOpacity = 0.5, doub
); );
} }
Future<AuthenticatedUser> userData() async { Future<AuthenticatedUser> userData() async {
var userData = AuthenticatedUser.fromJson( var userData = AuthenticatedUser.fromJson(await AppSharedPreferences().getObject(MAIN_USER));
await AppSharedPreferences().getObject(MAIN_USER));
return userData; return userData;
} }
@ -603,19 +541,35 @@ extension IndexedIterable<E> on Iterable<E> {
} }
} }
openAppStore({String androidPackageName, String iOSAppID}) async{ openAppStore({String androidPackageName, String iOSAppID}) async {
if(Platform.isAndroid){ if (Platform.isAndroid) {
assert(!(androidPackageName == null), "Should have valid value in androidPackageName parameter"); assert(!(androidPackageName == null), "Should have valid value in androidPackageName parameter");
if((await FlutterHmsGmsAvailability.isGmsAvailable)) if ((await FlutterHmsGmsAvailability.isGmsAvailable)) launch("market://details?id=com.ejada.hmg");
launch("market://details?id=com.ejada.hmg"); if ((await FlutterHmsGmsAvailability.isHmsAvailable)) launch("appmarket://details?id=com.ejada.hmg");
if((await FlutterHmsGmsAvailability.isHmsAvailable)) } else if (Platform.isIOS) {
launch("appmarket://details?id=com.ejada.hmg");
}else if(Platform.isIOS){
assert((iOSAppID == null), "Should have valid value in iOSAppID parameter"); assert((iOSAppID == null), "Should have valid value in iOSAppID parameter");
launch("https://itunes.apple.com/kr/app/apple-store/$iOSAppID)"); launch("https://itunes.apple.com/kr/app/apple-store/$iOSAppID)");
} }
} }
String labelFrom({@required String className}){
RegExp exp = RegExp(r'(?<=[a-z])[A-Z]');
String result = className.replaceAllMapped(exp, (m) {
var str = m.group(0);
if(str != null){
return ('_' + str);
}
return "";
});
if(result.isEmpty)
return className;
result = result.replaceAll("_", " ");
return result;
}
/* /*
userBoard.asMap().map((i, element) => MapEntry(i, Stack( userBoard.asMap().map((i, element) => MapEntry(i, Stack(
GestureDetector(onTap: () { GestureDetector(onTap: () {

@ -97,14 +97,22 @@ class _BottomNavBarState extends State<BottomNavBar> {
), ),
if (widget.index != 0 && projectViewModel.havePrivilege(34)) if (widget.index != 0 && projectViewModel.havePrivilege(34))
BottomNavigationItem( BottomNavigationItem(
icon: EvaIcons.calendar, icon: Icons.home_outlined,
activeIcon: EvaIcons.calendar, activeIcon: Icons.home_outlined,
changeIndex: _changeIndex, changeIndex: _changeIndex,
index: _index, index: widget.index,
currentIndex: 2, currentIndex: 0,
name: TranslationBase.of(context).bookAppo, name: TranslationBase.of(context).home,
), ),
if (widget.index == 0 && projectViewModel.havePrivilege(34)) // BottomNavigationItem(
// icon: EvaIcons.calendar,
// activeIcon: EvaIcons.calendar,
// changeIndex: _changeIndex,
// index: _index,
// currentIndex: 2,
// name: TranslationBase.of(context).bookAppo,
// ),
if (/*widget.index == 0 && */projectViewModel.havePrivilege(34))
BottomNavigationItem( BottomNavigationItem(
icon: EvaIcons.calendar, icon: EvaIcons.calendar,
activeIcon: EvaIcons.calendar, activeIcon: EvaIcons.calendar,

@ -103,7 +103,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
color: Colors.white, color: Colors.white,
), ),
Texts( Texts(
TranslationBase.of(context).sendCopy, TranslationBase.of(context).sendEmail,
color: Colors.white, color: Colors.white,
) )
], ],

@ -8,16 +8,19 @@ import '../../../Constants.dart';
import '../text.dart'; import '../text.dart';
class MedicalProfileItem extends StatelessWidget { class MedicalProfileItem extends StatelessWidget {
MedicalProfileItem(
{@required this.imagePath,
@required this.title,
@required this.subTitle,
hasBadge});
final String imagePath; final String imagePath;
final String title; final String title;
final String subTitle; final String subTitle;
final bool hasBadge = false; final bool hasBadge = false;
bool isEnable;
MedicalProfileItem({
@required this.imagePath,
@required this.title,
@required this.subTitle,
hasBadge,
this.isEnable = true,
});
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -26,27 +29,48 @@ class MedicalProfileItem extends StatelessWidget {
height: MediaQuery.of(context).size.height * 0.14, height: MediaQuery.of(context).size.height * 0.14,
margin: EdgeInsets.all(5), margin: EdgeInsets.all(5),
decoration: BoxDecoration( decoration: BoxDecoration(
borderRadius: BorderRadius.circular(10), borderRadius: BorderRadius.circular(10), color: Colors.white),
color: Colors.white clipBehavior: Clip.antiAlias,
), child: Stack(
padding: EdgeInsets.all(10), children: [
child: Column( Padding(
mainAxisAlignment: MainAxisAlignment.spaceBetween, padding: EdgeInsets.all(10),
crossAxisAlignment: CrossAxisAlignment.start, child: Column(
children: <Widget>[ mainAxisAlignment: MainAxisAlignment.spaceBetween,
Texts(title, crossAxisAlignment: CrossAxisAlignment.start,
fontSize: 1.5 * SizeConfig.textMultiplier, children: <Widget>[
color: secondaryColor, Texts(title,
fontWeight: FontWeight.bold), fontSize: 1.5 * SizeConfig.textMultiplier,
Texts(subTitle,fontSize: 1.4 * SizeConfig.textMultiplier,), color: secondaryColor,
Align( fontWeight: FontWeight.bold),
alignment:projectViewModel.isArabic ? Alignment.bottomLeft : Alignment.bottomRight, Texts(
child: Image.asset( subTitle,
"assets/images/medical/$imagePath", fontSize: 1.4 * SizeConfig.textMultiplier,
height: SizeConfig.heightMultiplier * 5, ),
width: SizeConfig.heightMultiplier * 5, Align(
alignment: projectViewModel.isArabic
? Alignment.bottomLeft
: Alignment.bottomRight,
child: Image.asset(
"assets/images/medical/$imagePath",
height: SizeConfig.heightMultiplier * 5,
width: SizeConfig.heightMultiplier * 5,
),
)
],
), ),
) ),
isEnable
? Container()
: Container(
width: double.infinity,
height: double.infinity,
color: Colors.grey.withOpacity(0.7),
child: Icon(
Icons.lock_outline,
size: 40,
),
)
], ],
), ),
); );

@ -564,6 +564,7 @@ class _AppDrawerState extends State<AppDrawer> {
if (mainUser["PatientID"] != result.list.patientID) { if (mainUser["PatientID"] != result.list.patientID) {
result.list.isFamily = true; result.list.isFamily = true;
} }
// result.list.cRSVerificationStatus = result['CRSVerificationStatus'];
this.sharedPref.setString(APP_LANGUAGE, currentLang); this.sharedPref.setString(APP_LANGUAGE, currentLang);
this.sharedPref.setObject(MAIN_USER, mainUser); this.sharedPref.setObject(MAIN_USER, mainUser);

@ -33,11 +33,11 @@ class MyInAppBrowser extends InAppBrowser {
// static String PREAUTH_SERVICE_URL = // static String PREAUTH_SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store // 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
static String PRESCRIPTION_PAYMENT_WITH_ORDERID =
'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=';
// static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // static String PRESCRIPTION_PAYMENT_WITH_ORDERID =
// 'https://mdlaboratories.com/exacartapi/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; //Live // 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=';
static String PRESCRIPTION_PAYMENT_WITH_ORDERID =
'https://mdlaboratories.com/exacartapi/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; //Live
// Packages // Packages
static String PACKAGES_REQUEST_PAYMENT_URL = '$EXA_CART_API_BASE_URL/checkout/OpcCompleteRedirectionPayment1'; static String PACKAGES_REQUEST_PAYMENT_URL = '$EXA_CART_API_BASE_URL/checkout/OpcCompleteRedirectionPayment1';

@ -0,0 +1,196 @@
import 'dart:async';
import 'package:flutter/material.dart';
import 'package:nfc_in_flutter/nfc_in_flutter.dart';
void showNfcReader(BuildContext context, {Function onNcfScan}) {
showModalBottomSheet(
context: context,
enableDrag: false,
isDismissible: false,
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.only(
topLeft: Radius.circular(12), topRight: Radius.circular(12)),
),
backgroundColor: Colors.white,
builder: (context) {
return NfcLayout(
onNcfScan: onNcfScan,
);
});
}
class NfcLayout extends StatefulWidget {
Function onNcfScan;
NfcLayout({this.onNcfScan});
@override
_NfcLayoutState createState() => _NfcLayoutState();
}
class _NfcLayoutState extends State<NfcLayout> {
StreamSubscription<NDEFMessage> _stream;
bool _reading = false;
Widget mainWidget;
String nfcId;
@override
void initState() {
super.initState();
setState(() {
// _reading = true;
// Start reading using NFC.readNDEF()
_stream = NFC
.readNDEF(
once: false,
throwOnUserCancel: false,
readerMode: NFCDispatchReaderMode())
.listen((NDEFMessage message) {
setState(() {
_reading = true;
mainWidget = doneNfc();
});
Future.delayed(const Duration(milliseconds: 500), () {
_stream?.cancel();
widget.onNcfScan(nfcId);
Navigator.pop(context);
});
print("read NDEF id: ${message.id}");
// widget.onNcfScan(message.id);
nfcId = message.id;
}, onError: (e) {
// Check error handling guide below
});
});
}
@override
Widget build(BuildContext context) {
(mainWidget == null && !_reading)
? mainWidget = scanNfc()
: mainWidget = doneNfc();
return AnimatedSwitcher(
duration: Duration(milliseconds: 500), child: mainWidget);
}
Widget scanNfc() {
return Container(
key: ValueKey(1),
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
SizedBox(
height: 30,
),
Text(
"Ready To Scan",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 24,
),
),
SizedBox(
height: 30,
),
Image.asset(
"assets/images/nfc/ic_nfc.png",
height: MediaQuery.of(context).size.width / 3,
),
SizedBox(
height: 30,
),
Text(
"Approach an NFC Tag",
style: TextStyle(
fontSize: 18,
),
),
SizedBox(
height: 30,
),
ButtonTheme(
minWidth: MediaQuery.of(context).size.width / 1.2,
height: 45.0,
buttonColor: Colors.grey[300],
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6),
),
child: RaisedButton(
onPressed: () {
_stream?.cancel();
Navigator.pop(context);
},
child: Text("CANCEL"),
),
),
SizedBox(
height: 30,
),
],
),
);
}
Widget doneNfc() {
return Container(
key: ValueKey(2),
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
SizedBox(
height: 30,
),
Text(
"Successfully Scanned",
style: TextStyle(
fontWeight: FontWeight.bold,
fontSize: 24,
),
),
SizedBox(
height: 30,
),
Image.asset(
"assets/images/nfc/ic_done.png",
height: MediaQuery.of(context).size.width / 3,
),
SizedBox(
height: 30,
),
Text(
"Approach an NFC Tag",
style: TextStyle(
fontSize: 18,
),
),
SizedBox(
height: 30,
),
ButtonTheme(
minWidth: MediaQuery.of(context).size.width / 1.2,
height: 45.0,
buttonColor: Colors.grey[300],
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(6),
),
child: RaisedButton(
// onPressed: () {
// _stream?.cancel();
// widget.onNcfScan(nfcId);
// Navigator.pop(context);
// },
onPressed: null,
child: Text("DONE"),
),
),
SizedBox(
height: 30,
),
],
),
);
}
}

@ -58,7 +58,8 @@ class AppScaffold extends StatelessWidget {
final List<Widget> appBarIcons; final List<Widget> appBarIcons;
final List<ImagesInfo> imagesInfo; final List<ImagesInfo> imagesInfo;
final bool isHelp; final bool isHelp;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>(); AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
AppBarWidget appBar; AppBarWidget appBar;
AppScaffold( AppScaffold(
@ -292,6 +293,15 @@ class _RobotIcon extends State<RobotIcon> {
}); });
} }
} }
if (p['isRobotVisible'] == 'false') {
if (this.mounted) {
setState(() {
if (IS_VOICE_COMMAND_CLOSED == true) {
this.isAnimation = false;
}
});
}
}
}); });
super.initState(); super.initState();

@ -210,6 +210,7 @@ class _FloatingSearchButton extends State<FloatingSearchButton>
if (this.mounted) { if (this.mounted) {
controller.reverse(); controller.reverse();
IS_VOICE_COMMAND_CLOSED = true; IS_VOICE_COMMAND_CLOSED = true;
event.setValue({'isRobotVisible': 'false'});
} }
}); });
}, },

@ -1,3 +1,5 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart'; import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -14,6 +16,7 @@ class _TyperState extends State<TyperAnimatedTextKit>
Animation<int> _characterCount; Animation<int> _characterCount;
AnimationController _controller; AnimationController _controller;
int _stringIndex; int _stringIndex;
var event = RobotProvider();
@override @override
void initState() { void initState() {
_controller = new AnimationController( _controller = new AnimationController(

@ -15,7 +15,7 @@ dependencies:
# Localizations # Localizations
flutter_localizations: flutter_localizations:
sdk: flutter sdk: flutter
intl: ^0.16.1 intl: ^0.16.0
# web view # web view
webview_flutter: ^0.3.24 webview_flutter: ^0.3.24
# http client # http client
@ -52,6 +52,7 @@ dependencies:
shared_preferences: ^0.5.8 shared_preferences: ^0.5.8
flutter_flexible_toast: ^0.1.4 flutter_flexible_toast: ^0.1.4
firebase_messaging: ^7.0.3 firebase_messaging: ^7.0.3
firebase_analytics: ^6.3.0
cloud_firestore: ^0.14.3 cloud_firestore: ^0.14.3
android_intent: ^0.3.7+7 android_intent: ^0.3.7+7
# Progress bar # Progress bar
@ -171,6 +172,7 @@ dependencies:
wifi: ^0.1.5 wifi: ^0.1.5
vibration: ^1.7.3 vibration: ^1.7.3
nfc_in_flutter: ^2.0.5
speech_to_text: speech_to_text:
path: speech_to_text path: speech_to_text
@ -216,10 +218,12 @@ flutter:
- assets/images/svg/ - assets/images/svg/
- assets/tracker/ - assets/tracker/
- assets/images/AlHabibMedicalService/ - assets/images/AlHabibMedicalService/
- assets/images/AlHabibMedicalService/health_calculator/
- assets/images/pharmacy_module/ - assets/images/pharmacy_module/
- assets/images/gif/ - assets/images/gif/
- assets/images/pharmacy_module/payment/ - assets/images/pharmacy_module/payment/
- assets/images/pharmacy_module/lakum/ - assets/images/pharmacy_module/lakum/
- assets/images/nfc/
fonts: fonts:

@ -31,7 +31,7 @@ android {
main.java.srcDirs += 'src/main/kotlin' main.java.srcDirs += 'src/main/kotlin'
} }
defaultConfig { defaultConfig {
minSdkVersion 21 minSdkVersion 18
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
} }
lintOptions { lintOptions {

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save