Merge branch 'merge_dq_master' into 'master'

Merge dq master

See merge request Cloud_Solution/diplomatic-quarter!224
merge-requests/225/merge
Mohammad Aljammal 4 years ago
commit 71417da030

1
.gitignore vendored

@ -42,3 +42,4 @@ app.*.map.json
# Exceptions to above rules.
!/packages/flutter_tools/test/data/dart_dependencies_test/**/.packages
health_calculators.dart

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 147 KiB

@ -8,7 +8,9 @@
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:help/main.dart';
import '../lib/main.dart';
void main() {
testWidgets('Counter increments smoke test', (WidgetTester tester) async {

@ -1 +1 @@
d69545ca05f0ca200eba92121a1458fb
59a6c452ee075b50114918f17f1ad8f5

@ -173,6 +173,10 @@ PODS:
- Flutter
- url_launcher_windows (0.0.1):
- Flutter
- vibration (1.7.3):
- Flutter
- vibration_web (1.6.2):
- Flutter
- video_player (0.0.1):
- Flutter
- video_player_web (0.0.1):
@ -233,6 +237,8 @@ DEPENDENCIES:
- url_launcher_macos (from `.symlinks/plugins/url_launcher_macos/ios`)
- url_launcher_web (from `.symlinks/plugins/url_launcher_web/ios`)
- url_launcher_windows (from `.symlinks/plugins/url_launcher_windows/ios`)
- vibration (from `.symlinks/plugins/vibration/ios`)
- vibration_web (from `.symlinks/plugins/vibration_web/ios`)
- video_player (from `.symlinks/plugins/video_player/ios`)
- video_player_web (from `.symlinks/plugins/video_player_web/ios`)
- wakelock (from `.symlinks/plugins/wakelock/ios`)
@ -355,6 +361,10 @@ EXTERNAL SOURCES:
:path: ".symlinks/plugins/url_launcher_web/ios"
url_launcher_windows:
:path: ".symlinks/plugins/url_launcher_windows/ios"
vibration:
:path: ".symlinks/plugins/vibration/ios"
vibration_web:
:path: ".symlinks/plugins/vibration_web/ios"
video_player:
:path: ".symlinks/plugins/video_player/ios"
video_player_web:
@ -432,6 +442,8 @@ SPEC CHECKSUMS:
url_launcher_macos: fd7894421cd39320dce5f292fc99ea9270b2a313
url_launcher_web: e5527357f037c87560776e36436bf2b0288b965c
url_launcher_windows: 683d7c283894db8d1914d3ab2223b20cc1ad95d5
vibration: b5a33e764c3f609a975b9dca73dce20fdde627dc
vibration_web: 0ba303d92469ba34d71c612a228b315908d7fcd9
video_player: 9cc823b1d9da7e8427ee591e8438bfbcde500e6e
video_player_web: da8cadb8274ed4f8dbee8d7171b420dedd437ce7
wakelock: 0d4a70faf8950410735e3f61fb15d517c8a6efc4
@ -440,4 +452,4 @@ SPEC CHECKSUMS:
PODFILE CHECKSUM: 5a17be3f8af73a757fa4439c77cf6ab2db29a6e7
COCOAPODS: 1.8.4
COCOAPODS: 1.10.0

@ -12,10 +12,10 @@ const EXA_CART_API_BASE_URL = 'https://mdlaboratories.com/exacartapi';
const PACKAGES_CATEGORIES = '/api/categories';
const PACKAGES_PRODUCTS = '/api/products';
// const BASE_URL = 'https://uat.hmgwebservices.com/';
const BASE_URL = 'https://uat.hmgwebservices.com/';
const PING_SERVICE = 'Services/Weather.svc/REST/CheckConnectivity';
const BASE_URL = 'https://hmgwebservices.com/';
// const BASE_URL = 'https://hmgwebservices.com/';
const GET_PROJECT = 'Services/Lists.svc/REST/GetProject';
///Geofencing
@ -24,6 +24,9 @@ const LOG_GEO_ZONES = 'Services/Patients.svc/REST/GeoF_InsertPatientFileInfo';
//weather
const WEATHER_INDICATOR = 'Services/Weather.svc/REST/GetCityInfo';
const GET_PRIVILEGE = 'Services/Patients.svc/REST/Service_Privilege';
///Doctor
const GET_MY_DOCTOR =
'Services/Doctors.svc/REST/GetPatientDoctorAppointmentResult';
@ -48,12 +51,17 @@ const GET_PRESCRIPTION_REPORT_ENH =
///Lab Order
const GET_Patient_LAB_ORDERS = 'Services/Patients.svc/REST/GetPatientLabOrders';
const GET_Patient_LAB_SPECIAL_RESULT = 'Services/Patients.svc/REST/GetPatientLabSpecialResults';
const GET_Patient_LAB_RESULT = 'Services/Patients.svc/REST/GetPatientLabResults';
const GET_Patient_LAB_ORDERS_RESULT = 'Services/Patients.svc/REST/GetPatientLabOrdersResults';
const SEND_LAB_RESULT_EMAIL =
'Services/Notifications.svc/REST/SendLabReportEmail';
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_LAB_ORDERS_BY_APPOINTMENT = 'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo';
const GET_PATIENT_LAB_ORDERS_BY_APPOINTMENT =
'Services/Patients.svc/REST/GetPatientLabResultsByAppointmentNo';
const GET_PATIENT_ORDERS_DETAILS = 'Services/Patients.svc/REST/Rad_UpdatePatientRadOrdersToRead';
const GET_RAD_IMAGE_URL = 'Services/Patients.svc/Rest/GetRadImageURL';
@ -215,7 +223,7 @@ const UPDATE_HEALTH_TERMS = '/services/Patients.svc/REST/UpdatePateintHealthSumm
const CHANNEL = 3;
const GENERAL_ID = 'Cs2020@2016\$2958';
const IP_ADDRESS = '10.20.10.20';
const VERSION_ID = 5.6;
const VERSION_ID = 5.8;
const SETUP_ID = '91877';
const LANGUAGE = 2;
const PATIENT_OUT_SA = 0;
@ -232,6 +240,10 @@ const GET_PAtIENTS_INSURANCE = "Services/Patients.svc/REST/Get_PatientInsuranceD
const GET_PAtIENTS_INSURANCE_UPDATED = "Services/Patients.svc/REST/PatientER_GetPatientInsuranceCardUpdateHistory";
const INSURANCE_DETAILS = "Services/Patients.svc/REST/Get_InsuranceCheckList";
const GET_PATIENT_INSURANCE_DETAILS =
"Services/Patients.svc/REST/PatientER_GetPatientInsuranceDetails";
const UPLOAD_INSURANCE_CARD =
'Services/Patients.svc/REST/PatientER_PatientInfoForInsuranceCardUpdate';
const GET_VACCINES = "Services/Patients.svc/REST/GetDoneVaccinesByPatientID";
const GET_VACCINES_EMAIL = "Services/Notifications.svc/REST/SendVaccinesEmail";

@ -297,7 +297,7 @@ const Map localizedValues = {
"recieved-requests": {"en": "Recieved Requests", "ar": "الطلبات المستلمة"},
"manage-files": {"en": "Manage Family Files", "ar": "إدارة ملفات العائلة"},
'oxygenation': {'en': 'Oxygenation', 'ar': 'الأوكسجين'},
'bodyMeasurements': {'en': 'body Mass', 'ar': 'قياسات الجسم'},
'bodyMeasurements': {'en': 'body Mass Index', 'ar': 'مؤشر الكتلة'},
'temperature': {'en': 'Temperature', 'ar': 'درجة الحرارة'},
'pulse': {'en': 'Pulse', 'ar': 'النبض'},
'respiration': {'en': 'Respiration', 'ar': 'التنفس'},
@ -1157,4 +1157,88 @@ const Map localizedValues = {
"en": "The request has been submitted successfully",
"ar": "تم تنفيذ طلبك بنجاح"
},
"pulseTitle": {
"en": "Heart rate",
"ar": "معدل النبض بالدقيقة"
},
"systolic-lng": {
"en": "Systolic",
"ar": "الإنقباض"
},
"diastolic-lng": {
"en": "Diastolic",
"ar": "الإنبساط"
},
"policy-holder": {
"en": "Policy Holder",
"ar": "حامل بطاقة التأمين"
},
"policy-no": {
"en": "Policy Number",
"ar": "رقم سياسات"
},
"agree": {
"en": "I agree, this is the correct information",
"ar": "موافق، هذه المعلومات صحيحة"
},
"disagree": {
"en": "No, this is not the correct information",
"ar": "غير موافق، هذه المعلومات غير الصحيحة"
},
"expiry-date": {
"en": "Expiry Date",
"ar": "تاريخ انتهاء الصلاحية"
},
"class": {
"en": "Class",
"ar": "فئة"
},
"approval": {
"en": "Approval",
"ar": "موافقة"
},
"no-data": {
"en": "No data found",
"ar": "لاتوجد بيانات"
},
"insurance-details": {
"en": "Insurance Details",
"ar": "تفاصيل التأمين"
},
"nearest-hospital": {
"en": "Nearest Hospital",
"ar": "أقرب مستشفى"
},
"request-sent": {
"en": "Request sent successfully",
"ar": "تم إرسال الطلب بنجاح"
},
"message-sent": {
"en": "Message sent successfully",
"ar": "تم إرسال الرسالة بنجاح"
},
"sent-on": {
"en": "Sent on",
"ar": "أرسلت في"
},
"attach-insurace-image": {
"en": "Attach insurance card image",
"ar": "إرفاق صورة بطاقة التأمين"
},
"upload-without-image": {
"en": "You can still submit, if you don't have Insurance Image",
"ar": "لا يزال بإمكانك الإرسال ، إذا لم يكن لديك صورة تأمين"
},
"info-insur-cards": {
"en": "This service allows you to view all the insurance cards that recorded during your visits to Al Habib Medical Group in addition to:",
"ar": "خدمة بطاقات التامين: هذه الخدمة تمكنك من الاطلاع على جميع بطاقات التامين والتي تم تسجيلها اثناء زياراتك لمجموعة الحبيب الطبية بالاضافة الى:"
},
"scan-now": {
"en": "If you have a card / Document Scan now",
"ar": "إذا كانت لديك بطاقة / مستند ارفقها الان"
},
"liveCare": {
"en": "Live Care",
"ar": "لايف كير"
},
};

@ -0,0 +1,88 @@
class InsuranceCardDetailsModel {
int approvalLimit;
int companyGroupID;
String companyName;
String companyRemarks;
String dOB;
int deductible;
String effectiveFrom;
String effectiveTo;
String eligabilityFailureReason;
bool isMemberEligible;
String memberID;
String memberName;
String memberStatus;
dynamic message;
String nationalId;
String policyNumber;
String responseMessage;
String room;
String subCategory;
InsuranceCardDetailsModel(
{this.approvalLimit,
this.companyGroupID,
this.companyName,
this.companyRemarks,
this.dOB,
this.deductible,
this.effectiveFrom,
this.effectiveTo,
this.eligabilityFailureReason,
this.isMemberEligible,
this.memberID,
this.memberName,
this.memberStatus,
this.message,
this.nationalId,
this.policyNumber,
this.responseMessage,
this.room,
this.subCategory});
InsuranceCardDetailsModel.fromJson(Map<String, dynamic> json) {
approvalLimit = json['ApprovalLimit'];
companyGroupID = json['CompanyGroupID'];
companyName = json['CompanyName'];
companyRemarks = json['CompanyRemarks'];
dOB = json['DOB'];
deductible = json['Deductible'];
effectiveFrom = json['EffectiveFrom'];
effectiveTo = json['EffectiveTo'];
eligabilityFailureReason = json['EligabilityFailureReason'];
isMemberEligible = json['IsMemberEligible'];
memberID = json['MemberID'];
memberName = json['MemberName'];
memberStatus = json['MemberStatus'];
message = json['Message'];
nationalId = json['NationalId'];
policyNumber = json['PolicyNumber'];
responseMessage = json['ResponseMessage'];
room = json['Room'];
subCategory = json['SubCategory'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ApprovalLimit'] = this.approvalLimit;
data['CompanyGroupID'] = this.companyGroupID;
data['CompanyName'] = this.companyName;
data['CompanyRemarks'] = this.companyRemarks;
data['DOB'] = this.dOB;
data['Deductible'] = this.deductible;
data['EffectiveFrom'] = this.effectiveFrom;
data['EffectiveTo'] = this.effectiveTo;
data['EligabilityFailureReason'] = this.eligabilityFailureReason;
data['IsMemberEligible'] = this.isMemberEligible;
data['MemberID'] = this.memberID;
data['MemberName'] = this.memberName;
data['MemberStatus'] = this.memberStatus;
data['Message'] = this.message;
data['NationalId'] = this.nationalId;
data['PolicyNumber'] = this.policyNumber;
data['ResponseMessage'] = this.responseMessage;
data['Room'] = this.room;
data['SubCategory'] = this.subCategory;
return data;
}
}

@ -34,7 +34,7 @@ class PatientLabOrders {
String qR;
String setupID;
List<String> speciality;
bool isLiveCareAppointment;
PatientLabOrders(
{this.actualDoctorRate,
this.clinicDescription,
@ -68,7 +68,7 @@ class PatientLabOrders {
this.projectNameN,
this.qR,
this.setupID,
this.speciality});
this.speciality,this.isLiveCareAppointment});
PatientLabOrders.fromJson(Map<String, dynamic> json) {
actualDoctorRate = json['ActualDoctorRate'];
@ -103,6 +103,7 @@ class PatientLabOrders {
projectNameN = json['ProjectNameN'];
qR = json['QR'];
setupID = json['SetupID'];
isLiveCareAppointment = json['IsLiveCareAppointment'];
// speciality = json['Speciality'].cast<String>();
}
@ -141,6 +142,7 @@ class PatientLabOrders {
data['QR'] = this.qR;
data['SetupID'] = this.setupID;
data['Speciality'] = this.speciality;
data['IsLiveCareAppointment'] = this.isLiveCareAppointment;
return data;
}
}

@ -27,6 +27,7 @@ class Prescriptions {
bool isDoctorAllowVedioCall;
bool isExecludeDoctor;
bool isInOutPatient;
bool isLiveCareAppointment;
String isInOutPatientDescription;
String isInOutPatientDescriptionN;
bool isInsurancePatient;
@ -68,7 +69,7 @@ class Prescriptions {
this.nationalityFlagURL,
this.noOfPatientsRate,
this.qR,
this.speciality});
this.speciality,this.isLiveCareAppointment});
Prescriptions.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
@ -103,6 +104,7 @@ class Prescriptions {
nationalityFlagURL = json['NationalityFlagURL'];
noOfPatientsRate = json['NoOfPatientsRate'];
qR = json['QR'];
isLiveCareAppointment = json['IsLiveCareAppointment'];
// speciality = json['Speciality'].cast<String>();
}
@ -141,6 +143,7 @@ class Prescriptions {
data['NoOfPatientsRate'] = this.noOfPatientsRate;
data['QR'] = this.qR;
data['Speciality'] = this.speciality;
data['IsLiveCareAppointment'] = this.isLiveCareAppointment;
return data;
}
}

@ -0,0 +1,24 @@
class PrivilegeModel {
int iD;
String serviceName;
bool privilege;
dynamic region;
PrivilegeModel({this.iD, this.serviceName, this.privilege, this.region});
PrivilegeModel.fromJson(Map<String, dynamic> json) {
iD = json['ID'];
serviceName = json['ServiceName'];
privilege = json['Previlege'];
region = json['Region'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['ID'] = this.iD;
data['ServiceName'] = this.serviceName;
data['Previlege'] = this.privilege;
data['Region'] = this.region;
return data;
}
}

@ -41,6 +41,7 @@ class FinalRadiology {
List<String> speciality;
bool isCVI;
bool isRadMedicalReport;
bool isLiveCareAppointment;
FinalRadiology(
{this.setupID,
@ -82,7 +83,7 @@ class FinalRadiology {
this.reportDataTextString,
this.speciality,
this.isCVI,
this.isRadMedicalReport});
this.isRadMedicalReport,this.isLiveCareAppointment});
FinalRadiology.fromJson(Map<String, dynamic> json) {
try {
@ -121,11 +122,13 @@ class FinalRadiology {
orderNo = json['OrderNo'];
projectName = json['ProjectName'];
qR = json['QR'];
isLiveCareAppointment = json['IsLiveCareAppointment'];
reportDataHTML = json['ReportDataHTML'];
reportDataTextString = json['ReportDataTextString'];
// speciality = json['Speciality'].cast<String>();
isCVI = json['isCVI'];
isRadMedicalReport = json['isRadMedicalReport'];
} catch (e) {
print(e);
}

@ -32,6 +32,7 @@ class SickLeave {
String projectName;
String qR;
List<String> speciality;
bool isLiveCareAppointment;
SickLeave(
{this.setupID,
@ -64,7 +65,7 @@ class SickLeave {
this.patientName,
this.projectName,
this.qR,
this.speciality});
this.speciality,this.isLiveCareAppointment});
SickLeave.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
@ -97,6 +98,7 @@ class SickLeave {
patientName = json['PatientName'];
projectName = json['ProjectName'];
qR = json['QR'];
isLiveCareAppointment = json['IsLiveCareAppointment'];
if(json['Speciality']!=null)
speciality = json['Speciality'].cast<String>();
}

@ -0,0 +1,267 @@
class WeatherIndicatorModel {
Null date;
int languageID;
int serviceName;
Null time;
Null androidLink;
Null authenticationTokenID;
Null data;
bool dataw;
int dietType;
Null errorCode;
Null errorEndUserMessage;
Null errorEndUserMessageN;
Null errorMessage;
int errorType;
int foodCategory;
Null iOSLink;
bool isAuthenticated;
int mealOrderStatus;
int mealType;
int messageStatus;
int numberOfResultRecords;
Null patientBlodType;
Null successMsg;
Null successMsgN;
Null citiesList;
Null cityName;
Null get5DaysWeatherForecastList;
List<GetCityInfoList> getCityInfoList;
Null getTodayWeatherForecastList;
Null iniciesList;
WeatherIndicatorModel(
{this.date,
this.languageID,
this.serviceName,
this.time,
this.androidLink,
this.authenticationTokenID,
this.data,
this.dataw,
this.dietType,
this.errorCode,
this.errorEndUserMessage,
this.errorEndUserMessageN,
this.errorMessage,
this.errorType,
this.foodCategory,
this.iOSLink,
this.isAuthenticated,
this.mealOrderStatus,
this.mealType,
this.messageStatus,
this.numberOfResultRecords,
this.patientBlodType,
this.successMsg,
this.successMsgN,
this.citiesList,
this.cityName,
this.get5DaysWeatherForecastList,
this.getCityInfoList,
this.getTodayWeatherForecastList,
this.iniciesList});
WeatherIndicatorModel.fromJson(Map<String, dynamic> json) {
date = json['Date'];
languageID = json['LanguageID'];
serviceName = json['ServiceName'];
time = json['Time'];
androidLink = json['AndroidLink'];
authenticationTokenID = json['AuthenticationTokenID'];
data = json['Data'];
dataw = json['Dataw'];
dietType = json['DietType'];
errorCode = json['ErrorCode'];
errorEndUserMessage = json['ErrorEndUserMessage'];
errorEndUserMessageN = json['ErrorEndUserMessageN'];
errorMessage = json['ErrorMessage'];
errorType = json['ErrorType'];
foodCategory = json['FoodCategory'];
iOSLink = json['IOSLink'];
isAuthenticated = json['IsAuthenticated'];
mealOrderStatus = json['MealOrderStatus'];
mealType = json['MealType'];
messageStatus = json['MessageStatus'];
numberOfResultRecords = json['NumberOfResultRecords'];
patientBlodType = json['PatientBlodType'];
successMsg = json['SuccessMsg'];
successMsgN = json['SuccessMsgN'];
citiesList = json['CitiesList'];
cityName = json['CityName'];
get5DaysWeatherForecastList = json['Get5DaysWeatherForecastList'];
if (json['GetCityInfo_List'] != null) {
getCityInfoList = new List<GetCityInfoList>();
json['GetCityInfo_List'].forEach((v) {
getCityInfoList.add(new GetCityInfoList.fromJson(v));
});
}
getTodayWeatherForecastList = json['GetTodayWeatherForecastList'];
iniciesList = json['IniciesList'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Date'] = this.date;
data['LanguageID'] = this.languageID;
data['ServiceName'] = this.serviceName;
data['Time'] = this.time;
data['AndroidLink'] = this.androidLink;
data['AuthenticationTokenID'] = this.authenticationTokenID;
data['Data'] = this.data;
data['Dataw'] = this.dataw;
data['DietType'] = this.dietType;
data['ErrorCode'] = this.errorCode;
data['ErrorEndUserMessage'] = this.errorEndUserMessage;
data['ErrorEndUserMessageN'] = this.errorEndUserMessageN;
data['ErrorMessage'] = this.errorMessage;
data['ErrorType'] = this.errorType;
data['FoodCategory'] = this.foodCategory;
data['IOSLink'] = this.iOSLink;
data['IsAuthenticated'] = this.isAuthenticated;
data['MealOrderStatus'] = this.mealOrderStatus;
data['MealType'] = this.mealType;
data['MessageStatus'] = this.messageStatus;
data['NumberOfResultRecords'] = this.numberOfResultRecords;
data['PatientBlodType'] = this.patientBlodType;
data['SuccessMsg'] = this.successMsg;
data['SuccessMsgN'] = this.successMsgN;
data['CitiesList'] = this.citiesList;
data['CityName'] = this.cityName;
data['Get5DaysWeatherForecastList'] = this.get5DaysWeatherForecastList;
if (this.getCityInfoList != null) {
data['GetCityInfo_List'] =
this.getCityInfoList.map((v) => v.toJson()).toList();
}
data['GetTodayWeatherForecastList'] = this.getTodayWeatherForecastList;
data['IniciesList'] = this.iniciesList;
return data;
}
}
class GetCityInfoList {
CategoriesNames categoriesNames;
String category;
String categoryValue;
int cityID;
String cityName;
String cityNameN;
String colorName;
String createdOn;
String iD;
int iniceID;
bool isOrderEmpty;
bool isValuesReversed;
bool language;
double latitude;
double longitude;
String name;
int orderNum;
double temperature;
String value;
GetCityInfoList(
{this.categoriesNames,
this.category,
this.categoryValue,
this.cityID,
this.cityName,
this.cityNameN,
this.colorName,
this.createdOn,
this.iD,
this.iniceID,
this.isOrderEmpty,
this.isValuesReversed,
this.language,
this.latitude,
this.longitude,
this.name,
this.orderNum,
this.temperature,
this.value});
GetCityInfoList.fromJson(Map<String, dynamic> json) {
categoriesNames = json['CategoriesNames'] != null
? new CategoriesNames.fromJson(json['CategoriesNames'])
: null;
category = json['Category'];
categoryValue = json['CategoryValue'];
cityID = json['CityID'];
cityName = json['CityName'];
cityNameN = json['CityNameN'];
colorName = json['ColorName'];
createdOn = json['CreatedOn'];
iD = json['ID'];
iniceID = json['IniceID'];
isOrderEmpty = json['IsOrderEmpty'];
isValuesReversed = json['IsValuesReversed'];
language = json['Language'];
latitude = json['Latitude'];
longitude = json['Longitude'];
name = json['Name'];
orderNum = json['OrderNum'];
temperature = json['Temperature'];
value = json['Value'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.categoriesNames != null) {
data['CategoriesNames'] = this.categoriesNames.toJson();
}
data['Category'] = this.category;
data['CategoryValue'] = this.categoryValue;
data['CityID'] = this.cityID;
data['CityName'] = this.cityName;
data['CityNameN'] = this.cityNameN;
data['ColorName'] = this.colorName;
data['CreatedOn'] = this.createdOn;
data['ID'] = this.iD;
data['IniceID'] = this.iniceID;
data['IsOrderEmpty'] = this.isOrderEmpty;
data['IsValuesReversed'] = this.isValuesReversed;
data['Language'] = this.language;
data['Latitude'] = this.latitude;
data['Longitude'] = this.longitude;
data['Name'] = this.name;
data['OrderNum'] = this.orderNum;
data['Temperature'] = this.temperature;
data['Value'] = this.value;
return data;
}
}
class CategoriesNames {
String category1;
String category2;
String category3;
String category4;
String category5;
CategoriesNames(
{this.category1,
this.category2,
this.category3,
this.category4,
this.category5});
CategoriesNames.fromJson(Map<String, dynamic> json) {
category1 = json['Category1'];
category2 = json['Category2'];
category3 = json['Category3'];
category4 = json['Category4'];
category5 = json['Category5'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['Category1'] = this.category1;
data['Category2'] = this.category2;
data['Category3'] = this.category3;
data['Category4'] = this.category4;
data['Category5'] = this.category5;
return data;
}
}

@ -82,8 +82,8 @@ class BaseAppClient {
body['PatientTypeID'] = body.containsKey('PatientTypeID')
? body['PatientTypeID'] != null
? body['PatientTypeID']
: user['PatientTypeID'] != null
? user['PatientTypeID']
: user['PatientType'] != null
? user['PatientType']
: PATIENT_TYPE_ID
: PATIENT_TYPE_ID;
if (user != null) {
@ -132,7 +132,13 @@ class BaseAppClient {
} else if (parsed['MessageStatus'] == 1 ||
parsed['SMSLoginRequired'] == true) {
onSuccess(parsed, statusCode);
} else if (!parsed['IsAuthenticated']) {
}
else if(parsed['MessageStatus'] == 2 && parsed['IsAuthenticated']){
onFailure(
parsed['message'] ?? parsed['ErrorEndUserMessage'] ?? parsed['ErrorMessage'],
statusCode);
}
else if (!parsed['IsAuthenticated']) {
await logout();
//helpers.showErrorToast('Your session expired Please login agian');
@ -221,7 +227,7 @@ class BaseAppClient {
await authenticatedUserObject.getUser();
Provider.of<ProjectViewModel>(AppGlobal.context, listen: false).isLogin =
false;
var model = Provider.of<ToDoCountProviderModel>(AppGlobal.context);
var model = Provider.of<ToDoCountProviderModel>(AppGlobal.context,listen: false);
_vitalSignService.weightKg = "";
_vitalSignService.heightCm = "";
model.setState(0, false);

@ -27,6 +27,8 @@ class HospitalService extends BaseService {
Map<String, dynamic> body = Map();
body['Latitude'] = _latitude;
body['Longitude'] = _longitude;
body['IsOnlineCheckIn'] = true;
body['PatientOutSA'] = 0;
await baseAppClient.post(GET_PROJECT,
onSuccess: (dynamic response, int statusCode) {

@ -1,8 +1,9 @@
import 'package:diplomaticquarterapp/config/config.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_approval.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_card.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update_model.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordsByStatusReq.dart';
@ -20,6 +21,10 @@ class InsuranceCardService extends BaseService {
List<InsuranceApprovalModel> get insuranceApproval => _insuranceApproval;
InsuranceCardDetailsModel insuranceCardDetails;
List<InsuranceCardDetailsModel> insuranceCardDetailsList = List();
bool isHaveInsuranceCard = false;
GetAllSharedRecordsByStatusResponse getAllSharedRecordsByStatusResponse =
GetAllSharedRecordsByStatusResponse();
@ -136,4 +141,42 @@ class InsuranceCardService extends BaseService {
}, body:{'CompanyID': data.companyID,'SubCategoryID':data.subCategoryID },);
return Future.value(localRes);
}
Future getPatientInsuranceDetails({String setupID, int projectID, String patientIdentificationID,int patientID}) async{
error = "";
hasError = false;
insuranceCardDetails = null;
isHaveInsuranceCard = false;
await baseAppClient.post(GET_PATIENT_INSURANCE_DETAILS,
onSuccess: (dynamic response, int statusCode) {
insuranceCardDetailsList.clear();
isHaveInsuranceCard = true;
response['List_PatientInsuranceDetails'].forEach((item) {
insuranceCardDetailsList.add(InsuranceCardDetailsModel.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
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{
error = "";
Map<String,dynamic> body = Map();
body['PatientID']=patientID;
body['PatientType']=user.patientType;
body['MobileNo']=user.mobileNumber;
body['PatientIdentificationID']=patientIdentificationID;
body['InsuranceCardImage']= image;
await baseAppClient.post(UPLOAD_INSURANCE_CARD,
onSuccess: (dynamic response, int statusCode) {
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body:body,);
}
}

@ -110,17 +110,17 @@ class LabsService extends BaseService {
_requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo;
_requestSendLabReportEmail.doctorName = patientLabOrder.doctorName;
_requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription;
_requestSendLabReportEmail.patientName = user.firstName + user.lastName;
_requestSendLabReportEmail.patientName = user.firstName +" "+ user.lastName;
_requestSendLabReportEmail.patientIditificationNum =
user.patientIdentificationNo;
_requestSendLabReportEmail.dateofBirth = user.dateofBirth;
_requestSendLabReportEmail.to = user.emailAddress;
_requestSendLabReportEmail.orderDate =
'${patientLabOrder.orderDate.year}-${patientLabOrder.orderDate.month}-${patientLabOrder.orderDate.day}';
_requestSendLabReportEmail.orderDate = '${patientLabOrder.orderDate.year}-${patientLabOrder.orderDate.month}-${patientLabOrder.orderDate.day}';
_requestSendLabReportEmail.patientMobileNumber = user.mobileNumber;
_requestSendLabReportEmail.projectName = patientLabOrder.projectName;
_requestSendLabReportEmail.setupID = user.setupID;
await baseAppClient.post(GET_Patient_LAB_SPECIAL_RESULT,
await baseAppClient.post(SEND_LAB_RESULT_EMAIL,
onSuccess: (dynamic response, int statusCode) {
}, onFailure: (String error, int statusCode) {

@ -24,7 +24,12 @@ class MyBalanceService extends BaseService {
String logInTokenID;
String verificationCode;
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
AuthenticatedUserObject authenticatedUserObject =
locator<AuthenticatedUserObject>();
MyBalanceService(){
getFamilyFiles();
}
getPatientAdvanceBalanceAmount() async {
hasError = false;
@ -61,13 +66,14 @@ class MyBalanceService extends BaseService {
}, body: body);
}
getPatientInfoByPatientIDAndMobileNumber() async {
getPatientInfoByPatientIDAndMobileNumber(AdvanceModel advanceModel) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false;
body['MobileNo'] = authenticatedUserObject.user.mobileNumber;
body['ProjectID'] = authenticatedUserObject.user.projectID;
body['MobileNo'] = advanceModel.mobileNumber;
body['ProjectID'] = advanceModel.hospitalsModel.iD;
body['PatientID'] = advanceModel.fileNumber;
await baseAppClient.post(GET_PATIENT_INFO_BY_ID_AND_MOBILE_NUMBER,
onSuccess: (response, statusCode) async {
@ -81,7 +87,7 @@ class MyBalanceService extends BaseService {
}, body: body);
}
sendActivationCodeForAdvancePayment({int patientID,int projectID}) async {
sendActivationCodeForAdvancePayment({int patientID, int projectID}) async {
hasError = false;
super.error = "";
Map<String, dynamic> body = Map();
@ -111,9 +117,8 @@ class MyBalanceService extends BaseService {
body['LogInTokenID'] = logInTokenID;
await baseAppClient.post(CHECK_ACTIVATION_CODE_FOR_ADVANCE_PAYMENT,
onSuccess: (response, statusCode) async {
}, onFailure: (String error, int statusCode) {
onSuccess: (response, statusCode) async {},
onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
super.error = error;

@ -24,9 +24,17 @@ class VitalSignService extends BaseService {
response['List_DoctorPatientVitalSign'].forEach((vital) {
vitalSignResModelList.add(VitalSignResModel.fromJson(vital));
});
bool isHaveWeight = false;
bool isHaveHeight = false;
vitalSignResModelList.forEach((element) {
weightKg = '${element.weightKg}';
heightCm = '${element.heightCm}';
if (element.weightKg != 0 && !isHaveWeight) {
weightKg = '${element.weightKg}';
isHaveWeight = true;
}
if (element.heightCm != 0 && !isHaveHeight) {
heightCm = '${element.heightCm}';
isHaveHeight = true;
}
});
}, onFailure: (String error, int statusCode) {
hasError = true;

@ -77,9 +77,10 @@ class PharmacyService extends BaseService {
hasError = false;
await _getCurrentLocation();
Map<String,dynamic> body = Map();
body['PHR_itemName'] = drugName;
body['PHR_itemName'] = drugName.trim();
body['isLoginForDoctorApp'] = true;
body['isDentalAllowedBackend'] = true;
body['PageSize'] = 25;
body['Latitude'] = _latitude;
body['Longitude'] = _longitude;

@ -0,0 +1,22 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
class PrivilegeService extends BaseService {
List<PrivilegeModel> privilegeModelList = List();
Future getPrivilege() async {
Map<String, dynamic> body = Map();
body['PatientType'] = 4;
await baseAppClient.post(GET_PRIVILEGE,
onSuccess: (dynamic response, int statusCode) {
response['ServicePrivilegeList'].forEach((item) {
privilegeModelList.add(PrivilegeModel.fromJson(item));
});
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
}
}

@ -0,0 +1,36 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/weahter/weather_model.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart';
class WeatherService extends BaseService {
List<GetCityInfoList> weatherIndicatorData = List();
Map<String, dynamic> body = Map();
String Latitude = "";
String Longitude = "";
String PhoneNumber = "";
Future getWeatherData() async {
hasError = false;
var lat = await sharedPref.getDouble(USER_LAT);
var long = await sharedPref.getDouble(USER_LONG);
body['Latitude'] = lat ?? 0;
body['Longitude'] = long ?? 0;
await baseAppClient.post(WEATHER_INDICATOR,
onSuccess: (dynamic response, int statusCode) {
weatherIndicatorData = [];
response['GetCityInfo_List'].forEach((data) {
weatherIndicatorData.add(GetCityInfoList.fromJson(data));
});
print(weatherIndicatorData);
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
await this.sharedPref.setObject(WEATHER, weatherIndicatorData[0]);
return Future.value(weatherIndicatorData[0]);
}
}

@ -29,6 +29,11 @@ class BaseViewModel extends ChangeNotifier {
if (hasListeners) notifyListeners();
}
setUser(AuthenticatedUser user){
this.user = user;
notifyListeners();
}
BaseViewModel() {
//authenticatedUserObject.getUser();
user = authenticatedUserObject.user;

@ -1,13 +1,21 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/service/medical/vital_sign_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import '../../locator.dart';
class DashboardViewModel extends BaseViewModel {
VitalSignService _vitalSignService = locator<VitalSignService>();
String get weightKg => _vitalSignService.weightKg;
String get heightCm => _vitalSignService.heightCm;
String bloadType = "";
String get weightKg => _vitalSignService.weightKg;
String get heightCm => _vitalSignService.heightCm;
String booldType = "-";
// ToDoCountProviderModel toDoProvider =
// Provider.of<ToDoCountProviderModel>(AppGlobal.context);
getPatientRadOrders() async {
if (isLogin && _vitalSignService.weightKg.isEmpty) {
@ -15,9 +23,24 @@ class DashboardViewModel extends BaseViewModel {
await _vitalSignService.getPatientRadOrders();
if (_vitalSignService.hasError) {
error = _vitalSignService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
setState(ViewState.ErrorLocal);
} else {
booldType = await sharedPref.getString(BLOOD_TYPE) ?? "-";
setState(ViewState.Idle);
}
}
}
// getToDoCount() {
// toDoProvider.setState(0);
// ClinicListService service = new ClinicListService();
// service.getActiveAppointmentNo(AppGlobal.context).then((res) {
// print(res['AppointmentActiveNumber']);
// if (res['MessageStatus'] == 1) {
// toDoProvider.setState(res['AppointmentActiveNumber']);
// } else {}
// }).catchError((err) {
// print(err);
// });
// }
}

@ -1,7 +1,7 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.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_update.dart';
import 'package:diplomaticquarterapp/core/model/insurance/insurance_card_update_model.dart';
import 'package:diplomaticquarterapp/core/service/insurance_service.dart';
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
@ -72,5 +72,14 @@ class InsuranceViewModel extends BaseViewModel {
} else
setState(ViewState.Idle);
}
Future uploadInsuranceCard({String patientIdentificationID, int patientID,String image =""}) async {
setState(ViewState.BusyLocal);
await _insuranceCardService.uploadInsuranceCard(patientIdentificationID: patientIdentificationID,patientID: patientID,image: image);
if (_insuranceCardService.hasError) {
error = _insuranceCardService.error;
setState(ViewState.ErrorLocal);
} else
setState(ViewState.Idle);
}
}

@ -74,11 +74,10 @@ class MyBalanceViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
//==============
Future getCities() async {
setState(ViewState.Busy);
await _bloodDonationService.getAllCitiesOrders();
// getHospitals();
if (_bloodDonationService.hasError) {
error = _bloodDonationService.error;
setState(ViewState.Error);
@ -89,8 +88,6 @@ class MyBalanceViewModel extends BaseViewModel {
Future getBlood() async {
setState(ViewState.Busy);
await _bloodDetailsService.getAllBloodOrders();
;
if (_bloodDetailsService.hasError) {
error = _bloodDetailsService.error;
setState(ViewState.Error);
@ -98,7 +95,6 @@ class MyBalanceViewModel extends BaseViewModel {
setState(ViewState.Idle);
}
//===============
Future getPatientInfoByPatientID({String id}) async {
setState(ViewState.Busy);
@ -112,10 +108,10 @@ class MyBalanceViewModel extends BaseViewModel {
}
}
Future getPatientInfoByPatientIDAndMobileNumber() async {
Future getPatientInfoByPatientIDAndMobileNumber(AdvanceModel advanceModel) async {
setState(ViewState.Busy);
await _myBalanceService
.getPatientInfoByPatientIDAndMobileNumber();
.getPatientInfoByPatientIDAndMobileNumber(advanceModel);
if (_myBalanceService.hasError) {
error = _myBalanceService.error;
setState(ViewState.ErrorLocal);

@ -11,7 +11,15 @@ class VitalSignViewModel extends BaseViewModel {
List<VitalSignResModel> get vitalSignResModelList =>
_vitalSignService.vitalSignResModelList;
getPatientRadOrders({int appointmentNo, int projectID}) async {
String heightCm = "0";
String weightKg = "0";
String bodyMax = "0";
String temperatureCelcius = "0";
String hartRat = "0";
String respirationBeatPerMinute = "0";
String bloodPressure = "0 / 0";
getPatientVitalSign({int appointmentNo, int projectID}) async {
setState(ViewState.Busy);
if (appointmentNo != null && projectID != null) {
@ -23,7 +31,41 @@ class VitalSignViewModel extends BaseViewModel {
if (_vitalSignService.hasError) {
error = _vitalSignService.error;
setState(ViewState.Error);
} else
} else {
_vitalSignService.vitalSignResModelList.forEach((element) {
if (heightCm == "0" || heightCm == null || heightCm == 'null') {
heightCm = element.heightCm.toString();
}
if (weightKg == "0" || weightKg == null || weightKg == 'null') {
weightKg = element.weightKg.toString();
}
if (bodyMax == "0" ||
bodyMax == null ||
bodyMax == 'null') {
bodyMax = element.bodyMassIndex.toString();
}
if (temperatureCelcius == "0" ||
temperatureCelcius == null ||
temperatureCelcius == 'null') {
temperatureCelcius = element.temperatureCelcius.toString();
}
if (hartRat == "0" || hartRat == null || hartRat == 'null') {
hartRat = element.pulseBeatPerMinute.toString();
}
if (respirationBeatPerMinute == "0" ||
respirationBeatPerMinute == null ||
respirationBeatPerMinute == 'null') {
respirationBeatPerMinute =
element.respirationBeatPerMinute.toString();
}
if (bloodPressure == "0 / 0" ||
bloodPressure == null ||
bloodPressure == 'null') {
bloodPressure = element.bloodPressure.toString();
}
});
setState(ViewState.Idle);
}
}
}

@ -2,6 +2,8 @@ import 'dart:async';
import 'package:connectivity/connectivity.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/model/privilege/PrivilegeModel.dart';
import 'package:diplomaticquarterapp/core/service/privilege_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart';
@ -24,9 +26,7 @@ class ProjectViewModel extends BaseViewModel {
bool isError = false;
String error = '';
dynamic searchvalue;
bool isLogin
= false;
bool isLogin = false;
dynamic get searchValue => searchvalue;
@ -36,14 +36,21 @@ class ProjectViewModel extends BaseViewModel {
bool get isArabic => _isArabic;
// BaseViewModel baseViewModel = locator<BaseViewModel>()
bool isLoginChild = false;
List<PrivilegeModel> privilegeRootUser = List();
List<PrivilegeModel> privilegeChildUser = List();
List<PrivilegeModel> get privileges =>
isLoginChild ? privilegeChildUser : privilegeChildUser;
StreamSubscription subscription;
ProjectViewModel() {
// PlatformBridge.init(context); // Moved to 'main.dart' due to context availability
loadSharedPrefLanguage();
subscription = Connectivity().onConnectivityChanged.listen((ConnectivityResult result) {
subscription = Connectivity()
.onConnectivityChanged
.listen((ConnectivityResult result) {
switch (result) {
case ConnectivityResult.wifi:
isInternetConnection = true;
@ -82,6 +89,49 @@ class ProjectViewModel extends BaseViewModel {
notifyListeners();
}
setPrivilegeModelList(
{List<PrivilegeModel> privilege}) {
this.isLoginChild = isLoginChild;
privilegeRootUser = privilege;
notifyListeners();
}
setPrivilege({privilegeList, bool isLoginChild = false}) {
List<PrivilegeModel> privilege = List();
privilegeList['List'][0]['ListPrivilege'].forEach((item) {
privilege.add(PrivilegeModel.fromJson(item));
});
this.isLoginChild = isLoginChild;
if (isLoginChild)
privilegeChildUser = privilege;
else
privilegeRootUser = privilege;
notifyListeners();
}
setIsLoginChild({@required bool isLoginChild}){
this.isLoginChild = isLoginChild;
notifyListeners();
}
bool havePrivilege(int id) {
bool isHavePrivilege = false;
if(isLoginChild)
privilegeChildUser.forEach((element) {
if (element.iD == id) isHavePrivilege = element.privilege;
});
else{
privilegeRootUser.forEach((element) {
if (element.iD == id) isHavePrivilege = element.privilege;
});
}
return isHavePrivilege;
}
@override
void dispose() {
if (subscription != null) subscription.cancel();

@ -0,0 +1,31 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/er/projectavgerwaitingtime.dart';
import 'package:diplomaticquarterapp/core/model/weahter/weather_model.dart';
import 'package:diplomaticquarterapp/core/service/er/er_service.dart';
import 'package:diplomaticquarterapp/core/service/weather_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart';
import '../../../locator.dart';
class WeatherViewModel extends BaseViewModel {
WeatherService _weatherService = locator<WeatherService>();
List<GetCityInfoList> get weatherIndicatorData =>
_weatherService.weatherIndicatorData;
getWeatherData() async {
setState(ViewState.Busy);
// if (id != null && projectID != null) {
// await _erService.getProjectAvgERWaitingTimeOrders(
// id: id, projectID: projectID);
// } else {
await _weatherService.getWeatherData();
// }
if (_weatherService.hasError) {
error = _weatherService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
}

@ -47,6 +47,7 @@ import 'core/service/medical/vital_sign_service.dart';
import 'core/service/packages_offers/PackagesOffersServices.dart';
import 'core/service/parmacyModule/order-preview-service.dart';
import 'core/service/notifications_service.dart';
import 'core/service/privilege_service.dart';
import 'core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'core/service/parmacyModule/parmacy_module_service.dart';
@ -145,7 +146,7 @@ void setupLocator() {
locator.registerLazySingleton(() => VaccinationTableService());
locator.registerLazySingleton(() => NotificationService());
locator.registerLazySingleton(() => PrivilegeService());
locator.registerLazySingleton(() => PharmacyModuleService());
locator.registerLazySingleton(() => OrderPreviewService());

@ -32,6 +32,8 @@ class MyApp extends StatelessWidget {
LocalNotification.getInstance().showNow(title: "Payload", subtitle: payload, payload: payload);
});
final themeNotifier = Provider.of<ThemeNotifier>(context);
precacheImage(AssetImage('assets/images/powerd-by.jpg'), context);
return LayoutBuilder(
builder: (context, constraints) {
return OrientationBuilder(

@ -50,6 +50,7 @@ class AppoitmentAllHistoryResultList {
bool isExecludeDoctor;
int isFollowup;
bool isLiveCareAppointment;
bool isInOutPatient;
bool isMedicalReportRequested;
bool isOnlineCheckedIN;
String latitude;
@ -188,6 +189,7 @@ class AppoitmentAllHistoryResultList {
isExecludeDoctor = json['IsExecludeDoctor'];
isFollowup = json['IsFollowup'];
isLiveCareAppointment = json['IsLiveCareAppointment'];
isInOutPatient = json['IsInOutPatient'];
isMedicalReportRequested = json['IsMedicalReportRequested'];
isOnlineCheckedIN = json['IsOnlineCheckedIN'];
latitude = json['Latitude'];
@ -259,6 +261,7 @@ class AppoitmentAllHistoryResultList {
data['IsExecludeDoctor'] = this.isExecludeDoctor;
data['IsFollowup'] = this.isFollowup;
data['IsLiveCareAppointment'] = this.isLiveCareAppointment;
data['IsInOutPatient'] = this.isInOutPatient;
data['IsMedicalReportRequested'] = this.isMedicalReportRequested;
data['IsOnlineCheckedIN'] = this.isOnlineCheckedIN;
data['Latitude'] = this.latitude;

@ -15,7 +15,7 @@ import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import '../dialogs/select_city_dialog.dart';
import 'dart:io';
class NewEReferralStepThreePage extends StatefulWidget {
final CreateEReferralRequestModel createEReferralRequestModel;
final Function changePageViewIndex;
@ -101,12 +101,17 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
InkWell(
onTap: () {
ImageOptions.showImageOptions(context,
(String image) {
(String image,File file) {
setState(() {
EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${ medicalReportImages.length +1}.png',base64String: image );
medicalReportImages.add(eReferralAttachment);
EReferralAttachment eReferralAttachment =
new EReferralAttachment(
fileName:
'image ${medicalReportImages.length + 1}.png',
base64String: image);
medicalReportImages
.add(eReferralAttachment);
});
});
}, );
},
child: Container(
margin: EdgeInsets.only(
@ -158,15 +163,17 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
width: 8,
),
Texts(
medicalReportImages[index].fileName,
medicalReportImages[index]
.fileName,
),
],
),
InkWell(
onTap: () {
setState(() {
medicalReportImages
.remove(medicalReportImages[index]);
medicalReportImages.remove(
medicalReportImages[
index]);
});
},
child: Icon(
@ -262,12 +269,12 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
],
),
),
if(isPatientInsured)
SizedBox(
height: 12,
),
if (isPatientInsured)
SizedBox(
height: 12,
),
Opacity(
opacity: isPatientInsured?1:0,
opacity: isPatientInsured ? 1 : 0,
child: Container(
padding: EdgeInsets.only(top: 10),
decoration: BoxDecoration(
@ -276,16 +283,21 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
),
child: Column(
children: [
InkWell(
onTap: () {
ImageOptions.showImageOptions(context,
(String image) {
(String image,File file) {
setState(() {
EReferralAttachment
eReferralAttachment =
new EReferralAttachment(
fileName:
'image ${medicalReportImages.length + 1}.png',
base64String: image);
EReferralAttachment eReferralAttachment = new EReferralAttachment(fileName: 'image ${ medicalReportImages.length +1}.png',base64String: image );
insuredPatientImages=[eReferralAttachment];
insuredPatientImages = [
eReferralAttachment
];
});
});
},
@ -333,8 +345,8 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Icon(
FontAwesomeIcons.paperclip),
Icon(FontAwesomeIcons
.paperclip),
SizedBox(
width: 8,
),
@ -346,8 +358,9 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
InkWell(
onTap: () {
setState(() {
insuredPatientImages
.remove(insuredPatientImages[index]);
insuredPatientImages.remove(
insuredPatientImages[
index]);
});
},
child: Icon(
@ -378,25 +391,37 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
textColor: Colors.white,
label: "Submit",
onTap: () async {
this.widget.createEReferralRequestModel.medicalReportAttachment = medicalReportImages;
this.widget.createEReferralRequestModel.insuranceCardAttachment = insuredPatientImages.length !=0?insuredPatientImages[0]:null;
this.widget.createEReferralRequestModel.isInsuredPatient = isPatientInsured;
this
.widget
.createEReferralRequestModel
.medicalReportAttachment = medicalReportImages;
this
.widget
.createEReferralRequestModel
.insuranceCardAttachment =
insuredPatientImages.length != 0
? insuredPatientImages[0]
: null;
this.widget.createEReferralRequestModel.isInsuredPatient =
isPatientInsured;
// ToDo make the preferred Branch info dynamic
this.widget.createEReferralRequestModel.preferredBranchCode = 15;
this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital";
this.widget.createEReferralRequestModel.preferredBranchCode =
15;
this.widget.createEReferralRequestModel.preferredBranchName =
"Arryan Hospital";
// this.widget.createEReferralRequestModel.fullName= "";
this.widget.createEReferralRequestModel.otherRelationship= "";
this.widget.createEReferralRequestModel.otherRelationship =
"";
// this.widget.createEReferralRequestModel.;
// this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital";
// this.widget.createEReferralRequestModel. preferredBranchName= "Arryan Hospital";
await model.createEReferral(this.widget.createEReferralRequestModel);
await model
.createEReferral(this.widget.createEReferralRequestModel);
},
loading: model.state == ViewState.BusyLocal,
disabled: medicalReportImages.length == 0 ,
disabled: medicalReportImages.length == 0,
),
)));
}
@ -416,12 +441,10 @@ class _NewEReferralStepThreePageState extends State<NewEReferralStepThreePage> {
);
}
String getRelationName() {
if (_selectedCity != null)
return _selectedCity.description;
else
return "Select Relationship" /*TranslationBase.of(context).selectHospital*/;
}
}

@ -48,8 +48,8 @@ class EReferralIndexPage extends StatelessWidget {
width: MediaQuery.of(context).size.width * 0.50,
child: CarouselSlider(
imagesUrlList: [
"https://hmgwebservices.com/Images/MobileApp/images-info-home/referal/en/0.png",
"https://hmgwebservices.com/Images/MobileApp/images-info-home/referal/en/1.png"
"https://hmgwebservices.com/Images/MobileAppDq/images-info-home/referal/en/0.png",
"https://hmgwebservices.com/Images/MobileAppDq/images-info-home/referal/en/1.png"
],
),
),

@ -1,9 +1,12 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/weather_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/%E2%80%8B%20health_calculators.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_index_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/E-Referral/e_referral_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/h2o/h2o_index_page.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health-weather/health-weather-indicator.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/health_converter.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/my_web_view.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/parking_page.dart';
@ -21,13 +24,17 @@ import 'package:diplomaticquarterapp/pages/paymentService/payment_service.dart';
import 'package:diplomaticquarterapp/pages/symptom-checker/info.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/services)contaniner.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
class AllHabibMedicalService extends StatefulWidget {
@ -43,17 +50,25 @@ class AllHabibMedicalService extends StatefulWidget {
class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser = new AuthenticatedUser();
LocationUtils locationUtils;
var weather = '--';
WeatherService _weatherService = WeatherService();
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((timeStamp) {
getAuthUser();
locationUtils =
new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance.addPostFrameCallback((_) => {
Geolocator.getLastKnownPosition()
.then((value) => setLocation(value))
});
});
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).alhabiServices,
@ -98,17 +113,41 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
],
),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.spaceAround,
children: [
Image.asset('assets/images/Weather_ico.png',width: 80,height: 80,),
Texts(
TranslationBase.of(context).moreDetails,
color: Colors.white,
decoration: TextDecoration.underline,
),
],
),
flex: 2,
child: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: HealthWeatherIndicator(),
),
);
},
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Image.asset(
'assets/images/Weather_ico.png',
width: 60,
height: 60,
),
Directionality(
textDirection: TextDirection.ltr,
child: AppText(weather,
fontSize: 22,
color: Colors.white))
],
),
Texts(
TranslationBase.of(context).moreDetails,
color: Colors.white,
decoration: TextDecoration.underline,
),
],
)),
)
],
),
@ -222,6 +261,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
'assets/images/new-design/family_menu_icon_red.png',
title: 'My Family',
),
if(projectViewModel.havePrivilege(35))
ServicesContainer(
onTap: () => Navigator.push(
context,
@ -235,13 +275,14 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
onTap: () => Navigator.push(
context,
FadePage(
page: ToDo(),
page: ToDo(isShowAppBar: true),
),
),
imageLocation:
'assets/images/new-design/upcoming_icon_bottom_bar.png',
title: TranslationBase.of(context).todoList,
),
if(projectViewModel.havePrivilege(42))
ServicesContainer(
onTap: () => Navigator.push(
context,
@ -249,7 +290,8 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
),
imageLocation: 'assets/images/new-design/body_icon.png',
title: 'Symptom Checker'),
ServicesContainer(
if(projectViewModel.havePrivilege(36))
ServicesContainer(
onTap: () => Navigator.push(
context,
FadePage(page: BloodDonationPage()),
@ -279,6 +321,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
'assets/images/new-design/health_convertor_icon.png',
title: 'Health Converter',
),
if(projectViewModel.havePrivilege(38))
ServicesContainer(
onTap: () => Navigator.push(
context,
@ -289,6 +332,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
imageLocation: 'assets/images/new-design/water_icon.png',
title: 'H2O',
),
if(projectViewModel.havePrivilege(41))
ServicesContainer(
onTap: () => Navigator.push(
context,
@ -313,7 +357,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
"https://hmgwebservices.com/vt_mobile/html/index.html"),
imageLocation:
'assets/images/new-design/virtual_tour_icon.png',
title: 'Virtual Tour',
title: TranslationBase.of(context).vTour,
),
ServicesContainer(
onTap: () {
@ -336,7 +380,7 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
),
),
imageLocation: 'assets/images/new-design/find_us_icon.png',
title: 'Find Us',
title: TranslationBase.of(context).findUs,
),
],
),
@ -353,7 +397,25 @@ class _AllHabibMedicalServiceState extends State<AllHabibMedicalService> {
setState(() {
authUser = data;
});
print(authUser.patientID);
}
var data = await this.sharedPref.getObject(WEATHER);
if (data == null) {
var d = await _weatherService.getWeatherData();
print(d);
setState(() {
weather = d != null ? d.temperature.toString() + '\u2103' : '--';
});
} else {
setState(() {
weather =
data != null ? data['Temperature'].toString() + '\u2103' : '--';
});
}
}
void setLocation(Position position) {
this.sharedPref.setDouble(USER_LAT, position.latitude ?? 0.0);
this.sharedPref.setDouble(USER_LONG, position.longitude ?? 0.0);
getAuthUser();
}
}

@ -0,0 +1,140 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/weather/weather_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/weather_slider/weather_slider.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
class HealthWeatherIndicator extends StatefulWidget {
@override
_HospitalsPageState createState() => _HospitalsPageState();
}
class _HospitalsPageState extends State<HealthWeatherIndicator> {
var data;
LocationUtils locationUtils;
AppSharedPreferences sharedPref = AppSharedPreferences();
var weather = '--';
@override
void initState() {
locationUtils =
new LocationUtils(isShowConfirmDialog: true, context: context);
WidgetsBinding.instance
.addPostFrameCallback((_) => locationUtils.getCurrentLocation());
getWeather();
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<WeatherViewModel>(
onModelReady: (model) => model.getWeatherData(),
allowAny: true,
builder: (_, mode, widget) => AppScaffold(
isShowDecPage: false,
appBarTitle: TranslationBase.of(context).healthWeatherIndicators,
isShowAppBar: true,
body: mode.weatherIndicatorData.length > 0
? SingleChildScrollView(
child: Column(children: [
Container(
margin: EdgeInsets.all(8),
width: double.infinity,
height: 150,
decoration: BoxDecoration(
image: DecorationImage(
image:
ExactAssetImage('assets/images/Weather_img.png'),
fit: BoxFit.cover,
),
borderRadius: BorderRadius.circular(8.0)),
child: Padding(
padding: EdgeInsets.symmetric(horizontal: 10.0),
child: Row(
children: [
Expanded(
flex: 3,
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context)
.healthWeatherIndicators,
color: Colors.white,
fontWeight: FontWeight.w600,
),
AppText(
TranslationBase.of(context)
.healthTipsBasedOnCurrentWeather,
color: Colors.white,
fontSize: 14,
),
],
)),
Expanded(
flex: 2,
child: InkWell(
onTap: () {},
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
mainAxisAlignment:
MainAxisAlignment.center,
children: [
Image.asset(
'assets/images/Weather_ico.png',
width: 60,
height: 60,
),
Directionality(
textDirection: TextDirection.ltr,
child: AppText(weather,
fontSize: 22,
color: Colors.white))
],
),
],
)),
)
],
),
),
),
Padding(
padding: EdgeInsets.all(15),
child: AppText(
projectViewModel.isArabic
? mode.weatherIndicatorData[0].cityNameN
: mode.weatherIndicatorData[0].cityName,
fontSize: 24,
fontWeight: FontWeight.bold,
)),
Padding(
padding: EdgeInsets.all(15),
child: Column(
children: mode.weatherIndicatorData.map((data) {
return WeatherSlider(data);
}).toList()))
]))
: Center(child: AppCircularProgressIndicator())),
);
}
getWeather() async {
var data = await this.sharedPref.getObject(WEATHER);
setState(() {
weather = data['Temperature'].toString() + '\u2103' ?? '--';
});
}
}

@ -6,9 +6,12 @@ import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/others/arrow_back.dart';
import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:geolocator/geolocator.dart';
import 'components/SearchByClinic.dart';
class Search extends StatefulWidget {
final int type;
final List clnicIds;
@ -31,34 +34,40 @@ class _SearchState extends State<Search> with TickerProviderStateMixin {
@override
Widget build(BuildContext context) {
AppGlobal.context = context;
return Scaffold(
appBar: AppBar(
bottom: TabBar(
tabs: [
Tab(text: TranslationBase.of(context).clinicName),
Tab(
text: TranslationBase.of(context).doctorName,
)
],
controller: _tabController,
),
title: Text(TranslationBase.of(context).bookAppo,
style: TextStyle(color: Colors.white)),
leading: Builder(
builder: (BuildContext context) {
return ArrowBack();
},
),
),
body: TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [
SearchByClinic(
clnicIds: widget.clnicIds,
),
SearchByDoctor()
],
controller: _tabController),
);
return AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
appBarTitle: TranslationBase.of(context).bookAppo,
body: Container(
child: Column(
children: [
TabBar(
tabs: [
Tab(text: TranslationBase.of(context).clinicName),
Tab(
text: TranslationBase.of(context).doctorName,
)
],
controller: _tabController,
),
Divider(
color: Colors.grey[600],
thickness: 0.5,
),
Expanded(
child: new TabBarView(
physics: NeverScrollableScrollPhysics(),
children: [
SearchByClinic(
clnicIds: widget.clnicIds,
),
SearchByDoctor()
],
controller: _tabController,
),
)
],
),
));
}
}

@ -17,6 +17,7 @@ class DoctorInformation extends StatelessWidget {
mainAxisSize: MainAxisSize.min,
children: <Widget>[
AppExpandableNotifier(
isExpand: true,
headerWidget: Container(
margin: EdgeInsets.all(10.0),
child: Row(
@ -78,6 +79,7 @@ class DoctorInformation extends StatelessWidget {
),
// ),
AppExpandableNotifier(
isExpand: true,
headerWidget: Container(
margin: EdgeInsets.all(10.0),
child: Row(

@ -34,6 +34,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
List<HospitalsModel> projectsList = [];
bool isMobileAppDentalAllow = false;
bool isLoaded = false;
bool isProjectLoaded = false;
@override
void initState() {
@ -56,6 +57,11 @@ class _SearchByClinicState extends State<SearchByClinic> {
onChanged: (bool value) {
setState(() {
nearestAppo = value;
print(nearestAppo);
if (nearestAppo)
getProjectsList();
else
isProjectLoaded = false;
});
},
),
@ -121,7 +127,8 @@ class _SearchByClinicState extends State<SearchByClinic> {
},
),
)),
isDentalSelectedAndSupported() == true || nearestAppo
isDentalSelectedAndSupported() == true ||
(nearestAppo && isProjectLoaded)
? Container(
height: 60.0,
decoration: BoxDecoration(
@ -177,24 +184,30 @@ class _SearchByClinicState extends State<SearchByClinic> {
});
});
getProjectsList();
GifLoaderDialogUtils.hideDialog(context);
} else {}
}).catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
});
}
getProjectsList() {
ClinicListService service = new ClinicListService();
List<HospitalsModel> projectsListLocal = [];
service.getProjectsList(context).then((res) {
if (res['MessageStatus'] == 1) {
setState(() {
res['ListProject'].forEach((v) {
projectsList.add(new HospitalsModel.fromJson(v));
projectsListLocal.add(new HospitalsModel.fromJson(v));
});
projectsList = projectsListLocal;
});
GifLoaderDialogUtils.hideDialog(context);
filterClinic();
} else {}
isProjectLoaded = true;
} else {
isProjectLoaded = false;
}
}).catchError((err) {
print(err);
});
@ -235,10 +248,6 @@ class _SearchByClinicState extends State<SearchByClinic> {
doctorsList.clear();
res['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
// arr.add(new DoctorList.fromJson(v).projectName);
// arrDistance.add(new DoctorList.fromJson(v)
// .projectDistanceInKiloMeters
// .toString());
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital =
@ -269,8 +278,6 @@ class _SearchByClinicState extends State<SearchByClinic> {
result = LinkedHashSet<String>.from(arr).toList();
numAll = result.length;
// navigateToSearchResults(
// context, doctorsList, result, numAll, arrDistance);
navigateToSearchResults(
context, doctorsList, _patientDoctorAppointmentListHospital);
} else {
@ -299,6 +306,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
List<DoctorList> docList,
List<PatientDoctorAppointmentList>
patientDoctorAppointmentListHospital) async {
isProjectLoaded = false;
Navigator.push(
context,
MaterialPageRoute(
@ -313,7 +321,7 @@ class _SearchByClinicState extends State<SearchByClinic> {
filterClinic() {
setState(() {
if (widget.clnicIds.length > 0) {
if (widget.clnicIds != null && widget.clnicIds.length > 0) {
clinicsList = clinicsList
.where((i) => widget.clnicIds.indexOf(i.clinicID) > -1)
.toList();

@ -23,9 +23,9 @@ class _LiveChatPageState extends State<LiveChatPage>
@override
void initState() {
super.initState();
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/ar/0.png'));
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/ar/1.png'));
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/en/2.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/live-chat/ar/2.png'));
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/live-chat/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/live-chat/ar/0.png'));
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/live-chat/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/live-chat/ar/1.png'));
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/live-chat/en/2.png',imageAr: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/live-chat/ar/2.png'));
_tabController = TabController(length: 2, vsync: this);
}

@ -13,6 +13,8 @@ import 'package:diplomaticquarterapp/models/Authentication/check_activation_code
import 'package:diplomaticquarterapp/models/FamilyFiles/GetAllSharedRecordByStatusResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/BranchView.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/pages/rateAppointment/rate_appointment_doctor.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
@ -25,6 +27,7 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart';
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_circular_progress_Indeicator.dart';
import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/widgets/buttons/defaultButton.dart';
@ -69,17 +72,17 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
imagesInfo.add(
ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/0.png',
'https://hmgwebservices.com/Images/MobileAppDq/images-info-home/family-file/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/0.png'),
'https://hmgwebservices.com/Images/MobileAppDq/images-info-home/family-file/ar/0.png'),
);
imagesInfo.add(
ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/en/1.png',
'https://hmgwebservices.com/Images/MobileAppDq/images-info-home/family-file/en/1.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/family-file/ar/1.png'),
'https://hmgwebservices.com/Images/MobileAppDq/images-info-home/family-file/ar/1.png'),
);
projectViewModel = Provider.of(context);
return AppScaffold(
@ -704,26 +707,58 @@ class _MyFamily extends State<MyFamily> with TickerProviderStateMixin {
}
loginAfter(result, context) async {
GifLoaderDialogUtils.hideDialog(context);
//GifLoaderDialogUtils.hideDialog(context);
Provider.of<ProjectViewModel>(context, listen: false).setPrivilege(privilegeList: result,isLoginChild: true);
var currentLang = await sharedPref.getString(APP_LANGUAGE);
result = list.CheckActivationCode.fromJson(result);
var familyFile = await sharedPref.getObject(FAMILY_FILE);
var mainUser = await sharedPref.getObject(MAIN_USER);
var bloodType = await sharedPref.getString(BLOOD_TYPE);
this.sharedPref.clear();
if (mainUser["PatientID"] != result.list.patientID) {
result.list.isFamily = true;
}
this.sharedPref.setString(APP_LANGUAGE, currentLang);
this.sharedPref.setObject(MAIN_USER, mainUser);
//sharedPref.setString(BLOOD_TYPE, result['PatientBloodType']);
this.sharedPref.setString(BLOOD_TYPE, bloodType);
this.sharedPref.setObject(USER_PROFILE, result.list);
this.sharedPref.setObject(FAMILY_FILE, familyFile);
this.sharedPref.setObject(LOGIN_TOKEN_ID, result.logInTokenID);
this.sharedPref.setString(TOKEN, result.authenticationTokenID);
//this.checkIfUserAgreedBefore(result),
Navigator.of(context).pushNamed(
HOME,
);
await authenticatedUserObject.getUser(getUser: true);
Provider.of<ProjectViewModel>(context, listen: false).user =
authenticatedUserObject.user;
Provider.of<ProjectViewModel>(context, listen: false)
.setUser(authenticatedUserObject.user);
appointmentRateViewModel
.getIsLastAppointmentRatedList()
.then((value) => {
//getToDoCount(),
// Utils.hideProgressDialog(),
if (appointmentRateViewModel.isHaveAppointmentNotRate)
{
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: RateAppointmentDoctor(),
),
(r) => false)
}
else
{
Navigator.pushAndRemoveUntil(
context,
FadePage(
page: LandingPage(),
),
(r) => false)
}
})
.catchError((err) {
print(err);
// Utils.hideProgressDialog();
// GifLoaderDialogUtils.hideDialog(context);
});
}
deactivateRequest(ID, status, context) {

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/er/am_request_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
@ -24,6 +25,7 @@ class AmbulanceReq extends StatefulWidget {
class _AmbulanceReqState extends State<AmbulanceReq>
with SingleTickerProviderStateMixin {
TabController _tabController;
List<ImagesInfo> imagesInfo = List();
@override
void initState() {
@ -39,11 +41,19 @@ class _AmbulanceReqState extends State<AmbulanceReq>
@override
Widget build(BuildContext context) {
imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/Ambulance/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/Ambulance/ar/0.png'));
return BaseView<AmRequestViewModel>(
onModelReady: (model) => model.getAmRequestOrders(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
appBarTitle: "Ambulance Request",
appBarTitle: TranslationBase.of(context).transportationService,
description: TranslationBase.of(context).infoAmbulance,
imagesInfo: imagesInfo,
baseViewModel: model,
body: Scaffold(
extendBodyBehindAppBar: true,
@ -92,8 +102,7 @@ class _AmbulanceReqState extends State<AmbulanceReq>
Container(
width: MediaQuery.of(context).size.width * 0.40,
child: Center(
child: Texts(
"Ambulance Request"), //TranslationBase.of(context).prescriptions
child: Texts(TranslationBase.of(context).transportationService),
),
),
Container(
@ -118,8 +127,8 @@ class _AmbulanceReqState extends State<AmbulanceReq>
controller: _tabController,
children: <Widget>[
AmbulanceRequestIndexPage(
amRequestViewModel: model,
),
amRequestViewModel: model,
),
OrderLogPage(
amRequestViewModel: model,
)

@ -60,14 +60,14 @@ class _MyAppointmentsState extends State<MyAppointments>
});
imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/en/0.png',
'https://hmgwebservices.com/Images/MobileAppDq/imges-info/my-appointment/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/ar/0.png'));
'https://hmgwebservices.com/Images/MobileAppDq/imges-info/my-appointment/ar/0.png'));
imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/en/1.png',
'https://hmgwebservices.com/Images/MobileAppDq/imges-info/my-appointment/en/1.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/imges-info/my-appointment/ar/1.png'));
'https://hmgwebservices.com/Images/MobileAppDq/imges-info/my-appointment/ar/1.png'));
super.initState();
}

@ -2,13 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
class ArrivedButtons {
static var buttons = [
// {
// "title": TranslationBase.of(AppGlobal.context).arrived,
// "subtitle": TranslationBase.of(AppGlobal.context).status,
// "icon": "assets/images/new-design/waiting-room.png",
// "caller": "openReschedule"
// },
var buttons = [
{
"title": TranslationBase.of(AppGlobal.context).medicines,
"subtitle": TranslationBase.of(AppGlobal.context).medicinesSubtitle,

@ -2,7 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
class BookedButtons {
static var buttons = [
var buttons = [
{
"title": TranslationBase.of(AppGlobal.context).confirm,
"subtitle": TranslationBase.of(AppGlobal.context).appointment,

@ -2,7 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
class BookedButtonsAllowCheckIn {
static var buttons = [
var buttons = [
{
"title": TranslationBase.of(AppGlobal.context).confirm,
"subtitle": TranslationBase.of(AppGlobal.context).appointment,

@ -2,7 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
class ConfirmedButtons {
static var buttons = [
var buttons = [
{
"title": TranslationBase.of(AppGlobal.context).reschedule,
"subtitle": TranslationBase.of(AppGlobal.context).appointment,

@ -2,7 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
class ConfirmedButtonsAllowCheckIn {
static var buttons = [
var buttons = [
{
"title": TranslationBase.of(AppGlobal.context).reschedule,
"subtitle": TranslationBase.of(AppGlobal.context).appointment,

@ -276,14 +276,15 @@ class _AppointmentActionsState extends State<AppointmentActions> {
Future<List<AppoDetailsButton>> _getBookedAppoActionsList() async {
print("_getBookedAppoActionsList");
print(BookedButtons.buttons);
BookedButtons bookedButtons = new BookedButtons();
print(bookedButtons.buttons);
List<AppoDetailsButton> buttonsList = [];
for (var i = 0; i < BookedButtons.buttons.length; i++) {
for (var i = 0; i < bookedButtons.buttons.length; i++) {
buttonsList.add(AppoDetailsButton(
title: BookedButtons.buttons[i]['title'],
subtitle: BookedButtons.buttons[i]['subtitle'],
icon: BookedButtons.buttons[i]['icon'],
caller: BookedButtons.buttons[i]['caller'],
title: bookedButtons.buttons[i]['title'],
subtitle: bookedButtons.buttons[i]['subtitle'],
icon: bookedButtons.buttons[i]['icon'],
caller: bookedButtons.buttons[i]['caller'],
));
}
setState(() {
@ -293,14 +294,16 @@ class _AppointmentActionsState extends State<AppointmentActions> {
Future<List<AppoDetailsButton>> _getBookedCheckInAppoActionsList() async {
print("_getBookedCheckInAppoActionsList");
print(BookedButtonsAllowCheckIn.buttons);
BookedButtonsAllowCheckIn bookedButtonsAllowCheckIn =
new BookedButtonsAllowCheckIn();
print(bookedButtonsAllowCheckIn.buttons);
List<AppoDetailsButton> buttonsList = [];
for (var i = 0; i < BookedButtonsAllowCheckIn.buttons.length; i++) {
for (var i = 0; i < bookedButtonsAllowCheckIn.buttons.length; i++) {
buttonsList.add(AppoDetailsButton(
title: BookedButtonsAllowCheckIn.buttons[i]['title'],
subtitle: BookedButtonsAllowCheckIn.buttons[i]['subtitle'],
icon: BookedButtonsAllowCheckIn.buttons[i]['icon'],
caller: BookedButtonsAllowCheckIn.buttons[i]['caller'],
title: bookedButtonsAllowCheckIn.buttons[i]['title'],
subtitle: bookedButtonsAllowCheckIn.buttons[i]['subtitle'],
icon: bookedButtonsAllowCheckIn.buttons[i]['icon'],
caller: bookedButtonsAllowCheckIn.buttons[i]['caller'],
));
}
setState(() {
@ -310,14 +313,15 @@ class _AppointmentActionsState extends State<AppointmentActions> {
Future<List<AppoDetailsButton>> _getConfirmedAppoActionsList() async {
print("_getConfirmedAppoActionsList");
print(ConfirmedButtons.buttons);
ConfirmedButtons confirmedButtons = new ConfirmedButtons();
print(confirmedButtons.buttons);
List<AppoDetailsButton> buttonsList = [];
for (var i = 0; i < ConfirmedButtons.buttons.length; i++) {
for (var i = 0; i < confirmedButtons.buttons.length; i++) {
buttonsList.add(AppoDetailsButton(
title: ConfirmedButtons.buttons[i]['title'],
subtitle: ConfirmedButtons.buttons[i]['subtitle'],
icon: ConfirmedButtons.buttons[i]['icon'],
caller: ConfirmedButtons.buttons[i]['caller'],
title: confirmedButtons.buttons[i]['title'],
subtitle: confirmedButtons.buttons[i]['subtitle'],
icon: confirmedButtons.buttons[i]['icon'],
caller: confirmedButtons.buttons[i]['caller'],
));
}
setState(() {
@ -327,14 +331,16 @@ class _AppointmentActionsState extends State<AppointmentActions> {
Future<List<AppoDetailsButton>> _getConfirmedCheckInAppoActionsList() async {
print("_getConfirmedAllowCheckInAppoActionsList");
print(ConfirmedButtonsAllowCheckIn.buttons);
ConfirmedButtonsAllowCheckIn confirmedButtonsAllowCheckIn =
new ConfirmedButtonsAllowCheckIn();
print(confirmedButtonsAllowCheckIn.buttons);
List<AppoDetailsButton> buttonsList = [];
for (var i = 0; i < ConfirmedButtonsAllowCheckIn.buttons.length; i++) {
for (var i = 0; i < confirmedButtonsAllowCheckIn.buttons.length; i++) {
buttonsList.add(AppoDetailsButton(
title: ConfirmedButtonsAllowCheckIn.buttons[i]['title'],
subtitle: ConfirmedButtonsAllowCheckIn.buttons[i]['subtitle'],
icon: ConfirmedButtonsAllowCheckIn.buttons[i]['icon'],
caller: ConfirmedButtonsAllowCheckIn.buttons[i]['caller'],
title: confirmedButtonsAllowCheckIn.buttons[i]['title'],
subtitle: confirmedButtonsAllowCheckIn.buttons[i]['subtitle'],
icon: confirmedButtonsAllowCheckIn.buttons[i]['icon'],
caller: confirmedButtonsAllowCheckIn.buttons[i]['caller'],
));
}
setState(() {
@ -344,14 +350,15 @@ class _AppointmentActionsState extends State<AppointmentActions> {
Future<List<AppoDetailsButton>> _getArrivedAppoActionsList() async {
print("_getArrivedAppoActionsList");
print(ArrivedButtons.buttons);
ArrivedButtons arrivedButtons = new ArrivedButtons();
print(arrivedButtons.buttons);
List<AppoDetailsButton> buttonsList = [];
for (var i = 0; i < ArrivedButtons.buttons.length; i++) {
for (var i = 0; i < arrivedButtons.buttons.length; i++) {
buttonsList.add(AppoDetailsButton(
title: ArrivedButtons.buttons[i]['title'],
subtitle: ArrivedButtons.buttons[i]['subtitle'],
icon: ArrivedButtons.buttons[i]['icon'],
caller: ArrivedButtons.buttons[i]['caller'],
title: arrivedButtons.buttons[i]['title'],
subtitle: arrivedButtons.buttons[i]['subtitle'],
icon: arrivedButtons.buttons[i]['icon'],
caller: arrivedButtons.buttons[i]['caller'],
));
}
setState(() {
@ -361,14 +368,14 @@ class _AppointmentActionsState extends State<AppointmentActions> {
Future<List<AppoDetailsButton>> _getArrivedInvoiceAppoActionsList() async {
print("_getArrivedInvoiceAppoActionsList");
print(ArrivedButtons.buttons);
ArrivedButtons arrivedButtons = new ArrivedButtons();
List<AppoDetailsButton> buttonsList = [];
for (var i = 0; i < ArrivedButtons.buttons.length; i++) {
for (var i = 0; i < arrivedButtons.buttons.length; i++) {
buttonsList.add(AppoDetailsButton(
title: ArrivedButtons.buttons[i]['title'],
subtitle: ArrivedButtons.buttons[i]['subtitle'],
icon: ArrivedButtons.buttons[i]['icon'],
caller: ArrivedButtons.buttons[i]['caller'],
title: arrivedButtons.buttons[i]['title'],
subtitle: arrivedButtons.buttons[i]['subtitle'],
icon: arrivedButtons.buttons[i]['icon'],
caller: arrivedButtons.buttons[i]['caller'],
));
}
setState(() {
@ -474,7 +481,8 @@ class _AppointmentActionsState extends State<AppointmentActions> {
prescriptionReportEnhList.add(PrescriptionReportEnh.fromJson(report));
});
print(prescriptionReportEnhList.length);
navigateToMedicinePrescriptionReport(prescriptionReportEnhList, res['ListPRM']);
navigateToMedicinePrescriptionReport(
prescriptionReportEnhList, res['ListPRM']);
} else {
AppToast.showErrorToast(message: TranslationBase.of(context).noRecords);
}
@ -660,7 +668,7 @@ class _AppointmentActionsState extends State<AppointmentActions> {
context,
FadePage(
page: VitalSignDetailsScreen(
appointmentNo: appoNo, projectID: projectID)));
appointmentNo: appoNo, projectID: projectID,isNotOneAppointment: false,)));
}
navigateToInsertComplaint() {

@ -24,6 +24,17 @@ class AppointmentCard extends StatefulWidget {
}
class _ApointmentCardState extends State<AppointmentCard> {
CountdownTimerController controller;
@override
void initState() {
super.initState();
int endTime = DateTime.now().millisecondsSinceEpoch + 1000 * 30;
controller = CountdownTimerController(
endTime: endTime,
);
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
@ -44,103 +55,157 @@ class _ApointmentCardState extends State<AppointmentCard> {
child: Row(
mainAxisAlignment: MainAxisAlignment.start,
children: <Widget>[
Container(
width: projectViewModel.isArabic ? 27 : 20,
height: projectViewModel.isArabic ? 165 : 140,
decoration: BoxDecoration(
//Colors.red[900] Color(0xff404545)
color: widget.appo.isLiveCareAppointment
? Color(0xff404545)
: !widget.appo.isInOutPatient
? Colors.red[900]
: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic
? Radius.circular(0)
: Radius.circular(8),
bottomLeft: projectViewModel.isArabic
? Radius.circular(0)
: Radius.circular(8),
topRight: projectViewModel.isArabic
? Radius.circular(8)
: Radius.circular(0),
bottomRight: projectViewModel.isArabic
? Radius.circular(8)
: Radius.circular(0),
),
),
child: RotatedBox(
quarterTurns: 3,
child: Center(
child: Text(
widget.appo.isLiveCareAppointment
? TranslationBase.of(context)
.liveCare
.toUpperCase()
: !widget.appo.isInOutPatient
? TranslationBase.of(context)
.inPatient
.toUpperCase()
: TranslationBase.of(context)
.outpatient
.toUpperCase(),
style: TextStyle(color: Colors.white),
),
)),
),
SizedBox(width: 8,),
ClipRRect(
borderRadius: BorderRadius.circular(100.0),
child: Image.network(widget.appo.doctorImageURL,
fit: BoxFit.fill, height: 60.0, width: 60.0),
),
Container(
width: MediaQuery.of(context).size.width * 0.61,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
widget.appo.doctorTitle +
" " +
widget.appo.doctorNameObj,
style: TextStyle(
fontSize: 14.0,
color: Colors.grey[700],
letterSpacing: 1.0)),
Container(
margin: EdgeInsets.only(top: 3.0),
child: Text(widget.appo.clinicName,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
Container(
margin: EdgeInsets.only(top: 3.0),
child: Text(widget.appo.projectName,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
Container(
margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
child: Text(
DateUtil.getWeekDayMonthDayYearDateFormatted(
DateUtil.convertStringToDate(
widget.appo.appointmentDate),
projectViewModel.isArabic ? "ar" : "en")
.trim(),
Expanded(
child: Container(
width: MediaQuery.of(context).size.width * 0.61,
margin: EdgeInsets.fromLTRB(20.0, 10.0, 10.0, 0.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Text(
widget.appo.doctorTitle +
" " +
widget.appo.doctorNameObj,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
fontSize: 14.0,
color: Colors.grey[700],
letterSpacing: 1.0)),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating:
widget.appo.actualDoctorRate.toDouble(),
size: 20.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
Container(
transform:
Matrix4.translationValues(15.0, -40.0, 0.0),
child: projectViewModel.isArabic
? Image.asset(
"assets/images/new-design/arrow_menu_black-ar.png",
width: 25.0,
height: 25.0)
: Image.asset(
"assets/images/new-design/arrow_menu_black-en.png",
width: 25.0,
height: 25.0),
),
],
),
(widget.appo.patientStatusType == AppointmentType.BOOKED ||
widget.appo.patientStatusType ==
AppointmentType.CONFIRMED)
? Container(
child: CountdownTimer(
controller: CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (widget.appo.remaniningHoursTocanPay * 1000) * 60),
widgetBuilder: (_, CurrentRemainingTime time) {
return Text(
'${time.days}:${time.hours}:${time.min}:${time.sec} ' +
TranslationBase.of(context)
.upcomingTimeLeft,
style: TextStyle(
fontSize: 12.0,
color: Color(0xff40ACC9)));
},
),
)
: Container(),
],
Container(
margin: EdgeInsets.only(top: 3.0),
child: Text(widget.appo.clinicName,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
Container(
margin: EdgeInsets.only(top: 3.0),
child: Text(widget.appo.projectName,
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
Container(
margin: EdgeInsets.only(top: 3.0, bottom: 3.0),
child: Text(
DateUtil.getWeekDayMonthDayYearDateFormatted(
DateUtil.convertStringToDate(
widget.appo.appointmentDate),
projectViewModel.isArabic ? "ar" : "en")
.trim(),
style: TextStyle(
fontSize: 12.0,
color: Colors.grey[600],
letterSpacing: 1.0)),
),
Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
RatingBar.readOnly(
initialRating:
widget.appo.actualDoctorRate.toDouble(),
size: 20.0,
filledColor: Colors.yellow[700],
emptyColor: Colors.grey[500],
isHalfAllowed: true,
halfFilledIcon: Icons.star_half,
filledIcon: Icons.star,
emptyIcon: Icons.star,
),
Container(
transform:
Matrix4.translationValues(15.0, -40.0, 0.0),
child: projectViewModel.isArabic
? Image.asset(
"assets/images/new-design/arrow_menu_black-ar.png",
width: 25.0,
height: 25.0)
: Image.asset(
"assets/images/new-design/arrow_menu_black-en.png",
width: 25.0,
height: 25.0),
),
],
),
(widget.appo.patientStatusType == AppointmentType.BOOKED ||
widget.appo.patientStatusType ==
AppointmentType.CONFIRMED)
? Container(
child: CountdownTimer(
controller: new CountdownTimerController(
endTime:
DateTime.now().millisecondsSinceEpoch +
(widget.appo.remaniningHoursTocanPay *
1000) *
60),
widgetBuilder: (_, CurrentRemainingTime time) {
return time != null
? Text(
'${time.days}:${time.hours}:${time.min}:${time.sec} ' +
TranslationBase.of(context)
.upcomingTimeLeft,
style: TextStyle(
fontSize: 12.0,
color: Color(0xff40ACC9)))
: Container();
},
),
)
: Container(),
],
),
),
),
],

@ -11,6 +11,7 @@ import 'package:diplomaticquarterapp/pages/BookAppointment/QRCode.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/payment_method_select.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/widgets/paymentDialog.dart';
import 'package:diplomaticquarterapp/routes.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
@ -53,6 +54,8 @@ class _ToDoState extends State<ToDo> {
List<ImagesInfo> imagesInfo = List();
ToDoCountProviderModel toDoProvider;
CountdownTimerController controller;
@override
void initState() {
widget.patientShareResponse = new PatientShareResponse();
@ -62,9 +65,11 @@ class _ToDoState extends State<ToDo> {
super.initState();
imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/en/0.png',
'https://hmgwebservices.com/Images/MobileAppDq/images-info-home/todo/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/images-info-home/todo/ar/0.png'));
'https://hmgwebservices.com/Images/MobileAppDq/images-info-home/todo/ar/0.png'));
int endTime = DateTime.now().millisecondsSinceEpoch + 1000 * 30;
controller = CountdownTimerController(endTime: endTime);
}
@override
@ -114,11 +119,15 @@ class _ToDoState extends State<ToDo> {
EdgeInsets.only(left: 10.0, right: 10.0),
child: Text(
DateUtil.getWeekDayMonthDayYearDateFormatted(
DateUtil.convertStringToDate(widget
.appoList[index].appointmentDate),
projectViewModel.isArabic
? "ar"
: "en") + " " + widget.appoList[index].startTime.substring(0, 5),
DateUtil.convertStringToDate(
widget.appoList[index]
.appointmentDate),
projectViewModel.isArabic
? "ar"
: "en") +
" " +
widget.appoList[index].startTime
.substring(0, 5),
style: TextStyle(fontSize: 10.0)),
),
widget.appoList[index].isLiveCareAppointment
@ -229,18 +238,26 @@ class _ToDoState extends State<ToDo> {
),
Container(
child: CountdownTimer(
controller: CountdownTimerController(endTime: DateTime.now().millisecondsSinceEpoch + (widget.appoList[index].remaniningHoursTocanPay * 1000) * 60,),
controller: new CountdownTimerController(
endTime: DateTime.now()
.millisecondsSinceEpoch +
(widget.appoList[index]
.remaniningHoursTocanPay *
1000) *
60),
widgetBuilder:
(_, CurrentRemainingTime time) {
return Text(
'${time.days}:${time.hours}:${time.min}:${time.sec} ' +
TranslationBase.of(
context)
.upcomingTimeLeft,
style: TextStyle(
fontSize: 12.0,
color:
Color(0xff40ACC9)));
return time != null
? Text(
'${time.days}:${time.hours}:${time.min}:${time.sec} ' +
TranslationBase.of(
context)
.upcomingTimeLeft,
style: TextStyle(
fontSize: 12.0,
color: Color(
0xff40ACC9)))
: Container();
},
),
),
@ -521,23 +538,11 @@ class _ToDoState extends State<ToDo> {
});
}
getToDoCount() {
toDoProvider.setState(0, true);
ClinicListService service = new ClinicListService();
service.getActiveAppointmentNo(context).then((res) {
print(res['AppointmentActiveNumber']);
if (res['MessageStatus'] == 1) {
toDoProvider.setState(res['AppointmentActiveNumber'], true);
} else {}
}).catchError((err) {
print(err);
});
}
getPatientAppointmentHistory() {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service.getPatientAppointmentHistory(true, context).then((res) {
widget.appoList.clear();
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
setState(() {
@ -547,9 +552,10 @@ class _ToDoState extends State<ToDo> {
widget.appoList
.add(new AppoitmentAllHistoryResultList.fromJson(v));
});
} else {}
} else {
Navigator.of(context).popAndPushNamed(HOME);
}
});
getToDoCount();
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}

@ -218,7 +218,7 @@ class _PaymentMethodState extends State<PaymentMethod> {
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.7,
minWidth: MediaQuery.of(context).size.height * 0.1,
height: 45.0,
child: RaisedButton(
color: new Color(0xFF60686b),

@ -15,7 +15,8 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'dart:convert';
import 'dart:io';
import 'appointment_history.dart';
class SendFeedbackPage extends StatefulWidget {
@ -343,11 +344,11 @@ class _SendFeedbackPageState extends State<SendFeedbackPage> {
),
InkWell(
onTap: () {
ImageOptions.showImageOptions(context, (String image) {
ImageOptions.showImageOptions(context, (String image,File file) {
setState(() {
images.add(image);
});
});
} );
},
child: Container(
margin: EdgeInsets.only(left: 10, right: 10, top: 15),

@ -17,7 +17,6 @@ class _StatusFeedbackPageState extends State<StatusFeedbackPage> {
@override
Widget build(BuildContext context) {
return BaseView<FeedbackViewModel>(
allowAny: true,
onModelReady: (model) => model.getCOC(),
builder: (_, model, widget) => AppScaffold(
baseViewModel: model,

@ -0,0 +1,147 @@
import 'dart:io';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_options/BottomSheet.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class AttachInsuranceCardImageDialog extends StatefulWidget {
final String name;
final String fileNo;
final Function(File file, String image) image;
const AttachInsuranceCardImageDialog(
{Key key, this.name, this.fileNo, this.image})
: super(key: key);
@override
_AttachInsuranceCardImageDialogState createState() =>
_AttachInsuranceCardImageDialogState();
}
class _AttachInsuranceCardImageDialogState
extends State<AttachInsuranceCardImageDialog> {
@override
void initState() {
super.initState();
}
String image;
File file;
@override
Widget build(BuildContext context) {
return SimpleDialog(
children: [
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Texts(TranslationBase.of(context).attachInsuraceImage),
Divider(),
Texts(widget.name),
SizedBox(
height: 3,
),
Texts(TranslationBase.of(context).fileNo + " " + widget.fileNo),
SizedBox(
height: 5.0,
),
InkWell(
onTap: () {
ImageOptions.showImageOptions(context, (String image,File file) {
setState(() {
this.image = image;
this.file = file;
});
});
},
child: image == null
? Padding(
padding: const EdgeInsets.all(18.0),
child: Container(
width: double.maxFinite,
height: 250,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(2),
border: Border.all(color: Colors.grey, width: 1.5)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
// mainAxisAlignment: MainAxisAlignment.,
children: [
SizedBox(height: 25,),
Icon(
Icons.camera_enhance_rounded,
size: 85,
),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Icon(Icons.attach_file),
Texts(TranslationBase.of(context).selectAttachment.toUpperCase())
],
),
],
),
),
)
: Image.file(
file,
fit: BoxFit.fill,
height: 250,
),
),
SizedBox(
height: 25.0,
),
Divider(),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.pop(context);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
child: Center(
child: Texts(
TranslationBase.of(context).cancel.toUpperCase(),
color: Colors.red,
),
),
),
),
),
),
Container(
width: 1,
height: 30,
color: Colors.grey[500],
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.pop(context);
widget.image(file, image);
},
child: Padding(
padding: const EdgeInsets.all(8.0),
child: Center(
child: Texts(
TranslationBase.of(context).ok,
fontWeight: FontWeight.w400,
)),
),
),
),
],
)
],
)
],
);
}
}

@ -26,14 +26,14 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
Widget build(BuildContext context) {
imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/0.png',
'https://hmgwebservices.com/Images/MobileAppDq/imges-info/apporvals/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/0.png'));
'https://hmgwebservices.com/Images/MobileAppDq/imges-info/apporvals/ar/0.png'));
imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/1.png',
'https://hmgwebservices.com/Images/MobileAppDq/imges-info/apporvals/en/1.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/1.png'));
'https://hmgwebservices.com/Images/MobileAppDq/imges-info/apporvals/ar/1.png'));
return BaseView<InsuranceViewModel>(
onModelReady: widget.appointmentNo != null
? (model) =>

@ -34,9 +34,9 @@ class _InsuranceCardState extends State<InsuranceCard> {
Widget build(BuildContext context) {
imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/en/0.png',
'https://hmgwebservices.com/Images/MobileAppDq/imges-info/insurance-card/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/imges-info/insurance-card/ar/0.png'));
'https://hmgwebservices.com/Images/MobileAppDq/imges-info/insurance-card/ar/0.png'));
return BaseView<InsuranceViewModel>(
onModelReady: (model) => model.getInsurance(),
@ -44,7 +44,6 @@ class _InsuranceCardState extends State<InsuranceCard> {
AppScaffold(
isShowAppBar: true,
baseViewModel: model,
image: 'assets/images/medical/insurance_card_icon.png',
appBarTitle: TranslationBase.of(context).insuranceCards,
description: TranslationBase.of(context).infoInsuranceCards,
infoList: TranslationBase.of(context).infoInsuranceCardsPoints,

@ -0,0 +1,346 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/insurance/Insurance_card_details.dart';
import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'AttachInsuranceCardImageDialog.dart';
class InsuranceCardUpdateDetails extends StatelessWidget {
final List<InsuranceCardDetailsModel> insuranceCardDetailsModel;
final String patientIdentificationID;
final int patientID;
final String name;
const InsuranceCardUpdateDetails(
{Key key,
this.insuranceCardDetailsModel,
this.patientIdentificationID,
this.patientID,
this.name})
: super(key: key);
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<InsuranceViewModel>(
builder: (context, model, w) => AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
appBarTitle: TranslationBase.of(context).cardDetail,
body: SingleChildScrollView(
child: Column(
children: [
...List.generate(
insuranceCardDetailsModel.length,
(index) => Padding(
padding: const EdgeInsets.all(8.0),
child: Container(
width: double.maxFinite,
margin: EdgeInsets.only(left: 8, right: 8, top: 8),
height: projectViewModel.isArabic ? 320 : 240,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(25),
color: Color(0xff515B5D),
),
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
insuranceCardDetailsModel[index].memberID,
textScaleFactor: 2.1,
style: TextStyle(
color: Colors.white,
letterSpacing: 8.0,
fontWeight: FontWeight.w400,
fontSize: 15),
),
SizedBox(
height: 5,
),
Texts(
insuranceCardDetailsModel[index].companyName,
fontSize: 14,
color: Colors.white,
),
SizedBox(
height: 25,
),
Row(
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).policyHolder,
color: Colors.white,
fontSize: 14,
),
Texts(
insuranceCardDetailsModel[index]
.memberName,
color: Colors.white,
fontSize: 14,
),
],
),
),
Expanded(
child: Column(
children: [
Texts(TranslationBase.of(context).policyNo,
color: Colors.white),
Texts(
insuranceCardDetailsModel[index]
.policyNumber,
color: Colors.white),
],
),
),
],
),
SizedBox(
height: 25,
),
Row(
mainAxisAlignment: MainAxisAlignment.start,
children: [
Expanded(
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context)
.expiryDateTitle,
color: Colors.white,
fontSize: 12,
),
Texts(
insuranceCardDetailsModel[index].dOB,
color: Colors.white,
fontSize: 12,
),
],
),
),
Expanded(
child: Column(
children: [
Texts(
TranslationBase.of(context).classTitle,
color: Colors.white,
fontSize: 12,
),
Texts(
insuranceCardDetailsModel[index]
.subCategory,
color: Colors.white,
fontSize: 12,
),
],
),
),
Expanded(
child: Column(
children: [
Texts(
TranslationBase.of(context).approval,
color: Colors.white,
fontSize: 12,
),
Texts(
insuranceCardDetailsModel[index]
.approvalLimit
.toString(),
color: Colors.white,
fontSize: 12,
),
],
),
),
],
)
],
),
),
),
),
),
if(insuranceCardDetailsModel.isEmpty)
Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.all(10.0),
child: Card(
margin: EdgeInsets.fromLTRB(
8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10),
),
child: Container(
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10.0),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
flex: 3,
child: Container(
margin: EdgeInsets.only(
top: 2.0,
left: 10.0,
right: 20.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: <Widget>[
Texts(
name,
fontSize: 14,
color: Colors.black,
fontWeight:
FontWeight.w500,
),
SizedBox(
height: 8,
),
Texts(
TranslationBase.of(
context)
.fileno +
": " +patientID.toString(),
fontSize: 14,
color: Colors.black,
fontWeight:
FontWeight.w500,
)
],
),
),
),
],
),
),
),
),
SizedBox(height: 150,),
Image.asset('assets/images/no-data-found.png',width: 80,height: 80,),
SizedBox(height: 8,),
Texts(TranslationBase.of(context).noDataAvailable)
],
)
],
),
),
bottomSheet: Container(
width: double.infinity,
height:insuranceCardDetailsModel.isEmpty? MediaQuery.of(context).size.height * 0.14:MediaQuery.of(context).size.height * 0.21,
child: Container(
margin: EdgeInsets.only(left: 8, right: 8),
child: Column(
children: [
SizedBox(
height: 8,
),
if(insuranceCardDetailsModel.isEmpty)
SecondaryButton(
textColor: Colors.white,
label: TranslationBase.of(context).scanNow.toUpperCase(),
color: Theme.of(context).primaryColor,
onTap: () async {
confirmAttachInsuranceCardImageDialogDialog(
context: context,
name: name,
fileNo: patientID.toString(),
model: model);
},
),
if(insuranceCardDetailsModel.isNotEmpty)
SecondaryButton(
textColor: Colors.white,
label: TranslationBase.of(context).agree.toUpperCase(),
color: Theme.of(context).primaryColor,
onTap: () async {
GifLoaderDialogUtils.showMyDialog(context);
await model.uploadInsuranceCard(
patientIdentificationID: patientIdentificationID,
patientID: patientID);
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal) {
AppToast.showErrorToast(message: model.error);
} else {
AppToast.showSuccessToast(
message: TranslationBase.of(context).requestSent);
}
},
),if(insuranceCardDetailsModel.isNotEmpty)
SizedBox(
height: 12,
),if(insuranceCardDetailsModel.isNotEmpty)
SecondaryButton(
textColor: Colors.white,
label: TranslationBase.of(context).disagree.toUpperCase(),
color: Colors.grey[800],
onTap: () async {
confirmAttachInsuranceCardImageDialogDialog(
context: context,
name: name,
fileNo: patientID.toString(),
model: model);
},
)
],
),
),
),
),
);
}
void confirmAttachInsuranceCardImageDialogDialog(
{BuildContext context,
String name,
String fileNo,
InsuranceViewModel model}) {
showDialog(
context: context,
child: AttachInsuranceCardImageDialog(
fileNo: fileNo,
name: name,
image: (file, image) async {
GifLoaderDialogUtils.showMyDialog(context);
await model.uploadInsuranceCard(
patientIdentificationID: patientIdentificationID,
patientID: patientID,
image: image);
GifLoaderDialogUtils.hideDialog(context);
if (model.state == ViewState.ErrorLocal ||
model.state == ViewState.Error) {
AppToast.showErrorToast(message: model.error);
} else {
AppToast.showSuccessToast(
message: TranslationBase.of(context).requestSent);
}
Navigator.pop(context);
},
),
);
}
}

@ -0,0 +1,261 @@
import 'package:diplomaticquarterapp/core/service/insurance_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import '../../locator.dart';
import 'insurance_card_update_details.dart';
class InsurancePage extends StatelessWidget {
final InsuranceViewModel model;
InsuranceCardService _insuranceCardService = locator<InsuranceCardService>();
InsurancePage({Key key, this.model}) : super(key: key);
@override
Widget build(BuildContext context) {
return SingleChildScrollView(
child: Column(
children: [
SizedBox(
height: 65,
),
Container(
margin: EdgeInsets.all(10.0),
color: Colors.white,
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10.0),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
if (model.user != null)
Expanded(
flex: 3,
child: Container(
margin: EdgeInsets.only(
top: 2.0,
left: 10.0,
right: 20.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
Texts(
model.user.firstName ?? '' + " " + model.user.lastName ?? '',
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
),
SizedBox(
height: 8,
),
Texts(
TranslationBase.of(context)
.fileno +
": " +
model.user.patientID
.toString(),
fontSize: 14,
color: Colors.black,
fontWeight: FontWeight.w500,
)
],
),
),
),
Expanded(
flex: 2,
child: Container(
margin: EdgeInsets.only(top: 2.0),
child: Column(
children: <Widget>[
Container(
child: SecondaryButton(
label: TranslationBase.of(
context)
.fetchData,
small: true,
textColor: Colors.white,
onTap: () {
getDetails(
setupID: '010266',
projectID: 15,
patientIdentificationID:
model.user
.patientIdentificationNo,
patientID: model
.user.patientID,
name: model.user
.firstName +
" " +
model
.user.lastName,context: context);
},
),
),
],
),
),
)
],
),
),
if(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList != null ?? false)
...List.generate(model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.length, (index) =>
model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3
? Container(
margin: EdgeInsets.all(10.0),
child: Card(
margin: EdgeInsets.fromLTRB(
8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10),
),
child: Container(
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10.0),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
flex: 3,
child: Container(
margin: EdgeInsets.only(
top: 2.0,
left: 10.0,
right: 20.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: <Widget>[
Texts(
model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.patientName,
fontSize: 14,
color: Colors.black,
fontWeight:
FontWeight.w500,
),
SizedBox(
height: 8,
),
Texts(
TranslationBase.of(
context)
.fileno +
": " +
model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.patientID
.toString(),
fontSize: 14,
color: Colors.black,
fontWeight:
FontWeight.w500,
)
],
),
),
),
Expanded(
flex: 2,
child: Container(
margin:
EdgeInsets.only(top: 2.0),
child: Column(
children: <Widget>[
Container(
child: SecondaryButton(
label: TranslationBase
.of(context)
.fetchData,
small: true,
textColor:
Colors.white,
onTap: () {
getDetails(
projectID: 15,
patientIdentificationID: model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.patientIdenficationNumber,
setupID:
'010266',
patientID: model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.responseID,
name: model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index].patientName,context: context);
},
),
),
],
),
),
)
],
),
),
),
)
: Container()
),
],
),
);
}
getDetails(
{String setupID,
int projectID,
String patientIdentificationID,
int patientID,
String name,BuildContext context}) {
GifLoaderDialogUtils.showMyDialog(context);
_insuranceCardService
.getPatientInsuranceDetails(
setupID: setupID,
projectID: projectID,
patientID: patientID,
patientIdentificationID: patientIdentificationID)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (!_insuranceCardService.hasError && _insuranceCardService.isHaveInsuranceCard) {
Navigator.push(
context,
FadePage(
page: InsuranceCardUpdateDetails(
insuranceCardDetailsModel: _insuranceCardService.insuranceCardDetailsList,
patientID: patientID,
patientIdentificationID: patientIdentificationID,
name: name,
)));
} else {
AppToast.showErrorToast(message: _insuranceCardService.error);
}
});
}
}

@ -1,8 +1,11 @@
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/service/insurance_service.dart';
import 'package:diplomaticquarterapp/locator.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_details.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
@ -12,6 +15,9 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/core/viewModels/insurance_card_View_model.dart';
import 'insurance_card_update_details.dart';
import 'insurance_page.dart';
class InsuranceUpdate extends StatefulWidget {
@override
_InsuranceUpdateState createState() => _InsuranceUpdateState();
@ -20,12 +26,13 @@ class InsuranceUpdate extends StatefulWidget {
class _InsuranceUpdateState extends State<InsuranceUpdate>
with SingleTickerProviderStateMixin {
TabController _tabController;
InsuranceCardService _insuranceCardService = locator<InsuranceCardService>();
List<ImagesInfo> imagesInfo = List();
@override
void initState() {
super.initState();
_tabController = TabController(length: 2, vsync: this);
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/insurance-card/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/insurance-card/ar/0.png'));
}
void dispose() {
@ -33,14 +40,17 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
_tabController.dispose();
}
//TODO implement update card
Widget build(BuildContext context) {
return BaseView<InsuranceViewModel>(
onModelReady: (model) => model.getInsuranceUpdated(),
builder: (BuildContext context, InsuranceViewModel model, Widget child) =>
AppScaffold(
appBarTitle: TranslationBase.of(context).insurCards,
description: TranslationBase.of(context).infoInsurCards,
infoList: TranslationBase.of(context).infoPrescriptionsPoints,
imagesInfo: imagesInfo,
isShowAppBar: true,
isShowDecPage: true,
baseViewModel: model,
body: Scaffold(
extendBodyBehindAppBar: true,
@ -101,196 +111,7 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
physics: BouncingScrollPhysics(),
controller: _tabController,
children: <Widget>[
Container(
child: model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList.isNotEmpty
? ListView.builder(
itemCount: model.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList.length,
itemBuilder: (BuildContext context, int index) {
return model.getAllSharedRecordsByStatusResponse.getAllSharedRecordsByStatusList[index].status == 3
? Container(
margin: EdgeInsets.all(10.0),
child: Card(
margin: EdgeInsets.fromLTRB(
8.0, 16.0, 8.0, 8.0),
color: Colors.white,
shape: RoundedRectangleBorder(
borderRadius:
BorderRadius.circular(10),
),
child: Container(
width:
MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10.0),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
flex: 3,
child: Container(
margin: EdgeInsets.only(
top: 2.0,
left: 10.0,
right: 20.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: <Widget>[
Texts(
model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.patientName,
fontSize: 14,
color: Colors.black,
fontWeight:
FontWeight.w500,
),
SizedBox(
height: 8,
),
Texts(
TranslationBase.of(
context)
.fileno +
": " +
model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList[
index]
.patientID
.toString(),
fontSize: 14,
color: Colors.black,
fontWeight:
FontWeight.w500,
)
],
),
),
),
if (false)
Expanded(
flex: 2,
child: Container(
margin:
EdgeInsets.only(top: 2.0),
child: Column(
children: <Widget>[
Container(
child: SecondaryButton(
label: TranslationBase
.of(context)
.fetchData,
small: true,
textColor:
Colors.white,
onTap: () {
getDetails(
model);
},
),
),
],
),
),
)
],
),
),
),
)
: Container();
})
: Container(
height: 80,
margin: EdgeInsets.all(10.0),
child: Column(
children: [
SizedBox(height: 65,),
Container(
color: Colors.white,
width: MediaQuery.of(context).size.width,
padding: EdgeInsets.all(10.0),
child: Row(
crossAxisAlignment:
CrossAxisAlignment.start,
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Expanded(
flex: 3,
child: Container(
margin: EdgeInsets.only(
top: 2.0,
left: 10.0,
right: 20.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment
.start,
children: <Widget>[
Texts(
model.user.firstName+" "+model.user.lastName,
fontSize: 14,
color: Colors.black,
fontWeight:
FontWeight.w500,
),
SizedBox(
height: 8,
),
Texts(
TranslationBase.of(
context)
.fileno +
": " +
model.user.patientID.toString(),
fontSize: 14,
color: Colors.black,
fontWeight:
FontWeight.w500,
)
],
),
),
),
if (false)
Expanded(
flex: 2,
child: Container(
margin:
EdgeInsets.only(top: 2.0),
child: Column(
children: <Widget>[
Container(
child: SecondaryButton(
label: TranslationBase
.of(context)
.fetchData,
small: true,
textColor:
Colors.white,
onTap: () {
getDetails(
model);
},
),
),
],
),
),
)
],
),
),
],
),
),
),
InsurancePage(model:model),
Container(
child: ListView.builder(
itemCount: model.insuranceUpdate == null
@ -407,12 +228,5 @@ class _InsuranceUpdateState extends State<InsuranceUpdate>
);
}
getDetails(data) {
GifLoaderDialogUtils.showMyDialog(context);
_insuranceCardService.getInsuranceDetails(data).then((value) => {
GifLoaderDialogUtils.hideDialog(context),
Navigator.push(context,
FadePage(page: InsuranceCardDetails(data: value[0]['CheckList'])))
});
}
}

File diff suppressed because it is too large Load Diff

@ -1,6 +1,4 @@
import 'dart:convert';
import 'dart:io';
import 'dart:typed_data';
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
@ -17,6 +15,8 @@ import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/livecare/incoming_call.dart';
import 'package:diplomaticquarterapp/pages/medical/medical_profile_page.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/services/family_files/family_files_provider.dart'
as family;
import 'package:diplomaticquarterapp/services/robo_search/event_provider.dart';
import 'package:diplomaticquarterapp/uitl/CalendarUtils.dart';
import 'package:diplomaticquarterapp/uitl/HMGNetworkConnectivity.dart';
@ -24,6 +24,7 @@ import 'package:diplomaticquarterapp/uitl/HMG_Geofence.dart';
import 'package:diplomaticquarterapp/uitl/LocalNotification.dart';
import 'package:diplomaticquarterapp/uitl/PlatformBridge.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/bottom_navigation/bottom_nav_bar.dart';
import 'package:diplomaticquarterapp/widgets/buttons/floatingActionButton.dart';
@ -36,7 +37,7 @@ import 'package:flutter/material.dart';
import 'package:flutter_local_notifications/flutter_local_notifications.dart';
import 'package:permission_handler/permission_handler.dart';
import 'package:provider/provider.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import '../../locator.dart';
import '../../routes.dart';
import 'home_page.dart';
@ -57,23 +58,30 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
PageController pageController;
ProjectViewModel projectViewModel;
var notificationCount = '';
var themeNotifier;
///inject the user data
AuthenticatedUserObject authenticatedUserObject = locator<AuthenticatedUserObject>();
AuthenticatedUserObject authenticatedUserObject = locator<
AuthenticatedUserObject>();
final FirebaseMessaging _firebaseMessaging = FirebaseMessaging();
final authService = new AuthProvider();
var event = RobotProvider();
var familyFileProvider = family.FamilyFilesProvider();
void _requestIOSPermissions() {
flutterLocalNotificationsPlugin.resolvePlatformSpecificImplementation<IOSFlutterLocalNotificationsPlugin>()?.requestPermissions(
alert: true,
badge: true,
sound: true,
);
flutterLocalNotificationsPlugin
.resolvePlatformSpecificImplementation<
IOSFlutterLocalNotificationsPlugin>()
?.requestPermissions(
alert: true,
badge: true,
sound: true,
);
}
bool isPageNavigated = false;
LocationUtils locationUtils;
_changeCurrentTab(int tab) {
setState(() {
@ -101,7 +109,13 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
if (LandingPage.isOpenCallPage) {
if (!isPageNavigated) {
isPageNavigated = true;
Navigator.push(context, MaterialPageRoute(builder: (context) => IncomingCall(incomingCallData: LandingPage.incomingCallData))).then((value) {
Navigator.push(
context,
MaterialPageRoute(
builder: (context) =>
IncomingCall(
incomingCallData: LandingPage.incomingCallData)))
.then((value) {
isPageNavigated = false;
});
}
@ -127,7 +141,6 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
@override
void initState() {
super.initState();
WidgetsBinding.instance.addObserver(this);
//setState(() {
AppGlobal.context = context;
@ -139,7 +152,10 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
// HMG (Guest/Internet) Wifi Access [Zohaib Kambrani]
HMGNetworkConnectivity(context, () {
GifLoaderDialogUtils.showMyDialog(context);
PlatformBridge().connectHMGGuestWifi().then((value) => {GifLoaderDialogUtils.hideDialog(context)});
PlatformBridge().connectHMGGuestWifi().then((value) =>
{
GifLoaderDialogUtils.hideDialog(context)
});
}).checkAndConnectIfNoInternet();
if (Platform.isIOS) {
@ -157,14 +173,15 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
}
});
if (results[Permission.location].isGranted) ;
if (results[Permission.storage].isGranted) ;
if (results[Permission.camera].isGranted) ;
if (results[Permission.photos].isGranted) ;
if (results[Permission.accessMediaLocation].isGranted) ;
if (results[Permission.calendar].isGranted) ;
if (results[Permission.location].isGranted);
if (results[Permission.storage].isGranted);
if (results[Permission.camera].isGranted);
if (results[Permission.photos].isGranted);
if (results[Permission.accessMediaLocation].isGranted);
if (results[Permission.calendar].isGranted);
});
requestPermissions();
// });
//
// //_firebase Background message handler
// _firebaseMessaging.configure(
@ -285,7 +302,16 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
showDialogs(String message) {
ConfirmDialog dialog = new ConfirmDialog(
context: context, confirmMessage: message, okText: TranslationBase.of(context).confirm, cancelText: TranslationBase.of(context).cancel_nocaps, okFunction: () => {}, cancelFunction: () => {});
context: context,
confirmMessage: message,
okText: TranslationBase
.of(context)
.confirm,
cancelText: TranslationBase
.of(context)
.cancel_nocaps,
okFunction: () => {},
cancelFunction: () => {});
dialog.showAlertDialog(context);
}
@ -309,6 +335,168 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
return permissionResults;
}
setTheme() async {
//
// defaultTheme =
// ThemeData(
// fontFamily:projectViewModel.isArabic ? 'Cairo' : 'WorkSans',
// primarySwatch: Colors.blue,
// visualDensity: VisualDensity.adaptivePlatformDensity,
// brightness: Brightness.light,
// pageTransitionsTheme: const PageTransitionsTheme(
// builders: {
// TargetPlatform.android: ZoomPageTransitionsBuilder(),
// TargetPlatform.iOS: CupertinoPageTransitionsBuilder(),
// },
// ),
// hintColor: Colors.grey[400],
// disabledColor: Colors.grey[300],
// errorColor: Color.fromRGBO(235, 80, 60, 1.0),
// scaffoldBackgroundColor: Color(0xffEEEEEE),
// textSelectionColor: Color.fromRGBO(80, 100, 253, 0.5),
// textSelectionHandleColor: Colors.grey,
// canvasColor: Colors.white,
// backgroundColor: Colors.white,
// highlightColor: Colors.grey[100].withOpacity(0.4),
// splashColor: Colors.transparent,
// primaryColor: Color(0xff40ACC9),
// bottomSheetTheme: BottomSheetThemeData(backgroundColor: Color(0xffE0E0E0)),
// cursorColor: Colors.grey,
// cardColor: Colors.white,
// iconTheme: IconThemeData(),
// appBarTheme: AppBarTheme(
// color: Color(0xff40ACC9),
// brightness: Brightness.dark,
// elevation: 10.0,
// actionsIconTheme: IconThemeData(
// color: Color(0xff40ACC9),
// ),
// ),
// );
// themeNotifier.setTheme(defaultTheme);
}
void checkUserStatus(token, {isLoader = true}) async {
if (isLoader)
//GifLoaderDialogUtils.showMyDialog(context);
authService
.selectDeviceImei(token)
.then((SelectDeviceIMEIRES value) => setUserValues(value))
.catchError((err) {
//GifLoaderDialogUtils.hideDialog(context);
});
}
static Future<dynamic> myBackgroundMessageHandler(
Map<String, dynamic> message) async {
Map<String, dynamic> myMap = new Map<String, dynamic>.from(message['data']);
if (message.containsKey('data')) {
print("myBackgroundMessageHandler Inside");
LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
print(LandingPage.incomingCallData.doctorname);
LandingPage.isOpenCallPage = true;
}
if (message.containsKey('notification')) {
final dynamic notification = message['notification'];
print(notification);
}
}
void setUserValues(value) async {
if (value != null) sharedPref.setObject(IMEI_USER_DATA, value);
}
Future<dynamic> getUserInformation() async {
var userInfoJson = sharedPref.getObject(IMEI_USER_DATA);
return userInfoJson;
}
checkValue(projectProvider) {
if (projectProvider.searchValue != null) {
_changeCurrentTab(2);
}
}
registerGeofences() async {
await locator<GeofencingServices>().getAllGeoZones(GeoZonesRequestModel());
void doIt() {
getUserInformation().then((value) {
if (value != null) projectViewModel.platformBridge()
.registerHmgGeofences();
});
}
if (await Permission.location.isGranted) {
doIt();
} else {
[Permission.location].request().then((value) async {
if (await Permission.location.isGranted) {
doIt();
}
});
}
requestPermissions().then((results) {});
}
login() async {
var data = await sharedPref.getObject(IMEI_USER_DATA);
sharedPref.remove(REGISTER_DATA_FOR_LOGIIN);
if (data != null) {
Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else {
GifLoaderDialogUtils.showMyDialog(context);
authService
.selectDeviceImei(DEVICE_TOKEN)
.then((SelectDeviceIMEIRES value) {
GifLoaderDialogUtils.hideDialog(context);
if (value != null) {
setUserValues(value);
Navigator.of(context).pushNamed(CONFIRM_LOGIN);
} else {
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
});
}
}
getNotificationCount(token) async {
if (await sharedPref.getObject(USER_PROFILE) != null) {
var data =
AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
if (data != null) {
authService
.registeredAuthenticatedUser(data, token, 0, 0)
.then((res) => {print(res)});
authService.getDashboard().then((value) =>
{
setState(() {
notificationCount = value['List_PatientDashboard'][0]
['UnreadPatientNotificationCount'] >
99
? '99+'
: value['List_PatientDashboard'][0]
['UnreadPatientNotificationCount']
.toString();
sharedPref.setString(NOTIFICATION_COUNT, notificationCount);
})
});
familyFileProvider.getSharedRecordByStatus();
}
}
}
@override
Widget build(BuildContext context) {
projectViewModel = Provider.of(context);
@ -317,11 +505,15 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
appBar: AppBar(
elevation: 0,
textTheme: TextTheme(
headline6: TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
headline6: TextStyle(
color: Colors.white, fontWeight: FontWeight.bold),
),
title: Text(
getText(currentTab).toUpperCase(),
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.white, fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'),
style: TextStyle(
fontWeight: FontWeight.bold,
color: Colors.white,
fontFamily: projectViewModel.isArabic ? 'Cairo' : 'WorkSans'),
// bold: true,
// color: Colors.white,
),
@ -336,28 +528,28 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
),
notificationCount != ''
? new Positioned(
right: projectViewModel.isArabic ? 35 : 0,
top: 5,
child: new Container(
padding: EdgeInsets.all(4),
decoration: new BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.circular(20),
),
constraints: BoxConstraints(
minWidth: 20,
minHeight: 20,
),
child: new Text(
notificationCount,
style: new TextStyle(
color: Colors.white,
fontSize: projectViewModel.isArabic ? 8 : 9,
),
textAlign: TextAlign.center,
),
),
)
right: projectViewModel.isArabic ? 35 : 0,
top: 5,
child: new Container(
padding: EdgeInsets.all(4),
decoration: new BoxDecoration(
color: Colors.red,
borderRadius: BorderRadius.circular(20),
),
constraints: BoxConstraints(
minWidth: 20,
minHeight: 20,
),
child: new Text(
notificationCount,
style: new TextStyle(
color: Colors.white,
fontSize: projectViewModel.isArabic ? 8 : 9,
),
textAlign: TextAlign.center,
),
),
)
: SizedBox()
],
);
@ -376,9 +568,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
SETTINGS,
);
else
Navigator.of(context).pushNamed(
WELCOME_LOGIN,
);
login();
}, //do something,
)
],
@ -398,7 +588,7 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
MedicalProfilePage(),
BookingOptions(),
MyFamily(isAppbarVisible: false),
ToDo(),
ToDo(isShowAppBar: false),
], // Please do not remove the BookingOptions from this array
),
bottomNavigationBar: BottomNavBar(
@ -408,10 +598,10 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
floatingActionButtonLocation: FloatingActionButtonLocation.centerDocked,
floatingActionButton: currentTab == 0
? FloatingButton(
elevation: true,
onTap: () {
_changeCurrentTab(2);
})
elevation: true,
onTap: () {
_changeCurrentTab(2);
})
: null);
}
@ -426,82 +616,15 @@ class _LandingPageState extends State<LandingPage> with WidgetsBindingObserver {
case 1:
return TranslationBase.of(context).medicalProfile;
case 2:
return TranslationBase.of(context).mySchedule;
return TranslationBase.of(context).bookAppo;
case 3:
return TranslationBase.of(context).services;
case 4:
return TranslationBase.of(context).bookAppo;
}
}
void checkUserStatus(token) async {
var result = await authService
.selectDeviceImei(token)
;
setUserValues(result);
registerGeofences();
if (await sharedPref.getObject(USER_PROFILE) != null) {
var data = AuthenticatedUser.fromJson(await sharedPref.getObject(USER_PROFILE));
if (data != null) {
authService.registeredAuthenticatedUser(data, token, 0, 0).then((res) => {print(res)});
authService.getDashboard().then((value) => {
setState(() {
notificationCount = value['List_PatientDashboard'][0]['UnreadPatientNotificationCount'].toString();
})
});
}
}
}
static Future<dynamic> myBackgroundMessageHandler(Map<String, dynamic> message) async {
Map<String, dynamic> myMap = new Map<String, dynamic>.from(message['data']);
if (message.containsKey('data')) {
print("myBackgroundMessageHandler Inside");
LandingPage.incomingCallData = IncomingCallData.fromJson(myMap);
print(LandingPage.incomingCallData.doctorname);
LandingPage.isOpenCallPage = true;
}
if (message.containsKey('notification')) {
final dynamic notification = message['notification'];
print(notification);
}
}
void setUserValues(value) async {
if (value != null) sharedPref.setObject(IMEI_USER_DATA, value);
}
Future<dynamic> getUserInformation() async {
var userInfoJson = sharedPref.getObject(IMEI_USER_DATA);
return userInfoJson;
}
checkValue(projectProvider) {
if (projectProvider.searchValue != null) {
_changeCurrentTab(2);
return TranslationBase
.of(context)
.bookAppo;
}
}
}
registerGeofences() async {
await locator<GeofencingServices>().getAllGeoZones(GeoZonesRequestModel());
void doIt() {
getUserInformation().then((value) {
if (value != null) projectViewModel.platformBridge().registerHmgGeofences();
});
}
if (await Permission.location.isGranted) {
doIt();
} else {
[Permission.location].request().then((value) async {
if (await Permission.location.isGranted) {
doIt();
}
});
}
requestPermissions().then((results) {});
}
}

@ -103,127 +103,132 @@ class _ConfirmLogin extends State<ConfirmLogin> {
width: SizeConfig.realScreenWidth,
child: Column(
children: <Widget>[
Expanded(
flex: 3,
child: user != null && isMoreOption == false
? Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Image.asset(
'assets/images/DQ/dq_logo_icon.png',
height: 90,
width: 90,
),
AppText(
TranslationBase.of(context).welcomeBack +
' ' +
user.name,
fontSize: SizeConfig.textMultiplier * 3.5,
),
AppText(
TranslationBase.of(context).accountInfo,
fontSize: SizeConfig.textMultiplier * 2.5,
),
Card(
color: Colors.grey[300],
child: Row(
children: <Widget>[
Expanded(
child: ListTile(
title: Text(
TranslationBase.of(context).lastLoginAt,
textAlign: TextAlign.center,
),
subtitle: Text(
user.editedOn != null
user != null && isMoreOption == false
? Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Image.asset(
'assets/images/DQ/dq_logo_icon.png',
height: 90,
width: 90,
),
AppText(
TranslationBase.of(context).welcomeBack +
' ' +
user.name,
fontSize: SizeConfig.textMultiplier * 3.5,
),
SizedBox(
height: 20,
),
AppText(
TranslationBase.of(context).accountInfo,
fontSize: SizeConfig.textMultiplier * 2.5,
),
SizedBox(
height: 20,
),
Card(
color: Colors.grey[300],
child: Row(
children: <Widget>[
Flexible(
child: ListTile(
title: Text(
TranslationBase.of(context).lastLoginAt,
textAlign: TextAlign.center,
overflow: TextOverflow.ellipsis,
),
subtitle: Text(
user.editedOn != null
? formatDate(
DateUtil.convertStringToDate(
user.editedOn))
: user.createdOn != null
? formatDate(
DateUtil.convertStringToDate(
user.editedOn))
user.createdOn))
: '--',
textAlign: TextAlign.center),
)),
Expanded(
child: ListTile(
title: Text(
TranslationBase.of(context)
.lastLoginWith,
textAlign: TextAlign.center),
subtitle: Text(
getType(user.logInType, context),
textAlign: TextAlign.center),
))
],
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center),
)),
Flexible(
child: ListTile(
title: Text(
TranslationBase.of(context).lastLoginWith,
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center),
subtitle: Text(
getType(user.logInType, context),
overflow: TextOverflow.ellipsis,
textAlign: TextAlign.center),
))
],
)
: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Image.asset(
'assets/images/DQ/dq_logo_icon.png',
height: 90,
width: 90,
),
this.onlySMSBox == false
? AppText(
TranslationBase.of(context)
.verifyLoginWith,
fontSize: SizeConfig.textMultiplier * 3.5,
textAlign: TextAlign.left,
)
: AppText(
TranslationBase.of(context)
.verifyFingerprint2,
fontSize: SizeConfig.textMultiplier * 2.5,
textAlign: TextAlign.start,
),
])),
],
)),
],
)
: Column(
mainAxisAlignment: MainAxisAlignment.spaceEvenly,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Image.asset(
'assets/images/DQ/dq_logo_icon.png',
height: 90,
width: 90,
),
this.onlySMSBox == false
? AppText(
TranslationBase.of(context).verifyLoginWith,
fontSize: SizeConfig.textMultiplier * 3.5,
textAlign: TextAlign.left,
)
: AppText(
TranslationBase.of(context)
.verifyFingerprint2,
fontSize: SizeConfig.textMultiplier * 2.5,
textAlign: TextAlign.start,
),
]),
user != null && isMoreOption == false
? Expanded(
flex: 2,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(
child: InkWell(
onTap: () => {
authenticateUser(
3, BiometricType.face.index)
},
child: getButton(user.logInType))),
Expanded(child: getButton(5))
])
]))
: Expanded(
flex: 4,
child: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
onlySMSBox == false
? Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(child: getButton(3)),
Expanded(child: getButton(2))
],
)
: SizedBox(),
Row(
? Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(child: getButton(1)),
Expanded(child: getButton(4))
],
),
]),
),
Expanded(
child: InkWell(
onTap: () => {
authenticateUser(
3, BiometricType.face.index)
},
child: getButton(user.logInType))),
Expanded(child: getButton(5))
])
])
: Column(
mainAxisAlignment: MainAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
onlySMSBox == false
? Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(child: getButton(3)),
Expanded(child: getButton(2))
],
)
: SizedBox(),
Row(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Expanded(child: getButton(1)),
Expanded(child: getButton(4))
],
),
]),
Expanded(
flex: 1,
child: Column(
@ -360,8 +365,11 @@ class _ConfirmLogin extends State<ConfirmLogin> {
context,
type,
this.mobileNumber,
(value) => {this.checkActivationCode(value: value)},
(value) {
this.checkActivationCode(value: value);
},
() => {
Navigator.pop(context),
print('Faild..'),
},
).displayDialog(context);
@ -502,7 +510,8 @@ class _ConfirmLogin extends State<ConfirmLogin> {
.then((result) => {
if (result is Map)
{
result = CheckActivationCode.fromJson(result),
projectViewModel.setPrivilege(privilegeList: result),
result = CheckActivationCode.fromJson(result),
if (this.registerd_data != null &&
this.registerd_data.isRegister == true)
{
@ -537,6 +546,9 @@ class _ConfirmLogin extends State<ConfirmLogin> {
.catchError((err) {
print(err);
GifLoaderDialogUtils.hideDialog(context);
Future.delayed(Duration(seconds: 1), () {
AppToast.showErrorToast(message: err);
});
});
}
@ -570,10 +582,14 @@ class _ConfirmLogin extends State<ConfirmLogin> {
});
}
goToHome() {
goToHome() async {
await authenticatedUserObject.getUser(getUser: true);
authenticatedUserObject.isLogin = true;
appointmentRateViewModel.isLogin = true;
projectViewModel.isLogin = true;
projectViewModel.user = authenticatedUserObject.user;
Provider.of<ProjectViewModel>(context, listen: false)
.setUser(authenticatedUserObject.user);
getToDoCount();
appointmentRateViewModel
.getIsLastAppointmentRatedList()
@ -618,10 +634,11 @@ class _ConfirmLogin extends State<ConfirmLogin> {
return InkWell(
onTap: () => {authenticateUser(4, true)},
child: RoundedContainer(
height: 140,
borderColor: Colors.grey,
showBorder: true,
child: Padding(
padding: EdgeInsets.fromLTRB(25, 10, 25, 10),
padding: EdgeInsets.fromLTRB(5, 15, 5, 15),
child: Column(
children: <Widget>[
Image.asset(
@ -644,10 +661,11 @@ class _ConfirmLogin extends State<ConfirmLogin> {
return InkWell(
onTap: () => {authenticateUser(1, true)},
child: RoundedContainer(
height: 140,
borderColor: Colors.grey,
showBorder: true,
child: Padding(
padding: EdgeInsets.fromLTRB(20, 10, 20, 10),
padding: EdgeInsets.fromLTRB(5, 15, 5, 15),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
@ -656,12 +674,19 @@ class _ConfirmLogin extends State<ConfirmLogin> {
height: SizeConfig.imageSizeMultiplier * 13,
width: SizeConfig.imageSizeMultiplier * 16,
),
SizedBox(
height: 20,
),
projectViewModel.isArabic
? SizedBox(
height: 20,
)
: SizedBox(
height: 20,
),
AppText(
TranslationBase.of(context).verifySMS,
fontSize: SizeConfig.textMultiplier * 2,
fontSize: projectViewModel.isArabic
? SizeConfig.textMultiplier * 1.8
: SizeConfig.textMultiplier * 2,
textAlign: TextAlign.center,
)
],
),
@ -671,13 +696,14 @@ class _ConfirmLogin extends State<ConfirmLogin> {
return InkWell(
onTap: () => {authenticateUser(2, BiometricType.fingerprint.index)},
child: RoundedContainer(
height: 140,
backgroundColor: BiometricType.fingerprint.index == 1
? Colors.white
: Colors.white.withOpacity(.7),
borderColor: Colors.grey,
showBorder: true,
child: Padding(
padding: EdgeInsets.fromLTRB(25, 10, 25, 10),
padding: EdgeInsets.fromLTRB(5, 15, 5, 15),
child: Column(
children: <Widget>[
Image.asset(
@ -700,13 +726,14 @@ class _ConfirmLogin extends State<ConfirmLogin> {
return InkWell(
onTap: () => {authenticateUser(3, BiometricType.face.index)},
child: RoundedContainer(
height: 140,
backgroundColor: checkIfBiometricAvailable(BiometricType.face)
? Colors.white
: Colors.white.withOpacity(.7),
borderColor: Colors.grey,
showBorder: true,
child: Padding(
padding: EdgeInsets.fromLTRB(20, 10, 20, 10),
padding: EdgeInsets.fromLTRB(5, 15, 5, 15),
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
@ -735,13 +762,14 @@ class _ConfirmLogin extends State<ConfirmLogin> {
})
},
child: RoundedContainer(
height: 140,
backgroundColor: BiometricType.fingerprint.index == 1
? Colors.white
: Colors.white.withOpacity(.7),
borderColor: Colors.grey,
showBorder: true,
child: Padding(
padding: EdgeInsets.fromLTRB(0, 0, 0, 5),
padding: EdgeInsets.fromLTRB(5, 15, 5, 15),
child: Column(
children: <Widget>[
Image.asset(
@ -749,9 +777,13 @@ class _ConfirmLogin extends State<ConfirmLogin> {
height: SizeConfig.imageSizeMultiplier * 13,
width: SizeConfig.imageSizeMultiplier * 16,
),
SizedBox(
height: 20,
),
projectViewModel.isArabic
? SizedBox(
height: 15,
)
: SizedBox(
height: 10,
),
AppText(
TranslationBase.of(context).moreVerification,
fontSize: SizeConfig.textMultiplier * 2,

@ -97,6 +97,7 @@ class _Login extends State<Login> {
textDirection: TextDirection.ltr,
child: Container(
child: TextFields(
keyboardType: TextInputType.number,
fontWeight: FontWeight.normal,
controller: nationalIDorFile,
onChanged: (value) => {validateForm()},
@ -123,7 +124,9 @@ class _Login extends State<Login> {
color: Colors.grey,
height: 2,
),
SizedBox(height: 10,),
SizedBox(
height: 10,
),
Row(
children: <Widget>[
Expanded(
@ -236,11 +239,11 @@ class _Login extends State<Login> {
request['PatientID'] = int.parse(nationalIDorFile.text);
}
// request.isRegister = false;
this.authService.checkActivationCode(request, code).then((result) async{
sharedPref.remove(FAMILY_FILE);
// Register GeoZones after login
this.authService.checkActivationCode(request, code).then((result) async {
sharedPref.remove(FAMILY_FILE);
// Register GeoZones after login
registerGeoZones();
projectViewModel.setPrivilege(privilegeList: result);
result = CheckActivationCode.fromJson(result);
result.list.isFamily = false;
// this.sharedPref.setString(BLOOD_TYPE, result['PatientBloodType']),

@ -72,112 +72,113 @@ class _Register extends State<Register> {
onNumberChange: (value) =>
{mobileNo = value, validateForm()},
onCountryChange: (value) => countryCode = value),
Container(
child: TextFields(
controller: nationalIDorFile,
onChanged: (value) => validateForm(),
prefixIcon:
Icon(Icons.chrome_reader_mode, color: Color(0xFF40ACC9)),
padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10),
hintText: TranslationBase.of(context).nationalID,
)),
Row(
Container(
child: TextFields(
controller: nationalIDorFile,
onChanged: (value) => validateForm(),
keyboardType: TextInputType.number,
prefixIcon: Icon(Icons.chrome_reader_mode,
color: Color(0xFF40ACC9)),
padding: EdgeInsets.only(
top: 20, bottom: 20, left: 10, right: 10),
hintText: TranslationBase.of(context).nationalID,
)),
Row(
children: <Widget>[
Expanded(
child: Row(
children: <Widget>[
Expanded(
child: Row(
children: <Widget>[
Radio(
value: 1,
groupValue: isHijri,
onChanged: (value) {
setState(() {
isHijri = value;
});
validateForm();
},
),
Text(TranslationBase.of(context).hijriDate),
],
),
Radio(
value: 1,
groupValue: isHijri,
onChanged: (value) {
setState(() {
isHijri = value;
});
validateForm();
},
),
Expanded(
child: Row(
children: <Widget>[
Radio(
value: 0,
groupValue: isHijri,
onChanged: (value) {
setState(() {
isHijri = value;
});
validateForm();
},
),
Text(TranslationBase.of(context)
.gregorianDate),
],
),
Text(TranslationBase.of(context).hijriDate),
],
),
),
Expanded(
child: Row(
children: <Widget>[
Radio(
value: 0,
groupValue: isHijri,
onChanged: (value) {
setState(() {
isHijri = value;
});
validateForm();
},
),
Text(TranslationBase.of(context).gregorianDate),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Container(
),
],
),
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Container(
width: SizeConfig.realScreenWidth * .9,
height:60,
child: isHijri == 1
? TextFields(
onChanged: (value) => {dob = value},
hintText: 'DD/MM/YYYY',
prefixIcon: Icon(Icons.date_range),
)
: RaisedButton.icon(
shape: RoundedRectangleBorder(
height: 60,
child: isHijri == 1
? TextFields(
onChanged: (value) => {dob = value},
hintText: 'DD/MM/YYYY',
prefixIcon: Icon(Icons.date_range),
)
: RaisedButton.icon(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(15.0),
),
color:Colors.white,
onPressed: () => {
if (isHijri != null)
_selectDate(context)
},
icon: Icon(Icons.date_range),
label: Text(selectedDate != null
? "${selectedDate.toLocal()}"
.split(' ')[0]
: TranslationBase.of(context).dob)))
])
),
color: Colors.white,
onPressed: () => {
if (isHijri != null)
_selectDate(context)
},
icon: Icon(Icons.date_range),
label: Text(selectedDate != null
? "${selectedDate.toLocal()}"
.split(' ')[0]
: TranslationBase.of(context).dob)))
])
],
),
),
Expanded(
flex: 2,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Divider(
color: Colors.grey,
height: 2,
),
SizedBox(
height: 10,
),
Row(
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).registerNow,
() => {startRegistration()},
textColor: Colors.white,
color: isButtonDisabled == true
? Colors.grey
: Colors.grey[900]))
],
),
),
Expanded(
flex: 2,
child: Column(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
Divider(
color: Colors.grey,
height: 2,
),
SizedBox(height: 10,),
Row(
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).registerNow,
() => {startRegistration()},
textColor: Colors.white,
color: isButtonDisabled == true
? Colors.grey
: Colors.grey[900]))
],
),
],
))
]),
)));
],
))
]),
)));
}
Future<Null> _selectDate(BuildContext context) async {
@ -215,7 +216,8 @@ class _Register extends State<Register> {
this
.authService
.checkPatientForRegisteration(request)
.then((response) => {checkUserStatus(response, request)}).catchError((err) {
.then((response) => {checkUserStatus(response, request)})
.catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
ConfirmDialog dialog = new ConfirmDialog(
context: context,
@ -223,15 +225,13 @@ class _Register extends State<Register> {
okText: TranslationBase.of(context).confirm,
cancelText: TranslationBase.of(context).cancel_nocaps,
okFunction: () => {
ConfirmDialog.closeAlertDialog(context),
Navigator.of(context).pushNamed(
REGISTER,
),
},
ConfirmDialog.closeAlertDialog(context),
Navigator.of(context).pushNamed(
REGISTER,
),
},
cancelFunction: () => {ConfirmDialog.closeAlertDialog(context)});
dialog.showAlertDialog(context);
});
}
@ -256,7 +256,7 @@ class _Register extends State<Register> {
var nRequest = request.toJson();
nRequest['LogInTokenID'] = response['LogInTokenID'];
if (response['hasFile'] == true) {
// AppToast.showErrorToast(message: response['ErrorEndUserMessage']);
// AppToast.showErrorToast(message: response['ErrorEndUserMessage']);
AlertDialogBox(
context: context,
confirmMessage: response['ErrorEndUserMessage'],
@ -298,7 +298,7 @@ class _Register extends State<Register> {
// DOB: this.dateOption === '1' ? this.dateOfBirth : moment(this.dateOfBirth).format('DD/MM/YYYY'),
// IsHijri: Number(this.dateOption)
// }
showLoader(true);
GifLoaderDialogUtils.showMyDialog(context);
var request = CheckUserStatusRequest();
request.patientIdentificationID = nationalIDorFile.text;
request.dOB = isHijri == 1
@ -307,7 +307,7 @@ class _Register extends State<Register> {
request.isHijri = isHijri;
request.patientOutSA = countryCode == '966' ? 0 : 1;
this.authService.checkUserStatus(request).then((result) => {
showLoader(false),
GifLoaderDialogUtils.hideDialog(context),
if (result is Map)
{
result = CheckUserStatusResponse.fromJson(result),

@ -1,3 +1,4 @@
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/AllergiesViewModel.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -7,8 +8,10 @@ import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
class AllergiesPage extends StatelessWidget {
List<ImagesInfo> imagesInfo = List();
@override
Widget build(BuildContext context) {
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/alllergies/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/alllergies/ar/0.png'));
return BaseView<AllergiesViewModel>(
onModelReady: (model) => model.getAllergies(),
builder: (_, model, w) => AppScaffold(
@ -16,6 +19,7 @@ class AllergiesPage extends StatelessWidget {
appBarTitle: TranslationBase.of(context).allergies,
baseViewModel: model,
description: TranslationBase.of(context).infoAllergies,
imagesInfo: imagesInfo,
body: ListView.builder(
itemCount: model.allergies.length,
itemBuilder: (context, index) => Container(

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/model/hospitals/hospitals_model.dart';
import 'package:diplomaticquarterapp/core/model/my_balance/patient_info.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_balance_view_model.dart';
@ -10,6 +11,7 @@ import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/dialogs/SelectHospitalDialog.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
@ -29,7 +31,6 @@ import 'new_text_Field.dart';
enum BeneficiaryType { MyAccount, MyFamilyFiles, OtherAccount, NON }
class AdvancePaymentPage extends StatefulWidget {
@override
_AdvancePaymentPageState createState() => _AdvancePaymentPageState();
@ -50,10 +51,17 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
AppSharedPreferences sharedPref = AppSharedPreferences();
AuthenticatedUser authUser;
List<ImagesInfo> imagesInfo = List();
@override
void initState() {
super.initState();
getAuthUser();
imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileAppDq/images-info-home/advance-payment/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileAppDq/images-info-home/advance-payment/ar/0.png'));
}
@override
@ -62,7 +70,9 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
onModelReady: (model) => model.getHospitals(),
builder: (_, model, w) => AppScaffold(
isShowAppBar: true,
imagesInfo: imagesInfo,
appBarTitle: TranslationBase.of(context).advancePayment,
description: TranslationBase.of(context).infoAdvancePayment,
body: SingleChildScrollView(
physics: ScrollPhysics(),
child: Container(
@ -102,13 +112,13 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
if (beneficiaryType == BeneficiaryType.MyFamilyFiles)
InkWell(
onTap: () {
GifLoaderDialogUtils.showMyDialog(context);
model.getFamilyFiles().then((value) {
GifLoaderDialogUtils.hideDialog(context);
confirmSelectFamilyDialog(model
.getAllSharedRecordsByStatusResponse
.getAllSharedRecordsByStatusList);
}).showProgressBar(
text: "Loading",
backgroundColor: Colors.blue.withOpacity(0.6));
});
},
child: Container(
padding: EdgeInsets.all(12),
@ -140,17 +150,16 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
if (beneficiaryType == BeneficiaryType.OtherAccount)
InkWell(
onTap: () {
if (_fileTextController.text.isNotEmpty)
if (_fileTextController.text.isNotEmpty) {
GifLoaderDialogUtils.showMyDialog(context);
model
.getPatientInfoByPatientID(
id: _fileTextController.text)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
confirmSelectPatientDialog(model.patientInfoList);
}).showProgressBar(
text: "Loading",
backgroundColor:
Colors.blue.withOpacity(0.6));
else
});
} else
AppToast.showErrorToast(
message: 'Please Enter The File Number');
},
@ -206,6 +215,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
SizedBox(
height: 12,
),
if(model.user!=null)
NewTextFields(
hintText: TranslationBase.of(context).depositorEmail,
initialValue: model.user.emailAddress,
@ -228,7 +238,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
),
),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.1,
height: MediaQuery.of(context).size.height * 0.13,
width: double.infinity,
padding: EdgeInsets.all(12),
child: SecondaryButton(
@ -238,13 +248,36 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
_fileTextController.text.isEmpty ||
_selectedHospital == null,
onTap: () {
var mobileNum;
var patientName;
if (beneficiaryType == BeneficiaryType.MyFamilyFiles) {
mobileNum = selectedPatientFamily.mobileNumber;
patientName = selectedPatientFamily.patientName;
}
if (beneficiaryType == BeneficiaryType.MyAccount) {
mobileNum = model.user.mobileNumber;
patientName = model.user.firstName;
}
if (beneficiaryType == BeneficiaryType.OtherAccount) {
mobileNum = _selectedPatientInfo.mobileNumber;
patientName = _selectedPatientInfo.fullName;
}
advanceModel.fileNumber = _fileTextController.text;
advanceModel.hospitalsModel = _selectedHospital;
advanceModel.note = _notesTextController.text;
advanceModel.email = email ?? model.user.emailAddress;
advanceModel.amount = amount;
model.getPatientInfoByPatientIDAndMobileNumber().then((value) {
advanceModel.mobileNumber = mobileNum;
advanceModel.patientName = patientName;
GifLoaderDialogUtils.showMyDialog(context);
model
.getPatientInfoByPatientIDAndMobileNumber(advanceModel)
.then((value) {
GifLoaderDialogUtils.hideDialog(context);
if (model.state != ViewState.Error &&
model.state != ViewState.ErrorLocal) {
Utils.hideKeyboard(context);
@ -268,9 +301,7 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
},
);
}
}).showProgressBar(
text: "Loading",
backgroundColor: Colors.blue.withOpacity(0.6));
});
},
),
)),
@ -331,22 +362,22 @@ class _AdvancePaymentPageState extends State<AdvancePaymentPage> {
void confirmSelectFamilyDialog(
List<GetAllSharedRecordsByStatusList> getAllSharedRecordsByStatusList) {
if(getAllSharedRecordsByStatusList.isNotEmpty)
showDialog(
context: context,
child: SelectPatientFamilyDialog(
getAllSharedRecordsByStatusList: getAllSharedRecordsByStatusList,
selectedPatientFamily: selectedPatientFamily,
onValueSelected: (value) {
setState(() {
selectedPatientFamily = value;
_fileTextController.text =
selectedPatientFamily.patientID.toString();
advanceModel.depositorName = value.patientName;
});
},
),
);
if (getAllSharedRecordsByStatusList.isNotEmpty)
showDialog(
context: context,
child: SelectPatientFamilyDialog(
getAllSharedRecordsByStatusList: getAllSharedRecordsByStatusList,
selectedPatientFamily: selectedPatientFamily,
onValueSelected: (value) {
setState(() {
selectedPatientFamily = value;
_fileTextController.text =
selectedPatientFamily.responseID.toString();
advanceModel.depositorName = value.patientName;
});
},
),
);
}
String getBeneficiaryType() {

@ -156,11 +156,12 @@ class ConfirmPaymentPage extends StatelessWidget {
),
),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.1,
height: MediaQuery.of(context).size.height * 0.13,
width: double.infinity,
padding: EdgeInsets.all(12),
child: SecondaryButton(
textColor: Colors.white,
color: Theme.of(context).primaryColor,
label: TranslationBase.of(context).confirm.toUpperCase(),
disabled: model.state == ViewState.Busy,
onTap: () {

@ -175,7 +175,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
fontSize: SizeConfig.textMultiplier * 3,
),
focusNode: focusD1,
maxLength: 1,
//maxLength: 1,
controller: digit1,
textAlign: TextAlign.center,
keyboardType: TextInputType.number,
@ -200,7 +200,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
focusNode: focusD2,
controller: digit2,
textInputAction: TextInputAction.next,
maxLength: 1,
//maxLength: 1,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: SizeConfig.textMultiplier * 3,
@ -227,7 +227,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
focusNode: focusD3,
controller: digit3,
textInputAction: TextInputAction.next,
maxLength: 1,
//maxLength: 1,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: SizeConfig.textMultiplier * 3,
@ -253,7 +253,7 @@ class _ConfirmSMSDialogState extends State<ConfirmSMSDialog> {
child: TextFormField(
focusNode: focusD4,
controller: digit4,
maxLength: 1,
// maxLength: 1,
textAlign: TextAlign.center,
style: TextStyle(
fontSize: SizeConfig.textMultiplier * 3,

@ -18,7 +18,7 @@ class MyBalancePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/images-info-home/my-balance/ar/0.png'));
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileAppDq/images-info-home/my-balance/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileAppDq/images-info-home/my-balance/ar/0.png'));
return BaseView<MyBalanceViewModel>(
onModelReady: (model) => model.getPatientAdvanceBalanceAmount(),
builder: (_, model, w) => AppScaffold(
@ -27,55 +27,26 @@ class MyBalancePage extends StatelessWidget {
appBarTitle: TranslationBase.of(context).myBalances,
imagesInfo: imagesInfo,
description: TranslationBase.of(context).infoMyBalance,
body: Container(
margin: EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).balanceAmount,
color: Colors.black,
bold: true,
),
SizedBox(
height: 15,
),
Container(
padding: EdgeInsets.all(8),
width: double.infinity,
height: 65,
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(7),
body: SingleChildScrollView(
child: Container(
margin: EdgeInsets.all(12),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Texts(
TranslationBase.of(context).balanceAmount,
color: Colors.black,
bold: true,
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
'${model.totalAdvanceBalanceAmount ?? 0} '+ TranslationBase.of(context).sar,
color: Colors.white,
bold: true,
),
Texts(
TranslationBase.of(context).totalBalance,
color: Colors.white,
),
],
SizedBox(
height: 15,
),
),
SizedBox(
height: 9,
),
...List.generate(
model.patientAdvanceBalanceAmountList.length,
(index) => Container(
Container(
padding: EdgeInsets.all(8),
width: double.infinity,
height: 65,
margin: EdgeInsets.only(top: 8),
decoration: BoxDecoration(
color: Colors.white,
color: Theme.of(context).primaryColor,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(7),
),
@ -84,20 +55,53 @@ class MyBalancePage extends StatelessWidget {
children: [
Texts(
'${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} '+TranslationBase.of(context).sar,
'${model.totalAdvanceBalanceAmount ?? 0} '+ TranslationBase.of(context).sar,
color: Colors.white,
bold: true,
),
Texts(model.patientAdvanceBalanceAmountList[index]
.projectDescription),
Texts(
TranslationBase.of(context).totalBalance,
color: Colors.white,
),
],
),
),
),
],
SizedBox(
height: 9,
),
...List.generate(
model.patientAdvanceBalanceAmountList.length,
(index) => Container(
padding: EdgeInsets.all(8),
height: 65,
margin: EdgeInsets.only(top: 8),
decoration: BoxDecoration(
color: Colors.white,
shape: BoxShape.rectangle,
borderRadius: BorderRadius.circular(7),
),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
Texts(
'${model.patientAdvanceBalanceAmountList[index].patientAdvanceBalanceAmount} '+TranslationBase.of(context).sar,
bold: true,
),
Texts(model.patientAdvanceBalanceAmountList[index]
.projectDescription),
],
),
),
),
SizedBox(height: MediaQuery.of(context).size.height * 0.13 ,)
],
),
),
),
bottomSheet: Container(
height: MediaQuery.of(context).size.height * 0.1,
height: MediaQuery.of(context).size.height * 0.12,
color: Colors.white,
width: double.infinity,
padding: EdgeInsets.all(12),
child: SecondaryButton(

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/enum/filter_type.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/my_doctor_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
@ -15,8 +16,11 @@ import 'package:flutter/material.dart';
import 'doctor_profile_page.dart';
class DoctorHomePage extends StatelessWidget {
List<ImagesInfo> imagesInfo = List();
@override
Widget build(BuildContext context) {
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/my-doctor/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/my-doctor/ar/0.png'));
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/my-doctor/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/my-doctor/ar/1.png'));
return BaseView<MyDoctorViewModel>(
onModelReady: (model) => model.getMyDoctor(),
builder: (context, MyDoctorViewModel model, widget) => AppScaffold(
@ -25,6 +29,7 @@ class DoctorHomePage extends StatelessWidget {
appBarTitle: TranslationBase.of(context).myDoctor,
description: TranslationBase.of(context).infoMyDoctor,
infoList: TranslationBase.of(context).infoMyDoctorPoints,
imagesInfo: imagesInfo,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: FractionallySizedBox(

@ -1,10 +1,12 @@
import 'package:diplomaticquarterapp/core/model/eye/AppoimentAllHistoryResult.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class ContactLensPage extends StatelessWidget {
final ListHISGetContactLensPerscription listHISGetContactLensPerscription;
@ -14,6 +16,7 @@ class ContactLensPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
body: SingleChildScrollView(
child: Container(
@ -82,6 +85,7 @@ class ContactLensPage extends StatelessWidget {
SizedBox(
height: 17,
),
if(projectViewModel.havePrivilege(15))
Container(
width: double.infinity,
child: SecondaryButton(

@ -21,7 +21,7 @@ class LabsHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-lab/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-lab/ar/0.png'));
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/my-lab/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/my-lab/ar/0.png'));
return BaseView<LabsViewModel>(
onModelReady: (model) => model.getLabs(),
builder: (context, LabsViewModel model, widget) => AppScaffold(
@ -97,6 +97,7 @@ class LabsHomePage extends StatelessWidget {
billNo: ' ${labOrder.invoiceNo}',
profileUrl: labOrder.doctorImageURL,
subName: labOrder.projectName,
isLiveCareAppointment: labOrder.isLiveCareAppointment,
date: projectViewModel.isArabic?DateUtil.getMonthDayYearDateFormattedAr(labOrder.orderDate):DateUtil.getMonthDayYearDateFormatted(labOrder.orderDate),
);
}).toList(),

@ -7,6 +7,9 @@ import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/MyAppointments.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_approval_screen.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_card_screen.dart';
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
import 'package:diplomaticquarterapp/pages/medical/patient_sick_leave_page.dart';
import 'package:diplomaticquarterapp/pages/medical/reports/monthly_reports.dart';
import 'package:diplomaticquarterapp/pages/medical/smart_watch_health_data/smart_watch_instructions.dart';
@ -17,6 +20,7 @@ import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details
import 'package:diplomaticquarterapp/pages/medical/reports/report_home_page.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/uitl/utils.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/medical_profile_item.dart';
import 'package:diplomaticquarterapp/widgets/data_display/medical/time_line_widget.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
@ -50,12 +54,15 @@ class MedicalProfilePage extends StatefulWidget {
class _MedicalProfilePageState extends State<MedicalProfilePage> {
var authProvider = new AuthProvider();
List<Medical> medical=List();
ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
var appoCountProvider = Provider.of<ToDoCountProviderModel>(context);
return BaseView<MedicalViewModel>(
List<Widget> myMedicalList = Utils.myMedicalList(projectViewModel: projectViewModel,context: context,count: appoCountProvider.count,isLogin: projectViewModel.isLogin);
return BaseView<MedicalViewModel>(
onModelReady: (model) => model.getAppointmentHistory(),
builder: (_, model, widget) => AppScaffold(
isShowDecPage: false,
@ -81,403 +88,44 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
),
if (model.isLogin)
ListView.builder(
itemBuilder: (context, index) => TimeLineWidget(
itemBuilder: (context, index) =>
TimeLineWidget(
isUp: index % 2 == 1,
appoitmentAllHistoryResul: model.appoitmentAllHistoryResultList[index],
appoitmentAllHistoryResul: model
.appoitmentAllHistoryResultList[index],
),
itemCount: model.appoitmentAllHistoryResultList.length,
itemCount: model
.appoitmentAllHistoryResultList.length,
scrollDirection: Axis.horizontal,
reverse: !projectViewModel.isArabic,
),
],
),
),
SizedBox(height: 50,),
Padding(
padding: EdgeInsets.symmetric(vertical: 5.0),
child: Column(
children: <Widget>[
if (model.isLogin)
Container(
width: double.infinity,
height: 55,
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: MyAppointments(),
),
);
},
child: authProvider.isLogin
? Stack(children: [
MedicalProfileItem(
title: TranslationBase.of(context).myAppointments,
imagePath: 'my_appointment_icon.png',
subTitle: TranslationBase.of(context).myAppointmentsList,
hasBadge: true,
),
Positioned(
right: 0.0,
child: Badge(
toAnimate: false,
position: BadgePosition.topEnd(),
shape: BadgeShape.circle,
badgeColor: Color(0xFF40ACC9).withOpacity(1.0),
borderRadius: BorderRadius.circular(8),
badgeContent: Container(
padding: EdgeInsets.all(2.0),
child: Text(appoCountProvider.count.toString(), 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,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () => Navigator.push(context, FadePage(page: LabsHomePage())),
child: MedicalProfileItem(
title: TranslationBase.of(context).lab,
imagePath: 'lab_result_icon.png',
subTitle: TranslationBase.of(context).labSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () => Navigator.push(context, FadePage(page: RadiologyHomePage())),
child: MedicalProfileItem(
title: TranslationBase.of(context).radiology,
imagePath: 'radiology_icon.png',
subTitle: TranslationBase.of(context).radiologySubtitle,
),
),
),
],
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: HomePrescriptionsPage(),
),
);
},
child: MedicalProfileItem(
title: TranslationBase.of(context).medicines,
imagePath: 'prescription_icon.png',
subTitle: TranslationBase.of(context).medicinesSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () => Navigator.push(
context,
FadePage(
page: VitalSignDetailsScreen(),
),
),
child: MedicalProfileItem(
title: TranslationBase.of(context).vitalSigns,
imagePath: 'vital_signs.png',
subTitle: TranslationBase.of(context).vitalSignsSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () => Navigator.push(context, FadePage(page: ActiveMedicationsPage())),
child: MedicalProfileItem(
title: TranslationBase.of(context).myMedical,
imagePath: 'active_medications.png',
subTitle: TranslationBase.of(context).myMedicalSubtitle,
),
),
),
],
),
Row(
children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: DoctorHomePage(),
),
);
},
child: MedicalProfileItem(
title: TranslationBase.of(context).myDoctor,
imagePath: 'doctor_icon.png',
subTitle: TranslationBase.of(context).myDoctorSubtitle,
),
),
),
Expanded(
flex: 1,
child: 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,
),
),
),
Expanded(
flex: 1,
child: 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,
),
),
),
],
),
Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context, FadePage(page: InsuranceUpdate()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).updateInsurance,
imagePath: 'insurance_update_icon_.png',
subTitle: TranslationBase.of(context).updateInsuranceSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context, FadePage(page: InsuranceApproval()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).insuranceApproval,
imagePath: 'insurance_approvals_icon.png',
subTitle: TranslationBase.of(context).insuranceApprovalSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () => Navigator.push(context, FadePage(page: AllergiesPage())),
child: MedicalProfileItem(
title: TranslationBase.of(context).allergies,
imagePath: 'my_allergies_icon.png',
subTitle: TranslationBase.of(context).allergiesSubtitle,
),
),
),
]),
Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context, FadePage(page: MyVaccines()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).myVaccines,
imagePath: 'my_vaccines_icon.png',
subTitle: TranslationBase.of(context).myVaccinesSubtitle,
),
),
),
Expanded(
flex: 1,
child: 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,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context, FadePage(page: MonthlyReportsPage()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).monthly,
imagePath: 'monthly_reports_icon.png',
subTitle: TranslationBase.of(context).monthlySubtitle,
),
),
),
]),
Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context, FadePage(page: PatientSickLeavePage()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).sick,
imagePath: 'sick_leaves_icons.png',
subTitle: TranslationBase.of(context).sickSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context, FadePage(page: MyBalancePage()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).myBalance,
imagePath: 'check-in.png',
subTitle: TranslationBase.of(context).myBalanceSubtitle,
),
),
),
Expanded(
flex: 1,
child: MedicalProfileItem(
title: TranslationBase.of(context).patientCall,
imagePath: 'medical_history_icon.png',
subTitle: TranslationBase.of(context).patientCallSubtitle,
),
),
]),
Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
//TODO
onTap: () {
Navigator.push(context, FadePage(page: SmartWatchInstructions()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).smartWatches,
imagePath: 'smartwatch_icon.png',
subTitle: TranslationBase.of(context).smartWatchesSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context, FadePage(page: MyTrackers()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).myTrackers,
imagePath: 'my_tracker_icon.png',
subTitle: TranslationBase.of(context).myTrackersSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
onTap: () {
Navigator.push(context, FadePage(page: AskDoctorHomPage()));
},
child: MedicalProfileItem(
title: TranslationBase.of(context).askYour,
imagePath: 'ask_doctor_icon.png',
subTitle: TranslationBase.of(context).askYourSubtitle,
),
),
),
]),
Row(children: <Widget>[
Expanded(
flex: 1,
child: InkWell(
//TODO
onTap: () {
if (authProvider.isLogin) {
String patientID = authProvider.getAuthenticatedUser().patientID.toString();
GifLoaderDialogUtils.showMyDialog(context);
projectViewModel.platformBridge().connectHMGInternetWifi(patientID).then((value) => {GifLoaderDialogUtils.hideDialog(context)});
} else {
AlertDialogBox(
context: context,
confirmMessage: "Please login with your account first to use this feature",
okText: "OK",
okFunction: () {
AlertDialogBox.closeAlertDialog(context);
}).showAlertDialog(context);
}
},
child: MedicalProfileItem(
title: TranslationBase.of(context).internet,
imagePath: 'insurance_card_icon.png',
subTitle: TranslationBase.of(context).internetSubtitle,
),
),
),
Expanded(
flex: 1,
child: InkWell(
// onTap: () {
// Navigator.push(
// context, FadePage(page: InsuranceApproval()));
// },
child: MedicalProfileItem(
title: TranslationBase.of(context).chatbot,
imagePath: 'insurance_approvals_icon.png',
subTitle: TranslationBase.of(context).chatbotSubtitle,
),
),
),
Expanded(
flex: 1,
child: Container(),
),
]),
SizedBox(
height: MediaQuery.of(context).size.height * 0.12,
)
],
child: GridView.builder(
shrinkWrap: true,
primary: false,
physics: NeverScrollableScrollPhysics(),
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
crossAxisCount: 3,
childAspectRatio: MediaQuery.of(context).size.width / (MediaQuery.of(context).size.height / 2.40),
),
itemCount: myMedicalList.length,
itemBuilder: (BuildContext context, int index) {
return myMedicalList[index];
},
),
)
],
),
SizedBox(
height:
MediaQuery.of(context).size.height * 0.12,
),
if (model.user != null && model.isLogin)
Positioned(
top: 185,
@ -489,9 +137,14 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
shape: BoxShape.rectangle,
border: Border.all(color: Colors.transparent, width: 0.5),
borderRadius: BorderRadius.all(Radius.circular(9)),
image: DecorationImage(image: ExactAssetImage('assets/images/bg_graphic.png'), fit: BoxFit.cover)),
border: Border.all(
color: Colors.transparent, width: 0.5),
borderRadius:
BorderRadius.all(Radius.circular(9)),
image: DecorationImage(
image: ExactAssetImage(
'assets/images/bg_graphic.png'),
fit: BoxFit.cover)),
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.spaceAround,
@ -500,7 +153,9 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
height: 8,
),
Texts(
model.user.firstName + " " + model.user.lastName,
model.user.firstName +
" " +
model.user.lastName,
color: Colors.white,
bold: true,
),
@ -532,4 +187,20 @@ class _MedicalProfilePageState extends State<MedicalProfilePage> {
),
);
}
fullMedicalData(){
if(projectViewModel.havePrivilege(5))
{}
}
}
class Medical{
final String title;
final String imagePath;
final String subTitle;
final Widget page;
Medical({this.title, this.imagePath, this.subTitle, this.page});
}

@ -1,6 +1,7 @@
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/model/sick_leave/sick_leave.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/patient_sick_leave_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -9,6 +10,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.d
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
class PatientSickLeavePage extends StatefulWidget {
@override
@ -19,12 +21,16 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
List<ImagesInfo> imagesInfo = List();
@override
Widget build(BuildContext context) {
void initState() {
imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/imges-info/sick-leaves/ar/0.png'));
imageEn: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/sick-leaves/en/0.png',
imageAr: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/sick-leaves/ar/0.png'));
super.initState();
}
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PatientSickLeaveViewMode>(
onModelReady: (model) => model.getSickLeave(),
builder: (_, model, w) => AppScaffold(
@ -39,22 +45,15 @@ class _PatientSickLeavePageState extends State<PatientSickLeavePage> {
child: ListView.builder(
itemCount: model.sickLeaveList.length,
itemBuilder: (context, index) => DoctorCard(
isLiveCareAppointment: model.sickLeaveList[index].isLiveCareAppointment,
name: model.sickLeaveList[index].doctorName,
date: DateUtil.getMonthDayYearDateFormatted(
model.sickLeaveList[index].requestDate),
date:projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr(model.sickLeaveList[index].requestDate):DateUtil.getMonthDayYearDateFormatted(model.sickLeaveList[index].requestDate),
profileUrl: model.sickLeaveList[index].doctorImageURL,
rat: model.sickLeaveList[index].actualDoctorRate.toDouble(),
subName: model.sickLeaveList[index].projectName,
isInOutPatient: model.sickLeaveList[index].isInOutPatient,
onEmailTap: () {
showConfirmMessage(model, index);
// model.sendSickLeaveEmail(
// message: TranslationBase.of(context).emailSentSuccessfully,
// requestNo: model.sickLeaveList[index].requestNo,
// doctorName: model.sickLeaveList[index].doctorName,
// projectName: model.sickLeaveList[index].projectName,
// setupID: model.sickLeaveList[index].setupID,
// projectID: model.sickLeaveList[index].projectID);
},
),
),

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/Prescriptions.dart';
import 'package:diplomaticquarterapp/core/model/prescriptions/prescription_report.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_details_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -11,7 +12,7 @@ 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';
import '../../../widgets/dialogs/confirm_send_email_dialog.dart';
class PrescriptionItemsPage extends StatelessWidget {
@ -21,6 +22,7 @@ class PrescriptionItemsPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<PrescriptionsViewModel>(
onModelReady: (model) =>
model.getPrescriptionReport(prescriptions: prescriptions),
@ -179,11 +181,12 @@ class PrescriptionItemsPage extends StatelessWidget {
),
bottomSheet: Container(
width: double.infinity,
height: MediaQuery.of(context).size.height * 0.12,
height: MediaQuery.of(context).size.height * 0.14,
color: Colors.grey[100],
child: Column(
children: <Widget>[
Divider(),
if(projectViewModel.havePrivilege(13))
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(

@ -24,7 +24,6 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
appBarTitle: TranslationBase.of(context).orderDetails,
baseViewModel: model,
body: SingleChildScrollView(
physics: BouncingScrollPhysics(),
child: Container(
margin: EdgeInsets.all(15.0),
child: Column(
@ -36,7 +35,7 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
Container(
width: double.infinity,
decoration: BoxDecoration(
color: prescriptionsOrder.status==3 ?Colors.red:prescriptionsOrder.status==2? Colors.green: Colors.grey,
color: prescriptionsOrder.status == 3 ?Colors.green : prescriptionsOrder.status ==2 ? Colors.grey: Colors.red,
borderRadius: BorderRadius.circular(5)),
child: Padding(
padding: const EdgeInsets.all(8.0),
@ -118,7 +117,8 @@ class PrescriptionsHistoryDetailsPage extends StatelessWidget {
],
),
),
)
),
SizedBox(height: 120,)
],
),
),

@ -1,5 +1,6 @@
import 'dart:ui';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_history_page.dart';
@ -18,11 +19,14 @@ class HomePrescriptionsPage extends StatefulWidget {
class _HomePrescriptionsPageState extends State<HomePrescriptionsPage>
with SingleTickerProviderStateMixin {
TabController _tabController;
List<ImagesInfo> imagesInfo = List();
@override
void initState() {
super.initState();
_tabController = TabController(length: 2, vsync: this);
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/my-prescriptions/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/my-prescriptions/ar/0.png'));
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/my-prescriptions/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/my-prescriptions/ar/1.png'));
}
@override
@ -40,6 +44,7 @@ class _HomePrescriptionsPageState extends State<HomePrescriptionsPage>
appBarTitle: TranslationBase.of(context).prescriptions,
description: TranslationBase.of(context).infoPrescriptions,
infoList: TranslationBase.of(context).infoPrescriptionsPoints,
imagesInfo: imagesInfo,
body: Scaffold(
extendBodyBehindAppBar: true,
appBar: PreferredSize(

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/core/enum/filter_type.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/prescriptions_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescription_items_page.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -9,6 +10,7 @@ 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 PrescriptionsPage extends StatelessWidget {
final PrescriptionsViewModel prescriptionsViewModel;
@ -18,6 +20,7 @@ class PrescriptionsPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return AppScaffold(
baseViewModel: prescriptionsViewModel,
body: FractionallySizedBox(
@ -88,9 +91,9 @@ class PrescriptionsPage extends StatelessWidget {
profileUrl: prescriptions.doctorImageURL,
rat: prescriptions.actualDoctorRate.toDouble(),
subName: prescriptions.name,
isInOutPatient: prescriptions.isInOutPatient,
date: DateUtil.getMonthDayYearDateFormatted(
prescriptions.dischargeDate),
isInOutPatient: prescriptions.isInOutPatient,
isLiveCareAppointment: prescriptions.isLiveCareAppointment,
date:projectViewModel.isArabic? DateUtil.getMonthDayYearDateFormattedAr( DateUtil.convertStringToDate(prescriptions.appointmentDate) ):DateUtil.getMonthDayYearDateFormatted(DateUtil.convertStringToDate(prescriptions.appointmentDate)),
),
);
}).toList(),

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/model/radiology/final_radiology.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/radiology_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
@ -10,6 +11,7 @@ import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.d
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'package:url_launcher/url_launcher.dart';
class RadiologyDetailsPage extends StatelessWidget {
@ -19,6 +21,7 @@ class RadiologyDetailsPage extends StatelessWidget {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<RadiologyViewModel>(
onModelReady: (model) => model.getRadImageURL(
projectId: finalRadiology.projectID,
@ -51,17 +54,19 @@ class RadiologyDetailsPage extends StatelessWidget {
],
),
),
bottomSheet: Container(
bottomSheet: (projectViewModel.havePrivilege(9) ||
projectViewModel.havePrivilege(8))
? Container(
width: double.infinity,
height: finalRadiology.dIAPACSURL != ""
? MediaQuery.of(context).size.height * 0.2
: MediaQuery.of(context).size.height * 0.15,
? MediaQuery.of(context).size.height * 0.25
: MediaQuery.of(context).size.height * 0.14,
color: Colors.grey[100],
child: Column(
mainAxisSize: MainAxisSize.min,
children: <Widget>[
Divider(),
if (finalRadiology.dIAPACSURL != "")
if (finalRadiology.dIAPACSURL != "" && projectViewModel.havePrivilege(9))
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
@ -72,6 +77,7 @@ class RadiologyDetailsPage extends StatelessWidget {
backgroundColor: Colors.grey[800],
),
),
if (projectViewModel.havePrivilege(8))
Container(
width: MediaQuery.of(context).size.width * 0.8,
child: Button(
@ -86,7 +92,7 @@ class RadiologyDetailsPage extends StatelessWidget {
)
],
),
)),
):Container()),
);
}

@ -19,8 +19,8 @@ class RadiologyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/ar/0.png'));
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/my-radiology/ar/1.png'));
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/my-radiology/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/my-radiology/ar/0.png'));
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/my-radiology/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/my-radiology/ar/1.png'));
return BaseView<RadiologyViewModel>(
onModelReady: (model) => model.getPatientRadOrders(),
builder: (_, model, widget) => AppScaffold(
@ -94,6 +94,7 @@ class RadiologyHomePage extends StatelessWidget {
),
child: DoctorCard(
isInOutPatient: radiology.isInOutPatient,
isLiveCareAppointment: radiology.isLiveCareAppointment,
name: radiology.doctorName,
profileUrl: radiology.doctorImageURL,
billNo: '${radiology.invoiceNo}',

@ -2,6 +2,7 @@ import 'dart:ui';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/reports_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/reports/report_list_widget.dart';
import 'package:diplomaticquarterapp/pages/medical/reports/reports_page.dart';
@ -12,6 +13,7 @@ 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 HomeReportPage extends StatefulWidget {
@override
@ -37,26 +39,28 @@ class _HomeReportPageState extends State<HomeReportPage>
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/0.png',
'https://hmgwebservices.com/Images/MobileAppDq/imges-info/medical-reorts/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/0.png'));
'https://hmgwebservices.com/Images/MobileAppDq/imges-info/medical-reorts/ar/0.png'));
imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/1.png',
'https://hmgwebservices.com/Images/MobileAppDq/imges-info/medical-reorts/en/1.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/1.png'));
'https://hmgwebservices.com/Images/MobileAppDq/imges-info/medical-reorts/ar/1.png'));
imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/en/2.png',
'https://hmgwebservices.com/Images/MobileAppDq/imges-info/medical-reorts/en/2.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/imges-info/medical-reorts/ar/2.png'));
'https://hmgwebservices.com/Images/MobileAppDq/imges-info/medical-reorts/ar/2.png'));
return BaseView<ReportsViewModel>(
onModelReady: (model) => model.getReports(), //model.getPrescriptions(),
builder: (_, model, widget) => AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).newMedReport,
title: TranslationBase.of(context).medReport,
description: TranslationBase.of(context).infoMonthReport,
baseViewModel: model,
imagesInfo: imagesInfo,
@ -105,13 +109,13 @@ class _HomeReportPageState extends State<HomeReportPage>
Container(
width: MediaQuery.of(context).size.width * 0.15,
child: Center(
child: Texts(TranslationBase.of(context).requested,fontSize: 12,),
child: Texts(TranslationBase.of(context).requested,fontSize: 11,),
),
),
Container(
width: MediaQuery.of(context).size.width * 0.15,
child: Center(
child: Texts(TranslationBase.of(context).ready,fontSize: 12,),
child: Texts(TranslationBase.of(context).ready,fontSize: 11,),
),
),
Container(
@ -125,7 +129,7 @@ class _HomeReportPageState extends State<HomeReportPage>
width: MediaQuery.of(context).size.width * 0.15,
child: Center(
child:
Texts(TranslationBase.of(context).cancelled,fontSize: 12,),
Texts(TranslationBase.of(context).cancelled,fontSize: 11,),
),
),
],
@ -138,6 +142,7 @@ class _HomeReportPageState extends State<HomeReportPage>
),
body: Column(
children: <Widget>[
if(model.user!=null)
Expanded(
child: TabBarView(
physics: BouncingScrollPhysics(),
@ -167,7 +172,7 @@ class _HomeReportPageState extends State<HomeReportPage>
)
],
),
bottomSheet: Container(
bottomSheet: projectViewModel.havePrivilege(21) ?Container(
width: double.infinity,
height: 90,
margin: EdgeInsets.all(8.0),
@ -181,7 +186,7 @@ class _HomeReportPageState extends State<HomeReportPage>
),
),
),
),
):null,
),
),
);

@ -35,11 +35,11 @@ class LineChartCurved extends StatelessWidget {
title,
style: TextStyle(
color: Colors.black,
fontSize: 32,
fontWeight: FontWeight.bold,
fontSize: 15,
letterSpacing: 2),
textAlign: TextAlign.center,
),
SizedBox(height: 10,),
Expanded(
child: Padding(
padding: const EdgeInsets.only(right: 18.0, left: 16.0),

@ -0,0 +1,257 @@
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:fl_chart/fl_chart.dart';
import 'package:flutter/material.dart';
class LineChartCurvedBloodPressure extends StatelessWidget {
final String title;
final List<TimeSeriesSales2> timeSeries1;
final List<TimeSeriesSales2> timeSeries2;
final int indexes;
LineChartCurvedBloodPressure(
{this.title, this.timeSeries1, this.indexes, this.timeSeries2});
List<int> xAxixs = List();
List<double> yAxixs = List();
@override
Widget build(BuildContext context) {
getXaxix();
return AspectRatio(
aspectRatio: 1.1,
child: Container(
decoration: const BoxDecoration(
borderRadius: BorderRadius.all(Radius.circular(18)),
// color: Colors.white,
),
child: Stack(
children: <Widget>[
Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: <Widget>[
const SizedBox(
height: 15,
),
Text(
title,
style: TextStyle(
color: Colors.black, fontSize: 15, letterSpacing: 2),
textAlign: TextAlign.center,
),
SizedBox(
height: 10,
),
Expanded(
child: Padding(
padding:
const EdgeInsets.only(right: 18.0, left: 16.0, top: 15),
child: LineChart(
sampleData1(context),
swapAnimationDuration: const Duration(milliseconds: 250),
),
),
),
SizedBox(
height: 10,
),
Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
Row(
children: [
Container(
width: 20,
height: 20,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Theme.of(context).primaryColor),
),
SizedBox(width: 5,),
Texts(TranslationBase.of(context).systolicLng)
],
),
SizedBox(width: 15,),
Row(
children: [
Container(
width: 20,
height: 20,
decoration: BoxDecoration(
shape: BoxShape.rectangle,
color: Colors.grey),
),
SizedBox(width: 5,),
Texts(TranslationBase.of(context).diastolicLng)
],
),
],
)
],
),
],
),
),
);
}
getXaxix() {
for (int index = 0; index < timeSeries1.length; index++) {
int mIndex = indexes * index;
if (mIndex < timeSeries1.length) {
xAxixs.add(mIndex);
}
}
}
LineChartData sampleData1(context) {
return LineChartData(
lineTouchData: LineTouchData(
touchTooltipData: LineTouchTooltipData(
tooltipBgColor: Colors.white,
),
touchCallback: (LineTouchResponse touchResponse) {},
handleBuiltInTouches: true,
),
gridData: FlGridData(
show: true, drawVerticalLine: true, drawHorizontalLine: true),
titlesData: FlTitlesData(
bottomTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(
color: Colors.black,
fontSize: 10,
),
rotateAngle: -65,
//rotateAngle:-65,
margin: 22,
getTitles: (value) {
if (timeSeries1.length < 15) {
if (timeSeries1.length > value.toInt()) {
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
} else
return '';
} else {
if (value.toInt() == 0)
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
if (value.toInt() == timeSeries1.length - 1)
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
if (xAxixs.contains(value.toInt())) {
return '${timeSeries1[value.toInt()].time.month}/ ${timeSeries1[value.toInt()].time.year}';
}
}
return '';
},
),
leftTitles: SideTitles(
showTitles: true,
getTextStyles: (value) => const TextStyle(
color: Colors.black,
fontWeight: FontWeight.bold,
fontSize: 10,
),
getTitles: (value) {
return '${value.toInt()}';
},
margin: 12,
),
),
borderData: FlBorderData(
show: true,
border: const Border(
bottom: BorderSide(
color: Colors.black,
width: 0.5,
),
left: BorderSide(
color: Colors.black,
),
right: BorderSide(
color: Colors.black,
),
top: BorderSide(
color: Colors.transparent,
),
),
),
minX: 0,
maxX: (timeSeries1.length - 1).toDouble(),
maxY: getMaxY() + 0.3,
minY: getMinY(),
lineBarsData: getData(context),
);
}
double getMaxY() {
double max = 0;
timeSeries1.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble > max) max = resultValueDouble;
});
timeSeries2.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble > max) max = resultValueDouble;
});
return max.roundToDouble();
}
double getMinY() {
double min = timeSeries1[0].sales;
timeSeries1.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble < min) min = resultValueDouble;
});
timeSeries2.forEach((element) {
double resultValueDouble = element.sales;
if (resultValueDouble < min) min = resultValueDouble;
});
int value = min.toInt();
return value.toDouble();
}
List<LineChartBarData> getData(context) {
List<FlSpot> spots = List();
for (int index = 0; index < timeSeries1.length; index++) {
spots.add(FlSpot(index.toDouble(), timeSeries1[index].sales));
}
List<FlSpot> spots2 = List();
for (int index = 0; index < timeSeries2.length; index++) {
spots2.add(FlSpot(index.toDouble(), timeSeries2[index].sales));
}
final LineChartBarData lineChartBarData1 = LineChartBarData(
spots: spots,
isCurved: true,
colors: [Theme.of(context).primaryColor],
barWidth: 5,
isStrokeCapRound: true,
dotData: FlDotData(
show: false,
),
belowBarData: BarAreaData(
show: false,
),
);
final LineChartBarData lineChartBarData2 = LineChartBarData(
spots: spots2,
isCurved: true,
colors: [Colors.grey],
barWidth: 5,
isStrokeCapRound: true,
dotData: FlDotData(
show: false,
),
belowBarData: BarAreaData(
show: false,
),
);
return [lineChartBarData1, lineChartBarData2];
}
}

@ -0,0 +1,146 @@
import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class VitalSignBloodPressureWidget extends StatefulWidget {
final List<VitalSignResModel> vitalList;
final String title1;
final String title2;
final String title3;
final String viewKey1;
final String viewKey2;
VitalSignBloodPressureWidget(
{Key key, this.vitalList, this.title1, this.title2, this.viewKey1, this.title3, this.viewKey2});
@override
_VitalSignDetailsWidgetState createState() => _VitalSignDetailsWidgetState();
}
class _VitalSignDetailsWidgetState extends State<VitalSignBloodPressureWidget> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return Container(
decoration: BoxDecoration(
color: Colors.transparent,
borderRadius: BorderRadius.only(
topLeft: Radius.circular(10.0), topRight: Radius.circular(10.0)),
border: Border.all(color: Colors.grey, width: 1),
),
margin: EdgeInsets.all(20),
child: Container(
color: Colors.transparent,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Table(
border: TableBorder.symmetric(
inside: BorderSide(width: 2.0, color: Colors.grey[300]),
),
children: fullData(projectViewModel),
),
],
),
),
);
}
List<TableRow> fullData(ProjectViewModel projectViewModel) {
List<TableRow> tableRow = [];
tableRow.add(TableRow(children: [
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topLeft:projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0),
topRight: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0)
),
),
child: Center(
child: Texts(
TranslationBase.of(context).date,
color: Colors.white,
),
),
height: 60,
),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
),
child: Center(
child: Texts(widget.title2, color: Colors.white),
),
height: 60),
),
Container(
child: Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only(
topRight: projectViewModel.isArabic? Radius.circular(0.0):Radius.circular(10.0),
topLeft: projectViewModel.isArabic? Radius.circular(10.0):Radius.circular(0.0)
),
),
child: Center(
child: Texts(widget.title3, color: Colors.white),
),
height: 60),
),
]));
widget.vitalList.forEach((vital) {
var data = vital.toJson()[widget.viewKey1];
if (data != 0)
tableRow.add(TableRow(children: [
Container(
child: Container(
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Texts(
'${projectViewModel.isArabic ? DateUtil.getWeekDayArabic(vital.vitalSignDate.weekday) : DateUtil.getWeekDay(vital.vitalSignDate.weekday)}, ${vital.vitalSignDate.day} ${projectViewModel.isArabic ? DateUtil.getMonthArabic(vital.vitalSignDate.month) : DateUtil.getMonth(vital.vitalSignDate.month)}, ${vital.vitalSignDate.year} ',
textAlign: TextAlign.center,
),
),
),
),
Container(
child: Container(
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Texts(
'${vital.toJson()[widget.viewKey1]}',
textAlign: TextAlign.center,
),
),
),
),
Container(
child: Container(
padding: EdgeInsets.all(10),
color: Colors.white,
child: Center(
child: Texts(
'${vital.toJson()[widget.viewKey2]}',
textAlign: TextAlign.center,
),
),
),
),
]));
});
return tableRow;
}
}

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/enum/patient_lookup.dart';
import 'package:diplomaticquarterapp/core/model/ImagesInfo.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/vital_sign_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_item.dart';
@ -16,19 +17,26 @@ class VitalSignDetailsScreen extends StatelessWidget {
int appointmentNo;
int projectID;
VitalSignDetailsScreen({this.appointmentNo, this.projectID});
bool isNotOneAppointment;
VitalSignDetailsScreen({this.appointmentNo, this.projectID,this.isNotOneAppointment=true});
List<ImagesInfo> imagesInfo = List();
@override
Widget build(BuildContext context) {
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/my-vital-signs/en/0.png',imageAr: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/my-vital-signs/ar/0.png'));
imagesInfo.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/my-vital-signs/en/1.png',imageAr: 'https://hmgwebservices.com/Images/MobileAppDq/imges-info/my-vital-signs/ar/1.png'));
return BaseView<VitalSignViewModel>(
onModelReady: appointmentNo != null && projectID != null
? (model) => model.getPatientRadOrders(
? (model) => model.getPatientVitalSign(
appointmentNo: appointmentNo, projectID: projectID)
: (model) => model.getPatientRadOrders(),
: (model) => model.getPatientVitalSign(),
builder: (_, mode, widget) => AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).vitalSigns,
baseViewModel: mode,
description: TranslationBase.of(context).infoSigns,
imagesInfo: imagesInfo,
body: mode.vitalSignResModelList.length > 0
? Container(
child: ListView(
@ -36,7 +44,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
Row(
children: <Widget>[
InkWell(
onTap: () => Navigator.push(
onTap: () =>isNotOneAppointment? Navigator.push(
context,
FadePage(
page: VitalSignItemDetailsScreen(
@ -45,22 +53,18 @@ class VitalSignDetailsScreen extends StatelessWidget {
vitalList: mode.vitalSignResModelList,
),
),
),
):null,
child: Container(
child: VitalSignItem(
des: TranslationBase.of(context).height,
icon: DQIcons.height,
lastVal: mode
.vitalSignResModelList[
mode.vitalSignResModelList.length - 1]
.heightCm
.toString(),
lastVal: mode.heightCm,
unit: TranslationBase.of(context).cm,
),
),
),
InkWell(
onTap: () => Navigator.push(
onTap: () => isNotOneAppointment ? Navigator.push(
context,
FadePage(
page: VitalSignItemDetailsScreen(
@ -69,16 +73,12 @@ class VitalSignDetailsScreen extends StatelessWidget {
vitalList: mode.vitalSignResModelList,
),
),
),
):null,
child: VitalSignItem(
des: TranslationBase.of(context).weight,
icon: DQIcons.weight_scale,
unit: TranslationBase.of(context).kg,
lastVal: mode
.vitalSignResModelList[
mode.vitalSignResModelList.length - 1]
.weightKg
.toString(),
lastVal: mode.weightKg,
),
),
],
@ -86,7 +86,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
Row(
children: <Widget>[
InkWell(
onTap: () => Navigator.push(
onTap: () => isNotOneAppointment ? Navigator.push(
context,
FadePage(
page: VitalSignItemDetailsScreen(
@ -96,18 +96,16 @@ class VitalSignDetailsScreen extends StatelessWidget {
vitalList: mode.vitalSignResModelList,
),
),
),
): null,
child: VitalSignItem(
des: TranslationBase.of(context).body,
icon: DQIcons.bmi,
lastVal: mode
.vitalSignResModelList[ mode.vitalSignResModelList.length - 1].pulseBeatPerMinute
.toString(),
lastVal: mode.bodyMax,
unit: TranslationBase.of(context).mass,
),
),
InkWell(
onTap: () => Navigator.push(
onTap: () => isNotOneAppointment ? Navigator.push(
context,
FadePage(
page: VitalSignItemDetailsScreen(
@ -117,14 +115,12 @@ class VitalSignDetailsScreen extends StatelessWidget {
vitalList: mode.vitalSignResModelList,
),
),
),
):null,
child: Container(
child: VitalSignItem(
des: TranslationBase.of(context).temperature,
icon: DQIcons.thermometer,
lastVal: mode
.vitalSignResModelList[ mode.vitalSignResModelList.length - 1].temperatureCelcius
.toString(),
lastVal: mode.temperatureCelcius,
unit: TranslationBase.of(context).tempC,
),
),
@ -134,7 +130,7 @@ class VitalSignDetailsScreen extends StatelessWidget {
Row(
children: <Widget>[
InkWell(
onTap: () => Navigator.push(
onTap: () => isNotOneAppointment ? Navigator.push(
context,
FadePage(
page: VitalSignItemDetailsScreen(
@ -143,20 +139,16 @@ class VitalSignDetailsScreen extends StatelessWidget {
vitalList: mode.vitalSignResModelList,
),
),
),
):null,
child: VitalSignItem(
des: TranslationBase.of(context).heart,
icon: DQIcons.heart,
lastVal: mode
.vitalSignResModelList[
mode.vitalSignResModelList.length - 1]
.pulseBeatPerMinute
.toString(),
lastVal: mode.hartRat,
unit: TranslationBase.of(context).bpm,
),
),
InkWell(
onTap: () => Navigator.push(
onTap: () => isNotOneAppointment ? Navigator.push(
context,
FadePage(
page: VitalSignItemDetailsScreen(
@ -166,15 +158,11 @@ class VitalSignDetailsScreen extends StatelessWidget {
vitalList: mode.vitalSignResModelList,
),
),
),
):null,
child: VitalSignItem(
des: TranslationBase.of(context).respirationRate,
icon: DQIcons.outline,
lastVal: mode
.vitalSignResModelList[
mode.vitalSignResModelList.length - 1]
.respirationBeatPerMinute
.toString(),
lastVal: mode.respirationBeatPerMinute,
unit: TranslationBase.of(context).respirationSigns,
),
),
@ -184,24 +172,20 @@ class VitalSignDetailsScreen extends StatelessWidget {
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
InkWell(
onTap: () => Navigator.push(
onTap: () => isNotOneAppointment ? Navigator.push(
context,
FadePage(
page: VitalSignItemDetailsScreen(
pageKey: VitalSignDetails.BloodPressure,
pageTitle: TranslationBase.of(context).pulse,
pageTitle: TranslationBase.of(context).bloodPressure,
vitalList: mode.vitalSignResModelList,
),
),
),
):null,
child: VitalSignItem(
des: TranslationBase.of(context).pulse,
des: TranslationBase.of(context).bloodPressure,
icon: DQIcons.blood_pressure,
lastVal: mode
.vitalSignResModelList[
mode.vitalSignResModelList.length - 1]
.bloodPressure
.toString(),
lastVal: mode.bloodPressure,
unit: TranslationBase.of(context).sysDias,
),
),

@ -2,6 +2,7 @@ import 'package:diplomaticquarterapp/core/enum/patient_lookup.dart';
import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sing_chart_and_detials.dart';
import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sing_chart_blood_pressure.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
@ -22,53 +23,14 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
case VitalSignDetails.BodyMeasurements:
VSchart = [
{
'name': 'Height',
'nameAr': 'الطول',
'name': 'BMI',
'nameAr': 'مؤشر الكتلة',
'title1': 'Date',
'title2': 'Cm',
'title2Ar': 'سم',
'viewKey': 'HeightCm',
},
{
'name': 'Weight Kg',
'nameAr': 'الوزن كجم',
'title1': 'Date',
'title2': 'Kg',
'title2Ar': 'كجم',
'viewKey': 'WeightKg',
},
{
'name': 'Body Mass Index',
'nameAr': 'مؤشر كتلة الجسم',
'title1': 'Date',
'title2': 'BodyMass',
'title2Ar': 'كتلة الجسم',
'title2': 'BMI',
'title2Ar': 'الكتلة',
'viewKey': 'BodyMassIndex',
},
{
'name': 'Head Circum Cm',
'nameAr': 'محيط رأس سم',
'title1': 'Date',
'title2': 'Cm',
'title2Ar': 'سم',
'viewKey': 'HeadCircumCm',
},
{
'name': 'Ideal Body Weight (Lbs)',
'nameAr': 'وزن الجسم المثالي (رطل)',
'title1': 'Date',
'title2': 'Ideal Weight',
'title2Ar': 'الوزن المثالي',
'viewKey': 'IdealBodyWeightLbs',
},
{
'name': 'Lean Body WeightLbs (Lbs)',
'nameAr': 'رطل وزن الجسم النحيل (رطل)',
'title1': 'Date',
'title2': 'Lean Weight',
'title2Ar': 'وزن خفيف',
'viewKey': 'LeanBodyWeightLbs',
}
];
break;
@ -115,21 +77,16 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
case VitalSignDetails.BloodPressure:
VSchart = [
{
'name': 'Blood Pressure Higher',
'nameAr': 'ضغط الدم الإنقباض',
'name': 'Blood Pressure Systolic Diastolic',
'nameAr': 'ضغط الدم الإنقباض الإنبساط',
'title1': 'Date',
'title2': 'Minute',
'title2': 'systolic',
'title3': 'Diastolic',
'title2Ar': 'الإنقباض',
'viewKey': 'BloodPressureHigher',
'title3Ar': 'الإنبساط',
'viewKey': 'BloodPressure',
},
{
'name': 'Blood Pressure Lower',
'nameAr': 'ضغط الدم الإنبساط',
'title1': 'Date',
'title2': 'Minute',
'title2Ar': 'الإنبساط',
'viewKey': 'BloodPressureLower',
}
];
break;
@ -149,7 +106,7 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
case VitalSignDetails.heart:
VSchart = [
{
'name': 'FIO2',
'name': 'Heart rate',
'nameAr': 'معدل النبض بالدقيقة',
'title1': 'Date',
'title2': 'bpm',
@ -209,6 +166,20 @@ class VitalSignItemDetailsScreen extends StatelessWidget {
var vitalListTemp = vitalList.where(
(element) => element.toJson()[chartInfo['viewKey']] != null,
);
if(vitalListTemp.length != 0 && chartInfo['viewKey']=='BloodPressure'){
return VitalSingChartBloodPressure(
vitalList: vitalList,
name:projectViewModel.isArabic? chartInfo['nameAr']:chartInfo['name'],
title1: chartInfo['title1'],
title2:projectViewModel.isArabic?chartInfo['title2Ar']: chartInfo['title2'],
title3:projectViewModel.isArabic?chartInfo['title3Ar']: chartInfo['title3'],
viewKey1: 'BloodPressureHigher',
viewKey2: 'BloodPressureLower',
);
}
return vitalListTemp.length != 0
? VitalSingChartAndDetials(
vitalList: vitalList,

@ -46,9 +46,9 @@ class VitalSingChartAndDetials extends StatelessWidget {
generateData() {
if (vitalList.length > 0) {
vitalList.forEach(
vitalList.reversed.toList().forEach(
(element) {
if( element.toJson()[viewKey]?.toInt()!=0)
if( element.toJson()[viewKey]!=null && element.toJson()[viewKey]?.toInt()!=0)
timeSeriesData.add(
TimeSeriesSales2(
new DateTime(element.vitalSignDate.year, element.vitalSignDate.month, element.vitalSignDate.day),

@ -0,0 +1,85 @@
import 'package:diplomaticquarterapp/core/model/vital_sign/vital_sign_res_model.dart';
import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_blood_pressurewideget.dart';
import 'package:diplomaticquarterapp/pages/medical/vital_sign/vital_sign_details_wideget.dart';
import 'package:diplomaticquarterapp/widgets/charts/app_time_series_chart.dart';
import 'package:diplomaticquarterapp/widgets/others/app_expandable_notifier.dart';
import 'package:flutter/material.dart';
import 'package:charts_flutter/flutter.dart' as charts;
import 'LineChartCurved.dart';
import 'LineChartCurvedBloodPressure.dart';
class VitalSingChartBloodPressure extends StatelessWidget {
VitalSingChartBloodPressure({
Key key,
@required this.vitalList,
@required this.name,
@required this.viewKey1,
@required this.viewKey2,
@required this.title1,
@required this.title2,
@required this.title3,
}) : super(key: key);
final List<VitalSignResModel> vitalList;
final String name;
final String viewKey1;
final String viewKey2;
final String title1;
final String title2;
final String title3;
List<TimeSeriesSales2> timeSeriesData1 = [];
List<TimeSeriesSales2> timeSeriesData2 = [];
@override
Widget build(BuildContext context) {
generateData();
return Column(
children: <Widget>[
AppExpandableNotifier(
isExpand: true,
headerWidget: LineChartCurvedBloodPressure(
title: name,
timeSeries1: timeSeriesData1,
timeSeries2: timeSeriesData2,
indexes: timeSeriesData1.length ~/ 5.5,
),
bodyWidget: VitalSignBloodPressureWidget(
vitalList: vitalList,
title1: title1,
title2: title2,
title3: title3,
viewKey1: viewKey1,
viewKey2: viewKey2,
),
),
],
);
}
generateData() {
if (vitalList.length > 0) {
vitalList.reversed.toList().forEach(
(element) {
if (element.toJson()[viewKey1]?.toInt() != 0)
timeSeriesData1.add(
TimeSeriesSales2(
new DateTime(element.vitalSignDate.year,
element.vitalSignDate.month, element.vitalSignDate.day),
element.toJson()[viewKey1].toDouble(),
),
);
if (element.toJson()[viewKey2]?.toInt() != 0)
timeSeriesData2.add(
TimeSeriesSales2(
new DateTime(element.vitalSignDate.year,
element.vitalSignDate.month, element.vitalSignDate.day),
element.toJson()[viewKey2].toDouble(),
),
);
},
);
}
}
}

@ -1,7 +1,9 @@
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/models/Appointments/toDoCountProviderModel.dart';
import 'package:diplomaticquarterapp/pages/ToDoList/ToDo.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/advance_payment_page.dart';
import 'package:diplomaticquarterapp/pages/medical/balance/my_balance_page.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.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';
@ -12,9 +14,13 @@ import 'package:hexcolor/hexcolor.dart';
import 'package:provider/provider.dart';
class PaymentService extends StatelessWidget {
ToDoCountProviderModel model;
ProjectViewModel projectViewModel;
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
projectViewModel = Provider.of(context);
model = Provider.of<ToDoCountProviderModel>(context);
return AppScaffold(
isShowAppBar: true,
isShowDecPage: false,
@ -68,10 +74,10 @@ class PaymentService extends StatelessWidget {
),
),
),
if(!projectViewModel.havePrivilege(33))
Expanded(
child: InkWell(
onTap: () =>
Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true))),
onTap: () => navigateToToDoPage(context),
child: Container(
margin: EdgeInsets.all(5.0),
padding: EdgeInsets.all(9),
@ -111,6 +117,7 @@ class PaymentService extends StatelessWidget {
)
],
),
if(!projectViewModel.havePrivilege(33))
Row(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
@ -166,4 +173,17 @@ class PaymentService extends StatelessWidget {
),
);
}
navigateToToDoPage(BuildContext context) {
if (projectViewModel.isLogin) {
if (model.count != 0) {
Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true)));
} else {
AppToast.showErrorToast(
message: TranslationBase.of(context).upcomingEmpty);
}
} else {
Navigator.push(context, FadePage(page: ToDo(isShowAppBar: true)));
}
}
}

@ -190,7 +190,7 @@ class _RateAppointmentDoctorState extends State<RateAppointmentDoctor> {
child: SecondaryButton(
onTap: () async {
final form = formKey.currentState;
if (form.validate()) {
if (form.validate() && rating>0 ) {
form.save();
Navigator.push(
context,
@ -206,7 +206,7 @@ class _RateAppointmentDoctorState extends State<RateAppointmentDoctor> {
}
},
label: TranslationBase.of(context).next,
disabled: model.state == ViewState.BusyLocal,
disabled: model.state == ViewState.BusyLocal|| rating==0,
loading: model.state == ViewState.BusyLocal,
textColor: Theme.of(context).backgroundColor),
),

@ -1,5 +1,6 @@
import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/core/viewModels/dashboard_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
@ -10,6 +11,7 @@ import 'package:diplomaticquarterapp/widgets/text/app_texts_widget.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:provider/provider.dart';
class ProfileSettings extends StatefulWidget {
@ -29,7 +31,9 @@ class _ProfileSettings extends State<ProfileSettings>
@override
void initState() {
Future.delayed(new Duration(seconds: 0), () {
getSettings(context);
ProjectViewModel projectProvider;
projectProvider = Provider.of(context);
if (projectProvider.isLogin == true) getSettings(context);
});
super.initState();
}
@ -38,182 +42,188 @@ class _ProfileSettings extends State<ProfileSettings>
return BaseView<DashboardViewModel>(
onModelReady: (model) => {},
builder: (_, model, wi) => Container(
child:
ListView(scrollDirection: Axis.vertical, children: <Widget>[
Container(
padding: EdgeInsets.all(15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
TranslationBase.of(context).fileNo,
color: Colors.black,
child: model.user != null
? ListView(scrollDirection: Axis.vertical, children: <Widget>[
Container(
padding: EdgeInsets.all(15),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(
TranslationBase.of(context).fileNo,
color: Colors.black,
),
AppText(
model.user.patientID.toString(),
color: Colors.black,
),
],
),
),
AppText(
model.user.patientID.toString(),
color: Colors.black,
SizedBox(
height: 1,
width: MediaQuery.of(context).size.width,
child: Container(
color: Colors.grey[300],
),
),
],
),
),
SizedBox(
height: 1,
width: MediaQuery.of(context).size.width,
child: Container(
color: Colors.grey[300],
),
),
Padding(
child: AppText(TranslationBase.of(context).languageSetting,
fontWeight: FontWeight.bold),
padding: EdgeInsets.all(10),
),
Container(
color: Colors.white,
padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(TranslationBase.of(context).english),
new Radio(
value: 2,
groupValue: language,
onChanged: (value) {
setState(() {
language = value;
});
},
)
],
)),
Container(
color: Colors.white,
padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(TranslationBase.of(context).arabic),
new Radio(
value: 1,
groupValue: language,
onChanged: (value) {
setState(() {
language = value;
});
},
)
],
)),
Padding(
child: AppText(TranslationBase.of(context).alert),
padding: EdgeInsets.all(10),
),
Container(
color: Colors.white,
padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(TranslationBase.of(context).emailAlert),
Switch(
value: emailAlert,
onChanged: (value) {
setState(() {
emailAlert = value;
});
},
activeTrackColor: Colors.lightGreenAccent,
activeColor: Colors.green,
)
],
)),
Container(
color: Colors.white,
padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(TranslationBase.of(context).smsAlert),
Switch(
value: smsAlert,
onChanged: (value) {
setState(() {
smsAlert = value;
});
},
activeTrackColor: Colors.lightGreenAccent,
activeColor: Colors.green,
)
],
)),
Padding(
child: AppText(TranslationBase.of(context).contactInfo),
padding: EdgeInsets.all(10),
),
Container(
color: Colors.white,
padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(TranslationBase.of(context).email),
TextField(
controller: emailController,
decoration: InputDecoration(
suffixIcon: Icon(Icons.edit),
))
],
)),
Container(
color: Colors.white,
padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(TranslationBase.of(context).emergencyName),
TextField(
controller: emergencyContactName,
decoration: InputDecoration(
suffixIcon: Icon(Icons.edit),
))
],
)),
Container(
color: Colors.white,
padding:
EdgeInsets.only(top: 0, left: 10, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(TranslationBase.of(context).emergencyContact),
TextField(
controller: emergencyContact,
decoration: InputDecoration(
suffixIcon: Icon(Icons.edit),
),
)
],
)),
Container(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).submit,
() {
saveSettings();
},
)),
],
))
])));
Padding(
child: AppText(
TranslationBase.of(context).languageSetting,
fontWeight: FontWeight.bold),
padding: EdgeInsets.all(10),
),
Container(
color: Colors.white,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(TranslationBase.of(context).english),
new Radio(
value: 2,
groupValue: language,
onChanged: (value) {
setState(() {
language = value;
});
},
)
],
)),
Container(
color: Colors.white,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(TranslationBase.of(context).arabic),
new Radio(
value: 1,
groupValue: language,
onChanged: (value) {
setState(() {
language = value;
});
},
)
],
)),
Padding(
child: AppText(TranslationBase.of(context).alert),
padding: EdgeInsets.all(10),
),
Container(
color: Colors.white,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(TranslationBase.of(context).emailAlert),
Switch(
value: emailAlert,
onChanged: (value) {
setState(() {
emailAlert = value;
});
},
activeTrackColor: Colors.lightGreenAccent,
activeColor: Colors.green,
)
],
)),
Container(
color: Colors.white,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
AppText(TranslationBase.of(context).smsAlert),
Switch(
value: smsAlert,
onChanged: (value) {
setState(() {
smsAlert = value;
});
},
activeTrackColor: Colors.lightGreenAccent,
activeColor: Colors.green,
)
],
)),
Padding(
child: AppText(TranslationBase.of(context).contactInfo),
padding: EdgeInsets.all(10),
),
Container(
color: Colors.white,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(TranslationBase.of(context).email),
TextField(
controller: emailController,
decoration: InputDecoration(
suffixIcon: Icon(Icons.edit),
))
],
)),
Container(
color: Colors.white,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(TranslationBase.of(context).emergencyName),
TextField(
controller: emergencyContactName,
decoration: InputDecoration(
suffixIcon: Icon(Icons.edit),
))
],
)),
Container(
color: Colors.white,
padding: EdgeInsets.only(
top: 0, left: 10, right: 10, bottom: 0),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
AppText(
TranslationBase.of(context).emergencyContact),
TextField(
controller: emergencyContact,
decoration: InputDecoration(
suffixIcon: Icon(Icons.edit),
),
)
],
)),
Container(
padding: EdgeInsets.all(10),
child: Row(
children: <Widget>[
Expanded(
child: DefaultButton(
TranslationBase.of(context).save,
() {
saveSettings();
},
)),
],
))
])
: Center(
child:
AppText(TranslationBase.of(context).loginToUseService),
)));
}
getSettings(context) {

@ -21,6 +21,10 @@ class _Settings extends State<Settings> with TickerProviderStateMixin {
_tabController =
new TabController(length: 2, vsync: this, initialIndex: widget.type);
if(widget.type==1){
_tabController.animateTo(1);
}
super.initState();
}
@ -30,6 +34,14 @@ class _Settings extends State<Settings> with TickerProviderStateMixin {
return Scaffold(
appBar: AppBar(
bottom: TabBar(
// isScrollable: true,
indicatorWeight: 5.0,
//indicatorSize: TabBarIndicatorSize.label,
// indicatorSize: TabBarIndicatorSize.tab,
indicatorColor: Theme.of(context).primaryColor,
// labelColor: Theme.of(context).primaryColor,
tabs: [
Tab(text: TranslationBase.of(context).general),
Tab(

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
import 'package:diplomaticquarterapp/widgets/buttons/secondary_button.dart';
@ -6,6 +7,7 @@ import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:flutter/cupertino.dart';
import 'package:provider/provider.dart';
import '../base/base_view.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/core/viewModels/vaccine_view_model.dart';
@ -22,6 +24,7 @@ class MyVaccines extends StatefulWidget {
class _MyVaccinesState extends State<MyVaccines> {
@override
Widget build(BuildContext context) {
ProjectViewModel projectViewModel = Provider.of(context);
return BaseView<VaccineViewModel>(
onModelReady: (model) => model.getVaccine(),
builder: (BuildContext context, VaccineViewModel model, Widget child) =>
@ -171,6 +174,7 @@ class _MyVaccinesState extends State<MyVaccines> {
Navigator.push(context, FadePage(page: MyVaccinesItemPage())),
),
),
if(projectViewModel.havePrivilege(27))
Container(
width: double.infinity,
// height: 80.0,

@ -258,7 +258,7 @@ class AuthProvider with ChangeNotifier {
sharedPref.setString(BLOOD_TYPE, localRes['PatientBloodType']);
return Future.value(localRes);
} catch (error) {
throw error;
throw localRes;
//return Future.value(error);
}
}

@ -1,14 +1,19 @@
import 'dart:async';
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart';
import 'package:provider/provider.dart';
import 'config/shared_pref_kay.dart';
import 'config/size_config.dart';
import 'core/service/AuthenticatedUserObject.dart';
import 'core/service/privilege_service.dart';
import 'core/viewModels/project_view_model.dart';
import 'locator.dart';
import 'models/Authentication/authenticated_user.dart';
import 'widgets/transitions/slide_up_page.dart';
AppSharedPreferences sharedPref = new AppSharedPreferences();
AuthenticatedUserObject authenticatedUserObject =
@ -20,38 +25,36 @@ class SplashScreen extends StatefulWidget {
}
class _SplashScreenState extends State<SplashScreen> {
//Provider.of<ProjectViewModel>(context, listen: false).isLogin
PrivilegeService _privilegeService = locator<PrivilegeService>();
@override
void initState() {
super.initState();
Timer(
Duration(seconds: 1, milliseconds: 500),
() {
Provider.of<ProjectViewModel>(context, listen: false).loadSharedPrefLanguage().then((value) {
Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (BuildContext context) => LandingPage(),
),
);
});
() {
loadPrivilege().then((value) {
Navigator.of(context).pushReplacement(
MaterialPageRoute(
builder: (BuildContext context) => LandingPage(),
),
);
});
},
);
}
Future getUserData() async {
Provider.of<ProjectViewModel>(context, listen: false).loadSharedPrefLanguage();
/// load the Privilege from service
Future loadPrivilege() async {
await _privilegeService.getPrivilege();
Provider.of<ProjectViewModel>(context, listen: false).setPrivilegeModelList(privilege: _privilegeService.privilegeModelList);
}
@override
Widget build(BuildContext context) {
return Scaffold(
backgroundColor: Colors.white,
body: Center(
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Image.asset('assets/images/DQ/DQ_logo.png'),
),
),
body: Image.asset('assets/images/powerd-by.jpg',fit: BoxFit.fitWidth,width: MediaQuery.of(context).size.width,),
);
}
}

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

Loading…
Cancel
Save