Merge branch 'development' of https://gitlab.com/Cloud_Solution/diplomatic-quarter into sultan-patientapp

merge-requests/341/head
Sultan Khan 3 years ago
commit c88bea4461

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

@ -313,6 +313,9 @@ const UPDATE_HEALTH_TERMS =
const GET_PATIENT_HEALTH_STATS =
'Services/Patients.svc/REST/Med_GetTransactionsSts';
const SEND_CHECK_IN_NFC_REQUEST =
'Services/Patients.svc/REST/Patient_CheckAppointmentValidation_ForNFC';
//URL to get medicine and pharmacies list
const CHANNEL = 3;
const GENERAL_ID = 'Cs2020@2016\$2958';

@ -466,6 +466,14 @@ const Map localizedValues = {
"ar":
" خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف). "
},
"parkingDescription": {
"en": "Parking service is for you to scan the car location so you can find it easy on you way out. click on (scan parking) button to save the parking location, then (show my park) button will appear to show you the way for the parking. if you want to rescan parking QR just click on (Clear My Data).",
"ar": "خدمة المواقف، تتيح هذه الخدمة للمستخدم معلومات عن موقف السيارة ليسهل عليه العودة لها لاحقاً ، 1- بالضغط على زر(قراءة الكود) تستطيع حفظ البيانات الخاصة بالموقف. 2-بالضغط على زر(عرض موقف سيارتي) يعرض لك موقع السيارة في خرائط قوقل. 3- لإعادة قراءة موقف آخرعن طريق الضغط على زر(مسح بيانات الموقف)."
},
"checkinOption": {"en": "Check-In Options", "ar": "تحقق في الخيارات"},
"readBarcode": {"en": "Read Barcode", "ar": "قراءة الكود"},
"showMyPark": {"en": "Show My Park", "ar": "عرض بارك"},
"clearMyData": {"en": "clear My Data", "ar": "امسح البيانات"},
@ -1081,6 +1089,7 @@ const Map localizedValues = {
},
"MoreDetails": {"en": "More details", "ar": " المزيد من التفاصيل "},
"SendCopy": {"en": "Send Copy", "ar": "ارسال نسخة"},
"ResendOrder": {"en": "Resend order & deliver", "ar": "إعادة طلب و توصيل"},
"Ports": {"en": "Ports", "ar": "المنافذ"},
"Way": {"en": "Way", "ar": "الطزيقة"},

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

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

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

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

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

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

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

@ -13,8 +13,10 @@ import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/nfc/nfc_reader_sheet.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:nfc_in_flutter/nfc_in_flutter.dart';
class QRCode extends StatefulWidget {
PatientShareResponse patientShareResponse;
@ -30,17 +32,27 @@ class QRCode extends StatefulWidget {
class _QRCodeState extends State<QRCode> {
Uint8List _bytes;
bool _supportsNFC = false;
BuildContext _context;
@override
void initState() {
// TODO: implement initState
_bytes = base64.decode(widget.appoQR.split(',').last);
widget.authUser = new AuthenticatedUser();
NFC.isNDEFSupported.then((supported) {
setState(() {
print("nfc supprted");
_supportsNFC = true;
});
});
super.initState();
}
@override
Widget build(BuildContext context) {
_context = context;
return AppScaffold(
appBarTitle: TranslationBase.of(context).attendRegisterCode,
isShowAppBar: true,
@ -51,9 +63,56 @@ class _QRCodeState extends State<QRCode> {
mainAxisSize: MainAxisSize.max,
children: <Widget>[
Container(
width: double.infinity,
height: MediaQuery.of(context).size.width / 3,
child: Row(
children: [
_supportsNFC
? Expanded(
flex: 1,
child: Row(
crossAxisAlignment: CrossAxisAlignment.center,
mainAxisAlignment: MainAxisAlignment.center,
children: [
InkWell(
child: Container(
margin: EdgeInsets.only(top: 30.0),
alignment: Alignment.center,
child: Image.memory(_bytes, scale: 0.5),
padding: EdgeInsets.all(8),
decoration: BoxDecoration(
border: Border.all(color: Colors.black),
borderRadius: BorderRadius.circular(10),
),
child: Image.asset(
"assets/images/nfc/ic_nfc.png"),
),
onTap: () {
showNfcReader(context,
onNcfScan: (String nfcId) {
Future.delayed(
const Duration(milliseconds: 100),
() {
sendNfcCheckInRequest(nfcId);
});
});
},
),
],
),
)
: Container(),
Expanded(
flex: 1,
child: Container(
margin: EdgeInsets.only(top: 30.0),
alignment: Alignment.center,
child: Image.memory(
_bytes,
),
),
),
],
),
),
Container(
margin: EdgeInsets.only(top: 20.0, left: 20.0, right: 20.0),
@ -70,19 +129,21 @@ class _QRCodeState extends State<QRCode> {
EdgeInsets.only(top: 10.0, left: 40.0, bottom: 10.0),
child: Image.asset(
"assets/images/new-design/device_icon.png",
width: 120.0,
height: 120.0),
width: MediaQuery.of(context).size.width / 3.4,
height: MediaQuery.of(context).size.width / 3.4),
),
Container(
width: MediaQuery.of(context).size.width * 0.5,
Expanded(
child: Container(
width: double.infinity,
margin: EdgeInsets.only(
top: 15.0, bottom: 10.0, left: 20.0, right: 20.0),
child: Text(TranslationBase.of(context).scanQRHospital,
style: TextStyle(
color: Colors.red[700],
fontSize: 20.0,
fontSize: 18.0,
fontWeight: FontWeight.bold)),
),
),
],
),
),
@ -300,4 +361,51 @@ class _QRCodeState extends State<QRCode> {
}
return docSpeciality;
}
sendNfcCheckInRequest(String nfcId) {
GifLoaderDialogUtils.showMyDialog(context);
DoctorsListService service = new DoctorsListService();
service
.sendCheckinNfcRequest(widget.patientShareResponse.appointmentNo, nfcId,
widget.patientShareResponse.projectID, context)
.then((res) {
print(res);
GifLoaderDialogUtils.hideDialog(context);
_showMyDialog(res["SuccessMsg"], this.context);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
_showMyDialog(err, this.context);
});
}
Future<void> _showMyDialog(String message, BuildContext context) async {
return showDialog<void>(
context: context,
barrierDismissible: true, // user must tap button!
builder: (BuildContext context) {
return AlertDialog(
title: const Text('Alert'),
content: SingleChildScrollView(
child: ListBody(
children: <Widget>[
Text(message),
],
),
),
actions: <Widget>[
TextButton(
child: const Text('OK'),
onPressed: () {
Navigator.of(context).pop();
},
),
],
);
},
);
}
}

@ -92,6 +92,12 @@ class _ToDoState extends State<ToDo> {
padding: EdgeInsets.all(0.0),
itemCount: widget.appoList.length,
itemBuilder: (context, index) {
print("ttt "+getNextActionImage(widget
.appoList[index]
.nextAction));
print("ttt "+widget
.appoList[index]
.nextAction.toString());
return Container(
margin: EdgeInsets.all(10.0),
child: Column(
@ -459,6 +465,10 @@ class _ToDoState extends State<ToDo> {
return "assets/images/new-design/waiting_for_doctor.png";
break;
case 90:
return "assets/images/new-design/check-in.png";
break;
default:
return "";
}
@ -480,6 +490,9 @@ class _ToDoState extends State<ToDo> {
break;
case 60:
break;
case 90:
getAppoQR(context, appo);
break;
}
}
@ -516,6 +529,10 @@ class _ToDoState extends State<ToDo> {
return TranslationBase.of(context).waitingForDoctor;
break;
case 90:
return TranslationBase.of(context).checkinOptions;
break;
default:
return "";
}

@ -24,23 +24,13 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
@override
Widget build(BuildContext context) {
imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/0.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/0.png'));
imagesInfo.add(ImagesInfo(
imageEn:
'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/1.png',
imageAr:
'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/1.png'));
imagesInfo
.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/0.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/0.png'));
imagesInfo
.add(ImagesInfo(imageEn: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/en/1.png', imageAr: 'https://hmgwebservices.com/Images/MobileApp/imges-info/apporvals/ar/1.png'));
return BaseView<InsuranceViewModel>(
onModelReady: widget.appointmentNo != null
? (model) =>
model.getInsuranceApproval(appointmentNo: widget.appointmentNo)
: (model) => model.getInsuranceApproval(),
builder: (BuildContext context, InsuranceViewModel model, Widget child) =>
AppScaffold(
onModelReady: widget.appointmentNo != null ? (model) => model.getInsuranceApproval(appointmentNo: widget.appointmentNo) : (model) => model.getInsuranceApproval(),
builder: (BuildContext context, InsuranceViewModel model, Widget child) => AppScaffold(
isShowAppBar: true,
baseViewModel: model,
appBarTitle: TranslationBase.of(context).approvals,
@ -73,21 +63,19 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
Container(
width: 60,
height: 40,
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.circular(19.0)),
decoration: BoxDecoration(color: Theme.of(context).primaryColor, borderRadius: BorderRadius.circular(19.0)),
child: Center(
child: Texts(
model.insuranceApproval[0].unUsedCount
.toString(),
color: Colors.white, fontSize: 17.0,
model.insuranceApproval[0].unUsedCount.toString(),
color: Colors.white,
fontSize: 17.0,
),
))
],
)),
...List.generate(
model.insuranceApproval.length,
(index) => RoundedContainer(
...List.generate(model.insuranceApproval.length, (index) {
print(model.insuranceApproval[index].isLiveCareAppointment);
return RoundedContainer(
backgroundColor: Colors.white,
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
@ -96,56 +84,24 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
title: Container(
//height: 120.0,
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
model.insuranceApproval[index].patientDescription == "In Patient"
? Container(
decoration: BoxDecoration(
color: Theme.of(context).primaryColor,
borderRadius:
BorderRadius.circular(
16.0)),
width: 115.0,
padding:
EdgeInsets.only(left: 11.5),
child: Center(
child: Texts(
TranslationBase.of(context).inPatient,
color: Colors.white,
),
),
)
: Container(
decoration: BoxDecoration(
color: Color(0xff505A5D),
borderRadius:
BorderRadius.circular(
16.0)),
width: 115.0,
padding:
EdgeInsets.only(left: 11.5),
child: Center(
child: Texts(
TranslationBase.of(context).outpatient,
color: Colors.white,
),
),
),
model.insuranceApproval[index].isLiveCareAppointment
? sideBadge(TranslationBase.of(context).liveCare, 0xffA9A089)
: model.insuranceApproval[index].isInOutPatient
? sideBadge(TranslationBase.of(context).outpatient, 0xff505a5d)
: sideBadge(TranslationBase.of(context).inPatient, 0xffb8372c),
Padding(
padding: EdgeInsets.symmetric(
vertical: 10.0),
padding: EdgeInsets.symmetric(vertical: 10.0),
child: Texts(
model.insuranceApproval[index]
.clinicName,
model.insuranceApproval[index].clinicName,
fontSize: 20.0,
color: Color(0xff60686B),
fontWeight: FontWeight.w600,
),
),
Texts(
model.insuranceApproval[index]
.doctorName,
model.insuranceApproval[index].doctorName,
fontSize: 17.0,
),
],
@ -153,11 +109,9 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
),
children: <Widget>[
Padding(
padding: EdgeInsets.symmetric(
vertical: 12.0, horizontal: 12.0),
padding: EdgeInsets.symmetric(vertical: 12.0, horizontal: 12.0),
child: Column(
crossAxisAlignment:
CrossAxisAlignment.start,
crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[
Row(
children: [
@ -165,9 +119,11 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
TranslationBase.of(context).approvalNo,
fontSize: 18.0,
),
Texts(model.insuranceApproval[index].approvalNo.toString(),
Texts(
model.insuranceApproval[index].approvalNo.toString(),
fontSize: 18.0,
fontWeight: FontWeight.w600,),
fontWeight: FontWeight.w600,
),
],
),
Divider(
@ -178,10 +134,12 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
Row(
children: [
Texts(
TranslationBase.of(context).procedureStatus ,
TranslationBase.of(context).procedureStatus,
fontSize: 17.5,
),
SizedBox(width: 12,),
SizedBox(
width: 12,
),
Texts(
model.insuranceApproval[index].approvalStatusDescption,
fontWeight: FontWeight.w600,
@ -238,16 +196,14 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
Row(
children: [
Texts(
TranslationBase.of(context).receiptOn ,
TranslationBase.of(context).receiptOn,
fontSize: 17.5,
fontWeight: FontWeight.w600,
),
Texts(
convertDateFormat(model.insuranceApproval[index].rceiptOn),
convertDateFormat(model.insuranceApproval[index].receiptOn),
fontSize: 17.5,
fontWeight: FontWeight.w600,
),
],
),
@ -262,13 +218,11 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
TranslationBase.of(context).expiryDate,
fontSize: 17.5,
fontWeight: FontWeight.w600,
),
Texts(
convertDateFormat(model.insuranceApproval[index].expiryDate),
fontSize: 17.5,
fontWeight: FontWeight.w600,
),
],
),
@ -279,37 +233,18 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
),
IntrinsicHeight(
child: Row(
crossAxisAlignment:
CrossAxisAlignment.center,
crossAxisAlignment: CrossAxisAlignment.center,
children: <Widget>[
Expanded(
flex: 1,
child: Column(
children: <Widget>[
Text(TranslationBase.of(
context)
.procedureName),
Text(TranslationBase.of(context).procedureName),
Padding(
padding: EdgeInsets.only(
top: SizeConfig
.heightMultiplier *
3.0),
padding: EdgeInsets.only(top: SizeConfig.heightMultiplier * 3.0),
child: Text(
model
.insuranceApproval[
index]
.approvalDetails ==
null
? ''
: model
.insuranceApproval[
index]
.approvalDetails
.procedureName,
style: TextStyle(
fontWeight:
FontWeight.w600,
fontSize: 15.5),
model.insuranceApproval[index].apporvalDetails?.procedureName ?? '',
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 15.5),
),
),
],
@ -324,31 +259,12 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
flex: 1,
child: Column(
children: <Widget>[
Text(TranslationBase.of(
context)
.procedureStatus),
Text(TranslationBase.of(context).procedureStatus),
Padding(
padding: EdgeInsets.only(
top: SizeConfig
.heightMultiplier *
3.0),
padding: EdgeInsets.only(top: SizeConfig.heightMultiplier * 3.0),
child: Text(
model
.insuranceApproval[
index]
.approvalDetails ==
null
? ''
: model
.insuranceApproval[
index]
.approvalDetails
.status,
style: TextStyle(
fontSize: 17.5,
fontWeight:
FontWeight
.w600),
model.insuranceApproval[index].apporvalDetails?.status ?? '',
style: TextStyle(fontSize: 17.5, fontWeight: FontWeight.w600),
),
),
],
@ -363,30 +279,12 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
flex: 1,
child: Column(
children: <Widget>[
Text(TranslationBase.of(
context)
.usageStatus),
Text(TranslationBase.of(context).usageStatus),
Padding(
padding: EdgeInsets.only(
top: SizeConfig
.heightMultiplier *
3.0),
padding: EdgeInsets.only(top: SizeConfig.heightMultiplier * 3.0),
child: Text(
model
.insuranceApproval[
index]
.approvalDetails ==
null
? ''
: model
.insuranceApproval[
index]
.approvalDetails
.isInvoicedDesc,
style: TextStyle(
fontWeight:
FontWeight.w600,
fontSize: 17.5),
model.insuranceApproval[index].apporvalDetails?.isInvoicedDesc ?? '',
style: TextStyle(fontWeight: FontWeight.w600, fontSize: 17.5),
),
),
],
@ -407,7 +305,8 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
),
],
),
)),
);
}),
],
),
),
@ -416,6 +315,22 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
);
}
Widget sideBadge(String title, int color) {
return Container(
decoration: BoxDecoration(
color: Color(color),
borderRadius: BorderRadius.circular(16.0),
),
width: 115.0,
padding: EdgeInsets.only(top: 1, bottom: 1),
alignment: Alignment.center,
child: Texts(
title,
color: Colors.white,
),
);
}
convertDateFormat(String Date) {
const start = "/Date(";
const end = "+0300)";
@ -423,13 +338,8 @@ class _InsuranceApprovalState extends State<InsuranceApproval> {
final startIndex = Date.indexOf(start);
final endIndex = Date.indexOf(end, startIndex + start.length);
var date = new DateTime.fromMillisecondsSinceEpoch(
int.parse(Date.substring(startIndex + start.length, endIndex)));
String newDate = date.year.toString() +
"-" +
date.month.toString().padLeft(2, '0') +
"-" +
date.day.toString().padLeft(2, '0');
var date = new DateTime.fromMillisecondsSinceEpoch(int.parse(Date.substring(startIndex + start.length, endIndex)));
String newDate = date.year.toString() + "-" + date.month.toString().padLeft(2, '0') + "-" + date.day.toString().padLeft(2, '0');
return newDate.toString();
}

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

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

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

@ -471,6 +471,8 @@ class TranslationBase {
String get medicalProfile =>
localizedValues['medicalProfile'][locale.languageCode];
String get parking => localizedValues['parking'][locale.languageCode];
String get parkingDescription => localizedValues['parkingDescription'][locale.languageCode];
String get checkinOptions => localizedValues['checkinOption'][locale.languageCode];
String get alhabiServices =>
localizedValues['alhabiServices'][locale.languageCode];
String get parkingTitle =>

@ -209,16 +209,11 @@ class Utils {
bool isLogin,
count}) {
List<Widget> medical = List();
if (projectViewModel.havePrivilege(5)) {
medical.add(InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: MyAppointments(),
),
);
},
onTap: () => projectViewModel.havePrivilege(5)
? Navigator.push(context, FadePage(page: MyAppointments()))
: null,
child: isLogin
? Stack(children: [
MedicalProfileItem(
@ -226,7 +221,7 @@ class Utils {
imagePath: 'my_appointment_icon.png',
subTitle: TranslationBase.of(context).myAppointmentsList,
hasBadge: true,
),
isEnable: projectViewModel.havePrivilege(5)),
Positioned(
right: 0.0,
child: Badge(
@ -238,8 +233,7 @@ class Utils {
badgeContent: Container(
padding: EdgeInsets.all(2.0),
child: Text(count.toString(),
style:
TextStyle(color: Colors.white, fontSize: 16.0)),
style: TextStyle(color: Colors.white, fontSize: 16.0)),
),
),
),
@ -249,9 +243,10 @@ class Utils {
imagePath: 'my_appointment_icon.png',
subTitle: TranslationBase.of(context).myAppointmentsList,
hasBadge: true,
isEnable: projectViewModel.havePrivilege(5),
),
));
}
if (projectViewModel.havePrivilege(10)) {
medical.add(InkWell(
onTap: () => Navigator.push(context, FadePage(page: LabsHomePage())),
@ -263,106 +258,97 @@ class Utils {
));
}
if (projectViewModel.havePrivilege(7)) {
medical.add(InkWell(
onTap: () =>
Navigator.push(context, FadePage(page: RadiologyHomePage())),
onTap: () => projectViewModel.havePrivilege(7)
? Navigator.push(context, FadePage(page: RadiologyHomePage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).radiology,
imagePath: 'radiology_icon.png',
subTitle: TranslationBase.of(context).radiologySubtitle,
isEnable: projectViewModel.havePrivilege(7),
),
));
}
if (projectViewModel.havePrivilege(12)) {
medical.add(InkWell(
onTap: () {
Navigator.push(
context,
FadePage(
page: HomePrescriptionsPage(),
),
);
},
onTap: () => projectViewModel.havePrivilege(12)
? Navigator.push(context, FadePage(page: HomePrescriptionsPage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).medicines,
imagePath: 'prescription_icon.png',
subTitle: TranslationBase.of(context).medicinesSubtitle,
isEnable: projectViewModel.havePrivilege(12),
),
));
}
if (projectViewModel.havePrivilege(25)) {
medical.add(InkWell(
onTap: () => Navigator.push(
onTap: () => projectViewModel.havePrivilege(25)
? Navigator.push(
context,
FadePage(
page: VitalSignDetailsScreen(),
),
),
FadePage(page: VitalSignDetailsScreen()),
)
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).vitalSigns,
imagePath: 'vital_signs.png',
subTitle: TranslationBase.of(context).vitalSignsSubtitle,
isEnable: projectViewModel.havePrivilege(25),
),
));
}
//if (projectViewModel.havePrivilege(48)) {
medical.add(InkWell(
onTap: () =>
Navigator.push(context, FadePage(page: ActiveMedicationsPage())),
onTap: () => projectViewModel.havePrivilege(48)
? Navigator.push(context, FadePage(page: ActiveMedicationsPage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).myMedical,
imagePath: 'active_medications.png',
subTitle: TranslationBase.of(context).myMedicalSubtitle,
isEnable: false,
),
));
//}
if (projectViewModel.havePrivilege(6)) {
medical.add(InkWell(
onTap: () {
Navigator.push(
onTap: () => projectViewModel.havePrivilege(6)
? Navigator.push(
context,
FadePage(
page: DoctorHomePage(),
),
);
},
)
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).myDoctor,
imagePath: 'doctor_icon.png',
subTitle: TranslationBase.of(context).myDoctorSubtitle,
),
isEnable: projectViewModel.havePrivilege(6)),
));
}
if (projectViewModel.havePrivilege(14)) {
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: EyeMeasurementsPage()));
},
onTap: () => projectViewModel.havePrivilege(14)
? Navigator.push(context, FadePage(page: EyeMeasurementsPage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).eye,
imagePath: 'eye_measurement_icon.png',
subTitle: TranslationBase.of(context).eyeSubtitle,
isEnable: projectViewModel.havePrivilege(14),
),
));
}
if (projectViewModel.havePrivilege(22)) {
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: InsuranceCard()));
},
onTap: () => projectViewModel.havePrivilege(22)
? Navigator.push(context, FadePage(page: InsuranceCard()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).insurance,
imagePath: 'insurance_card_icon.png',
subTitle: TranslationBase.of(context).insuranceSubtitle,
isEnable: projectViewModel.havePrivilege(22),
),
));
}
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: InsuranceUpdate()));
@ -374,137 +360,132 @@ class Utils {
),
));
if (projectViewModel.havePrivilege(18)) {
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: InsuranceApproval()));
},
onTap: () => projectViewModel.havePrivilege(18)
? Navigator.push(context, FadePage(page: InsuranceApproval()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).insuranceApproval,
imagePath: 'insurance_approvals_icon.png',
subTitle: TranslationBase.of(context).insuranceApprovalSubtitle,
isEnable: projectViewModel.havePrivilege(18),
),
));
}
if (projectViewModel.havePrivilege(23)) {
medical.add(InkWell(
onTap: () => Navigator.push(context, FadePage(page: AllergiesPage())),
onTap: () => projectViewModel.havePrivilege(23)
? Navigator.push(context, FadePage(page: AllergiesPage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).allergies,
imagePath: 'my_allergies_icon.png',
subTitle: TranslationBase.of(context).allergiesSubtitle,
isEnable: projectViewModel.havePrivilege(23),
),
));
}
if (projectViewModel.havePrivilege(26)) {
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: MyVaccines()));
},
onTap: () => projectViewModel.havePrivilege(26)
? Navigator.push(context, FadePage(page: MyVaccines()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).myVaccines,
imagePath: 'my_vaccines_icon.png',
subTitle: TranslationBase.of(context).myVaccinesSubtitle,
isEnable: projectViewModel.havePrivilege(26),
),
));
}
if (projectViewModel.havePrivilege(20))
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: HomeReportPage()));
},
onTap: () => projectViewModel.havePrivilege(20)
? Navigator.push(context, FadePage(page: HomeReportPage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).medical,
imagePath: 'medical_reports_icon.png',
subTitle: TranslationBase.of(context).medicalSubtitle,
isEnable: projectViewModel.havePrivilege(20),
),
));
if (projectViewModel.havePrivilege(19)) {
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: MonthlyReportsPage()));
},
onTap: () => projectViewModel.havePrivilege(19)
? Navigator.push(context, FadePage(page: MonthlyReportsPage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).monthly,
imagePath: 'monthly_reports_icon.png',
subTitle: TranslationBase.of(context).monthlySubtitle,
isEnable: projectViewModel.havePrivilege(19),
),
));
}
if (projectViewModel.havePrivilege(16)) {
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: PatientSickLeavePage()));
},
onTap: () => projectViewModel.havePrivilege(16)
? Navigator.push(context, FadePage(page: PatientSickLeavePage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).sick,
imagePath: 'sick_leaves_icons.png',
subTitle: TranslationBase.of(context).sickSubtitle,
isEnable: projectViewModel.havePrivilege(16),
),
));
}
if (projectViewModel.havePrivilege(47)) {
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: MyBalancePage()));
},
onTap: () => projectViewModel.havePrivilege(47)
? Navigator.push(context, FadePage(page: MyBalancePage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).myBalance,
imagePath: 'check-in.png',
subTitle: TranslationBase.of(context).myBalanceSubtitle,
isEnable: projectViewModel.havePrivilege(47),
),
));
}
if (projectViewModel.havePrivilege(61)) {
medical.add(MedicalProfileItem(
title: TranslationBase.of(context).patientCall,
imagePath: 'medical_history_icon.png',
subTitle: TranslationBase.of(context).patientCallSubtitle,
isEnable: projectViewModel.havePrivilege(61),
));
}
if (projectViewModel.havePrivilege(24)) {
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: MyTrackers()));
},
onTap: () => projectViewModel.havePrivilege(24)
? Navigator.push(context, FadePage(page: MyTrackers()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).myTrackers,
imagePath: 'my_tracker_icon.png',
subTitle: TranslationBase.of(context).myTrackersSubtitle,
isEnable: projectViewModel.havePrivilege(24),
),
));
}
if (projectViewModel.havePrivilege(30))
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: SmartWatchInstructions()));
},
onTap: () => projectViewModel.havePrivilege(30)
? Navigator.push(context, FadePage(page: SmartWatchInstructions()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).smartWatches,
imagePath: 'smartwatch_icon.png',
subTitle: TranslationBase.of(context).smartWatchesSubtitle,
isEnable: projectViewModel.havePrivilege(30),
),
));
if (projectViewModel.havePrivilege(28)) {
medical.add(InkWell(
onTap: () {
Navigator.push(context, FadePage(page: AskDoctorHomPage()));
},
onTap: () => projectViewModel.havePrivilege(28)
? Navigator.push(context, FadePage(page: AskDoctorHomPage()))
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).askYour,
imagePath: 'ask_doctor_icon.png',
subTitle: TranslationBase.of(context).askYourSubtitle,
),
isEnable: projectViewModel.havePrivilege(28)),
));
}
if (projectViewModel.havePrivilege(32) || true) {
medical.add(InkWell(
onTap: () {
@ -536,18 +517,17 @@ class Utils {
));
}
if (projectViewModel.havePrivilege(40)) {
medical.add(InkWell(
onTap: () {
launch('whatsapp://send?phone=18885521858&text=');
},
onTap: () => projectViewModel.havePrivilege(40)
? launch('whatsapp://send?phone=18885521858&text=')
: null,
child: MedicalProfileItem(
title: TranslationBase.of(context).chatbot,
imagePath: 'insurance_approvals_icon.png',
subTitle: TranslationBase.of(context).chatbotSubtitle,
isEnable: projectViewModel.havePrivilege(40),
),
));
}
return medical;
}

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

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

@ -21,17 +21,17 @@ var _InAppBrowserOptions = InAppBrowserClassOptions(
class MyInAppBrowser extends InAppBrowser {
_PAYMENT_TYPE paymentType;
// static String SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL =
'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
// static String PREAUTH_SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
// static String SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
static String PREAUTH_SERVICE_URL =
'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
// static String PREAUTH_SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
// static String PRESCRIPTION_PAYMENT_WITH_ORDERID =
// 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=';

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

@ -171,6 +171,7 @@ dependencies:
wifi: ^0.1.5
vibration: ^1.7.3
nfc_in_flutter: ^2.0.5
speech_to_text:
path: speech_to_text
@ -220,6 +221,7 @@ flutter:
- assets/images/gif/
- assets/images/pharmacy_module/payment/
- assets/images/pharmacy_module/lakum/
- assets/images/nfc/
fonts:

Loading…
Cancel
Save