Merge branch 'development' into ZohaibIqbalKambrani

* development:
  BUG FIXES
  fix issues  PAP-910,PAP-911
  fix bugs pharmacy
  Dental procedures implemented
  Revert "Merge branch 'foote_in_all_pages' into 'development'"
  fixed products issues
  calendar events changes
  Covid passport CR implemented in Covid test flow
  doctor schedule
  Covid certificate passport CR implemented
  Covid Lab result generate certificate implemented
  return bottom sheet inside appointments list
  fix issues related to footer
  remove unused code
  remove footer from pharmacy pages
  first step from add footer for all pages

# Conflicts:
#	lib/config/localized_values.dart
#	lib/uitl/translations_delegate_base.dart
merge-update-with-lab-changes
Zohaib Iqbal Kambrani 5 years ago
commit d9672c47a0

@ -79,6 +79,12 @@ const GET_Patient_LAB_RESULT =
'Services/Patients.svc/REST/GetPatientLabResults'; 'Services/Patients.svc/REST/GetPatientLabResults';
const GET_Patient_LAB_ORDERS_RESULT = const GET_Patient_LAB_ORDERS_RESULT =
'Services/Patients.svc/REST/GetPatientLabOrdersResults'; 'Services/Patients.svc/REST/GetPatientLabOrdersResults';
const SEND_COVID_LAB_RESULT_EMAIL =
'Services/Notifications.svc/REST/GenerateCOVIDReport';
const COVID_PASSPORT_UPDATE =
'Services/Patients.svc/REST/Covid19_Certificate_PassportUpdate';
const GET_PATIENT_PASSPORT_NUMBER =
'Services/Patients.svc/REST/Covid19_Certificate_GetPassport';
/// ///
const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders'; const GET_PATIENT_ORDERS = 'Services/Patients.svc/REST/GetPatientRadOrders';
@ -332,6 +338,9 @@ const GET_PATIENT_HEALTH_STATS =
const SEND_CHECK_IN_NFC_REQUEST = const SEND_CHECK_IN_NFC_REQUEST =
'Services/Patients.svc/REST/Patient_CheckAppointmentValidation_ForNFC'; 'Services/Patients.svc/REST/Patient_CheckAppointmentValidation_ForNFC';
const HAS_DENTAL_PLAN =
'Services/Doctors.svc/REST/Dental_IsPatientHasOnGoingEstimation';
//URL to get medicine and pharmacies list //URL to get medicine and pharmacies list
const CHANNEL = 3; const CHANNEL = 3;
const GENERAL_ID = 'Cs2020@2016\$2958'; const GENERAL_ID = 'Cs2020@2016\$2958';
@ -499,7 +508,8 @@ const GET_DOCTOR_LIST_BY_TIME = "Services/Doctors.svc/REST/SearchDoctorsByTime";
const PHARMACY_AUTORZIE_CUSTOMER = "AutorizeCustomer"; const PHARMACY_AUTORZIE_CUSTOMER = "AutorizeCustomer";
const PHARMACY_VERIFY_CUSTOMER = "VerifyCustomer"; const PHARMACY_VERIFY_CUSTOMER = "VerifyCustomer";
const PHARMACY_GET_COUNTRY = "countries"; const PHARMACY_GET_COUNTRY = "countries";
const PHARMACY_CREATE_CUSTOMER = "epharmacy/api/CreateCustomer"; // const PHARMACY_CREATE_CUSTOMER = "epharmacy/api/CreateCustomer";
const PHARMACY_CREATE_CUSTOMER = "epharmacy/api/getorcreateCustomer";
const GET_PHARMACY_BANNER = "promotionbanners"; const GET_PHARMACY_BANNER = "promotionbanners";
const GET_PHARMACY_TOP_MANUFACTURER = "topmanufacturer"; const GET_PHARMACY_TOP_MANUFACTURER = "topmanufacturer";
const GET_PHARMACY_BEST_SELLER_PRODUCT = "bestsellerproducts"; const GET_PHARMACY_BEST_SELLER_PRODUCT = "bestsellerproducts";

File diff suppressed because it is too large Load Diff

@ -32,3 +32,4 @@ const PHARMACY_AUTORZIE_TOKEN = 'PHARMACY_AUTORZIE_TOKEN';
const H2O_UNIT = 'H2O_UNIT'; const H2O_UNIT = 'H2O_UNIT';
const H2O_REMINDER = 'H2O_REMINDER'; const H2O_REMINDER = 'H2O_REMINDER';
const LIVECARE_CLINIC_DATA = 'LIVECARE_CLINIC_DATA'; const LIVECARE_CLINIC_DATA = 'LIVECARE_CLINIC_DATA';
const DOCTOR_SCHEDULE_DATE_SEL = 'DOCTOR_SCHEDULE_DATE_SEL';

@ -1,57 +1,81 @@
class LabResultList {
String filterName = "";
List<LabResult> patientLabResultList = List();
LabResultList({this.filterName, LabResult lab}) {
patientLabResultList.add(lab);
}
}
class LabResult { class LabResult {
String description; String description;
dynamic femaleInterpretativeData; Null femaleInterpretativeData;
int gender; int gender;
bool isCertificateAllowed;
int lineItemNo; int lineItemNo;
dynamic maleInterpretativeData; Null maleInterpretativeData;
String notes; Null notes;
int orderLineItemNo;
int orderNo;
String packageID; String packageID;
int patientID; int patientID;
String projectID; String projectID;
String referanceRange; String referanceRange;
String resultValue; String resultValue;
int resultValueBasedLineItemNo;
String resultValueFlag;
String sampleCollectedOn; String sampleCollectedOn;
String sampleReceivedOn; String sampleReceivedOn;
String setupID; String setupID;
dynamic superVerifiedOn; Null superVerifiedOn;
String testCode; String testCode;
String uOM; String uOM;
String verifiedOn; String verifiedOn;
dynamic verifiedOnDateTime; Null verifiedOnDateTime;
LabResult( LabResult(
{this.description, {this.description,
this.femaleInterpretativeData, this.femaleInterpretativeData,
this.gender, this.gender,
this.lineItemNo, this.isCertificateAllowed,
this.maleInterpretativeData, this.lineItemNo,
this.notes, this.maleInterpretativeData,
this.packageID, this.notes,
this.patientID, this.orderLineItemNo,
this.projectID, this.orderNo,
this.referanceRange, this.packageID,
this.resultValue, this.patientID,
this.sampleCollectedOn, this.projectID,
this.sampleReceivedOn, this.referanceRange,
this.setupID, this.resultValue,
this.superVerifiedOn, this.resultValueBasedLineItemNo,
this.testCode, this.resultValueFlag,
this.uOM, this.sampleCollectedOn,
this.verifiedOn, this.sampleReceivedOn,
this.verifiedOnDateTime}); this.setupID,
this.superVerifiedOn,
this.testCode,
this.uOM,
this.verifiedOn,
this.verifiedOnDateTime});
LabResult.fromJson(Map<String, dynamic> json) { LabResult.fromJson(Map<String, dynamic> json) {
description = json['Description']; description = json['Description'];
femaleInterpretativeData = json['FemaleInterpretativeData']; femaleInterpretativeData = json['FemaleInterpretativeData'];
gender = json['Gender']; gender = json['Gender'];
isCertificateAllowed = json['IsCertificateAllowed'];
lineItemNo = json['LineItemNo']; lineItemNo = json['LineItemNo'];
maleInterpretativeData = json['MaleInterpretativeData']; maleInterpretativeData = json['MaleInterpretativeData'];
notes = json['Notes']; notes = json['Notes'];
orderLineItemNo = json['OrderLineItemNo'];
orderNo = json['OrderNo'];
packageID = json['PackageID']; packageID = json['PackageID'];
patientID = json['PatientID']; patientID = json['PatientID'];
projectID = json['ProjectID']; projectID = json['ProjectID'];
referanceRange = json['ReferanceRange']; referanceRange = json['ReferanceRange'];
resultValue = json['ResultValue']; resultValue = json['ResultValue'];
resultValueBasedLineItemNo = json['ResultValueBasedLineItemNo'];
resultValueFlag = json['ResultValueFlag'];
sampleCollectedOn = json['SampleCollectedOn']; sampleCollectedOn = json['SampleCollectedOn'];
sampleReceivedOn = json['SampleReceivedOn']; sampleReceivedOn = json['SampleReceivedOn'];
setupID = json['SetupID']; setupID = json['SetupID'];
@ -67,14 +91,19 @@ class LabResult {
data['Description'] = this.description; data['Description'] = this.description;
data['FemaleInterpretativeData'] = this.femaleInterpretativeData; data['FemaleInterpretativeData'] = this.femaleInterpretativeData;
data['Gender'] = this.gender; data['Gender'] = this.gender;
data['IsCertificateAllowed'] = this.isCertificateAllowed;
data['LineItemNo'] = this.lineItemNo; data['LineItemNo'] = this.lineItemNo;
data['MaleInterpretativeData'] = this.maleInterpretativeData; data['MaleInterpretativeData'] = this.maleInterpretativeData;
data['Notes'] = this.notes; data['Notes'] = this.notes;
data['OrderLineItemNo'] = this.orderLineItemNo;
data['OrderNo'] = this.orderNo;
data['PackageID'] = this.packageID; data['PackageID'] = this.packageID;
data['PatientID'] = this.patientID; data['PatientID'] = this.patientID;
data['ProjectID'] = this.projectID; data['ProjectID'] = this.projectID;
data['ReferanceRange'] = this.referanceRange; data['ReferanceRange'] = this.referanceRange;
data['ResultValue'] = this.resultValue; data['ResultValue'] = this.resultValue;
data['ResultValueBasedLineItemNo'] = this.resultValueBasedLineItemNo;
data['ResultValueFlag'] = this.resultValueFlag;
data['SampleCollectedOn'] = this.sampleCollectedOn; data['SampleCollectedOn'] = this.sampleCollectedOn;
data['SampleReceivedOn'] = this.sampleReceivedOn; data['SampleReceivedOn'] = this.sampleReceivedOn;
data['SetupID'] = this.setupID; data['SetupID'] = this.setupID;
@ -86,13 +115,3 @@ class LabResult {
return data; return data;
} }
} }
class LabResultList {
String filterName = "";
List<LabResult> patientLabResultList = List();
LabResultList({this.filterName, LabResult lab}) {
patientLabResultList.add(lab);
}
}

@ -1,247 +1,251 @@
class RecommendedProductModel { class RecommendedProductModel {
List<Products> products; dynamic id;
RecommendedProductModel({this.products});
RecommendedProductModel.fromJson(Map<String, dynamic> json) {
if (json['products'] != null) {
products = new List<Products>();
json['products'].forEach((v) {
products.add(new Products.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.products != null) {
data['products'] = this.products.map((v) => v.toJson()).toList();
}
return data;
}
}
class Products {
String id;
bool visibleIndividually; bool visibleIndividually;
String name; dynamic name;
String namen; dynamic namen;
String shortDescription; List<LocalizedNames> localizedNames;
String shortDescriptionn; dynamic shortDescription;
String fullDescription; dynamic shortDescriptionn;
String fullDescriptionn; dynamic fullDescription;
dynamic fullDescriptionn;
bool markasNew; bool markasNew;
bool showOnHomePage; bool showOnHomePage;
dynamic metaKeywords; // dynamic metaKeywords;
dynamic metaDescription; // dynamic metaDescription;
dynamic metaTitle; // dynamic metaTitle;
bool allowCustomerReviews; bool allowCustomerReviews;
dynamic approvedRatingSum; int approvedRatingSum;
dynamic notApprovedRatingSum; int notApprovedRatingSum;
dynamic approvedTotalReviews; int approvedTotalReviews;
dynamic notApprovedTotalReviews; int notApprovedTotalReviews;
String sku; String sku;
bool isRx; bool isRx;
bool prescriptionRequired; bool prescriptionRequired;
dynamic rxMessage; // dynamic rxMessage;
dynamic rxMessagen; // dynamic rxMessagen;
dynamic manufacturerPartNumber; // dynamic manufacturerPartNumber;
dynamic gtin; // dynamic gtin;
bool isGiftCard; bool isGiftCard;
bool requireOtherProducts; bool requireOtherProducts;
bool automaticallyAddRequiredProducts; bool automaticallyAddRequiredProducts;
bool isDownload; bool isDownload;
bool unlimitedDownloads; bool unlimitedDownloads;
dynamic maxNumberOfDownloads; int maxNumberOfDownloads;
dynamic downloadExpirationDays; // dynamic downloadExpirationDays;
bool hasSampleDownload; bool hasSampleDownload;
bool hasUserAgreement; bool hasUserAgreement;
bool isRecurring; bool isRecurring;
dynamic recurringCycleLength; int recurringCycleLength;
dynamic recurringTotalCycles; int recurringTotalCycles;
bool isRental; bool isRental;
dynamic rentalPriceLength; int rentalPriceLength;
bool isShipEnabled; bool isShipEnabled;
bool isFreeShipping; bool isFreeShipping;
bool shipSeparately; bool shipSeparately;
dynamic additionalShippingCharge; int additionalShippingCharge;
bool isTaxExempt; bool isTaxExempt;
bool isTelecommunicationsOrBroadcastingOrElectronicServices; bool isTelecommunicationsOrBroadcastingOrElectronicServices;
bool useMultipleWarehouses; bool useMultipleWarehouses;
dynamic manageInventoryMethodId; int manageInventoryMethodId;
dynamic stockQuantity; int stockQuantity;
String stockAvailability; dynamic stockAvailability;
String stockAvailabilityn; dynamic stockAvailabilityn;
bool displayStockAvailability; bool displayStockAvailability;
bool displayStockQuantity; bool displayStockQuantity;
dynamic minStockQuantity; int minStockQuantity;
dynamic notifyAdminForQuantityBelow; int notifyAdminForQuantityBelow;
bool allowBackInStockSubscriptions; bool allowBackInStockSubscriptions;
dynamic orderMinimumQuantity; int orderMinimumQuantity;
dynamic orderMaximumQuantity; int orderMaximumQuantity;
dynamic allowedQuantities; // Null allowedQuantities;
bool allowAddingOnlyExistingAttributeCombinations; bool allowAddingOnlyExistingAttributeCombinations;
bool disableBuyButton; bool disableBuyButton;
bool disableWishlistButton; bool disableWishlistButton;
bool availableForPreOrder; bool availableForPreOrder;
dynamic preOrderAvailabilityStartDateTimeUtc; // dynamic preOrderAvailabilityStartDateTimeUtc;
bool callForPrice; bool callForPrice;
dynamic price; double price;
dynamic oldPrice; int oldPrice;
dynamic productCost; double productCost;
dynamic specialPrice; // dynamic specialPrice;
dynamic specialPriceStartDateTimeUtc; // dynamic specialPriceStartDateTimeUtc;
dynamic specialPriceEndDateTimeUtc; // dynamic specialPriceEndDateTimeUtc;
bool customerEntersPrice; bool customerEntersPrice;
dynamic minimumCustomerEnteredPrice; int minimumCustomerEnteredPrice;
dynamic maximumCustomerEnteredPrice; int maximumCustomerEnteredPrice;
bool basepriceEnabled; bool basepriceEnabled;
dynamic basepriceAmount; int basepriceAmount;
dynamic basepriceBaseAmount; int basepriceBaseAmount;
bool hasTierPrices; bool hasTierPrices;
bool hasDiscountsApplied; bool hasDiscountsApplied;
dynamic discountName; // dynamic discountName;
dynamic discountNamen; // dynamic discountNamen;
dynamic discountDescription; // dynamic discountDescription;
dynamic discountDescriptionn; // dynamic discountDescriptionn;
dynamic discountPercentage; // dynamic discountPercentage;
String currency; dynamic currency;
String currencyn; dynamic currencyn;
double weight; double weight;
dynamic length; int length;
dynamic width; int width;
dynamic height; int height;
dynamic availableStartDateTimeUtc; // dynamic availableStartDateTimeUtc;
dynamic availableEndDateTimeUtc; // dynamic availableEndDateTimeUtc;
dynamic displayOrder; int displayOrder;
bool published; bool published;
bool deleted; bool deleted;
String createdOnUtc; dynamic createdOnUtc;
String updatedOnUtc; dynamic updatedOnUtc;
String productType; dynamic productType;
dynamic parentGroupedProductId; int parentGroupedProductId;
dynamic vendorId; // List<dynamic> roleIds;
String seName; // List<dynamic> discountIds;
// List<dynamic> storeIds;
List<int> manufacturerIds;
// List<dynamic> reviews;
List<Images> images; List<Images> images;
// List<dynamic> attributes;
List<Specifications> specifications;
// List<dynamic> associatedProductIds;
// List<dynamic> tags;
int vendorId;
dynamic seName;
bool isinwishlist;
Products({ RecommendedProductModel(
this.id, {this.id,
this.visibleIndividually, this.visibleIndividually,
this.name, this.name,
this.namen, this.namen,
this.shortDescription, this.localizedNames,
this.shortDescriptionn, this.shortDescription,
this.fullDescription, this.shortDescriptionn,
this.fullDescriptionn, this.fullDescription,
this.markasNew, this.fullDescriptionn,
this.showOnHomePage, this.markasNew,
this.metaKeywords, this.showOnHomePage,
this.metaDescription, // this.metaKeywords,
this.metaTitle, // this.metaDescription,
this.allowCustomerReviews, // this.metaTitle,
this.approvedRatingSum, this.allowCustomerReviews,
this.notApprovedRatingSum, this.approvedRatingSum,
this.approvedTotalReviews, this.notApprovedRatingSum,
this.notApprovedTotalReviews, this.approvedTotalReviews,
this.sku, this.notApprovedTotalReviews,
this.isRx, this.sku,
this.prescriptionRequired, this.isRx,
this.rxMessage, this.prescriptionRequired,
this.rxMessagen, // this.rxMessage,
this.manufacturerPartNumber, // this.rxMessagen,
this.gtin, // this.manufacturerPartNumber,
this.isGiftCard, // this.gtin,
this.requireOtherProducts, this.isGiftCard,
this.automaticallyAddRequiredProducts, this.requireOtherProducts,
this.isDownload, this.automaticallyAddRequiredProducts,
this.unlimitedDownloads, this.isDownload,
this.maxNumberOfDownloads, this.unlimitedDownloads,
this.downloadExpirationDays, this.maxNumberOfDownloads,
this.hasSampleDownload, // this.downloadExpirationDays,
this.hasUserAgreement, this.hasSampleDownload,
this.isRecurring, this.hasUserAgreement,
this.recurringCycleLength, this.isRecurring,
this.recurringTotalCycles, this.recurringCycleLength,
this.isRental, this.recurringTotalCycles,
this.rentalPriceLength, this.isRental,
this.isShipEnabled, this.rentalPriceLength,
this.isFreeShipping, this.isShipEnabled,
this.shipSeparately, this.isFreeShipping,
this.additionalShippingCharge, this.shipSeparately,
this.isTaxExempt, this.additionalShippingCharge,
this.isTelecommunicationsOrBroadcastingOrElectronicServices, this.isTaxExempt,
this.useMultipleWarehouses, this.isTelecommunicationsOrBroadcastingOrElectronicServices,
this.manageInventoryMethodId, this.useMultipleWarehouses,
this.stockQuantity, this.manageInventoryMethodId,
this.stockAvailability, this.stockQuantity,
this.stockAvailabilityn, this.stockAvailability,
this.displayStockAvailability, this.stockAvailabilityn,
this.displayStockQuantity, this.displayStockAvailability,
this.minStockQuantity, this.displayStockQuantity,
this.notifyAdminForQuantityBelow, this.minStockQuantity,
this.allowBackInStockSubscriptions, this.notifyAdminForQuantityBelow,
this.orderMinimumQuantity, this.allowBackInStockSubscriptions,
this.orderMaximumQuantity, this.orderMinimumQuantity,
this.allowedQuantities, this.orderMaximumQuantity,
this.allowAddingOnlyExistingAttributeCombinations, // this.allowedQuantities,
this.disableBuyButton, this.allowAddingOnlyExistingAttributeCombinations,
this.disableWishlistButton, this.disableBuyButton,
this.availableForPreOrder, this.disableWishlistButton,
this.preOrderAvailabilityStartDateTimeUtc, this.availableForPreOrder,
this.callForPrice, // this.preOrderAvailabilityStartDateTimeUtc,
this.price, this.callForPrice,
this.oldPrice, this.price,
this.productCost, this.oldPrice,
this.specialPrice, this.productCost,
this.specialPriceStartDateTimeUtc, // this.specialPrice,
this.specialPriceEndDateTimeUtc, // this.specialPriceStartDateTimeUtc,
this.customerEntersPrice, // this.specialPriceEndDateTimeUtc,
this.minimumCustomerEnteredPrice, this.customerEntersPrice,
this.maximumCustomerEnteredPrice, this.minimumCustomerEnteredPrice,
this.basepriceEnabled, this.maximumCustomerEnteredPrice,
this.basepriceAmount, this.basepriceEnabled,
this.basepriceBaseAmount, this.basepriceAmount,
this.hasTierPrices, this.basepriceBaseAmount,
this.hasDiscountsApplied, this.hasTierPrices,
this.discountName, this.hasDiscountsApplied,
this.discountNamen, // this.discountName,
this.discountDescription, // this.discountNamen,
this.discountDescriptionn, // this.discountDescription,
this.discountPercentage, // this.discountDescriptionn,
this.currency, // this.discountPercentage,
this.currencyn, this.currency,
this.weight, this.currencyn,
this.length, this.weight,
this.width, this.length,
this.height, this.width,
this.availableStartDateTimeUtc, this.height,
this.availableEndDateTimeUtc, // this.availableStartDateTimeUtc,
this.displayOrder, // this.availableEndDateTimeUtc,
this.published, this.displayOrder,
this.deleted, this.published,
this.createdOnUtc, this.deleted,
this.updatedOnUtc, this.createdOnUtc,
this.productType, this.updatedOnUtc,
this.parentGroupedProductId, this.productType,
this.vendorId, this.parentGroupedProductId,
this.seName, // this.roleIds,
this.images, // this.discountIds,
}); // this.storeIds,
this.manufacturerIds,
// this.reviews,
this.images,
// this.attributes,
this.specifications,
// this.associatedProductIds,
// this.tags,
this.vendorId,
this.seName,
this.isinwishlist});
Products.fromJson(Map<String, dynamic> json) { RecommendedProductModel.fromJson(Map<String, dynamic> json) {
id = json['id']; id = json['id'];
visibleIndividually = json['visible_individually']; visibleIndividually = json['visible_individually'];
name = json['name']; name = json['name'];
namen = json['namen']; namen = json['namen'];
if (json['localized_names'] != null) {
localizedNames = new List<LocalizedNames>();
json['localized_names'].forEach((v) {
localizedNames.add(new LocalizedNames.fromJson(v));
});
}
shortDescription = json['short_description']; shortDescription = json['short_description'];
shortDescriptionn = json['short_descriptionn']; shortDescriptionn = json['short_descriptionn'];
fullDescription = json['full_description']; fullDescription = json['full_description'];
fullDescriptionn = json['full_descriptionn']; fullDescriptionn = json['full_descriptionn'];
markasNew = json['markas_new']; markasNew = json['markas_new'];
showOnHomePage = json['show_on_home_page']; showOnHomePage = json['show_on_home_page'];
metaKeywords = json['meta_keywords']; // metaKeywords = json['meta_keywords'];
metaDescription = json['meta_description']; // metaDescription = json['meta_description'];
metaTitle = json['meta_title']; // metaTitle = json['meta_title'];
allowCustomerReviews = json['allow_customer_reviews']; allowCustomerReviews = json['allow_customer_reviews'];
approvedRatingSum = json['approved_rating_sum']; approvedRatingSum = json['approved_rating_sum'];
notApprovedRatingSum = json['not_approved_rating_sum']; notApprovedRatingSum = json['not_approved_rating_sum'];
@ -250,18 +254,18 @@ class Products {
sku = json['sku']; sku = json['sku'];
isRx = json['is_rx']; isRx = json['is_rx'];
prescriptionRequired = json['prescription_required']; prescriptionRequired = json['prescription_required'];
rxMessage = json['rx_message']; // rxMessage = json['rx_message'];
rxMessagen = json['rx_messagen']; // rxMessagen = json['rx_messagen'];
manufacturerPartNumber = json['manufacturer_part_number']; // manufacturerPartNumber = json['manufacturer_part_number'];
gtin = json['gtin']; // gtin = json['gtin'];
isGiftCard = json['is_gift_card']; isGiftCard = json['is_gift_card'];
requireOtherProducts = json['require_other_products']; requireOtherProducts = json['require_other_products'];
automaticallyAddRequiredProducts = automaticallyAddRequiredProducts =
json['automatically_add_required_products']; json['automatically_add_required_products'];
isDownload = json['is_download']; isDownload = json['is_download'];
unlimitedDownloads = json['unlimited_downloads']; unlimitedDownloads = json['unlimited_downloads'];
maxNumberOfDownloads = json['max_number_of_downloads']; maxNumberOfDownloads = json['max_number_of_downloads'];
downloadExpirationDays = json['download_expiration_days']; // downloadExpirationDays = json['download_expiration_days'];
hasSampleDownload = json['has_sample_download']; hasSampleDownload = json['has_sample_download'];
hasUserAgreement = json['has_user_agreement']; hasUserAgreement = json['has_user_agreement'];
isRecurring = json['is_recurring']; isRecurring = json['is_recurring'];
@ -275,7 +279,7 @@ class Products {
additionalShippingCharge = json['additional_shipping_charge']; additionalShippingCharge = json['additional_shipping_charge'];
isTaxExempt = json['is_tax_exempt']; isTaxExempt = json['is_tax_exempt'];
isTelecommunicationsOrBroadcastingOrElectronicServices = isTelecommunicationsOrBroadcastingOrElectronicServices =
json['is_telecommunications_or_broadcasting_or_electronic_services']; json['is_telecommunications_or_broadcasting_or_electronic_services'];
useMultipleWarehouses = json['use_multiple_warehouses']; useMultipleWarehouses = json['use_multiple_warehouses'];
manageInventoryMethodId = json['manage_inventory_method_id']; manageInventoryMethodId = json['manage_inventory_method_id'];
stockQuantity = json['stock_quantity']; stockQuantity = json['stock_quantity'];
@ -288,21 +292,21 @@ class Products {
allowBackInStockSubscriptions = json['allow_back_in_stock_subscriptions']; allowBackInStockSubscriptions = json['allow_back_in_stock_subscriptions'];
orderMinimumQuantity = json['order_minimum_quantity']; orderMinimumQuantity = json['order_minimum_quantity'];
orderMaximumQuantity = json['order_maximum_quantity']; orderMaximumQuantity = json['order_maximum_quantity'];
allowedQuantities = json['allowed_quantities']; // allowedQuantities = json['allowed_quantities'];
allowAddingOnlyExistingAttributeCombinations = allowAddingOnlyExistingAttributeCombinations =
json['allow_adding_only_existing_attribute_combinations']; json['allow_adding_only_existing_attribute_combinations'];
disableBuyButton = json['disable_buy_button']; disableBuyButton = json['disable_buy_button'];
disableWishlistButton = json['disable_wishlist_button']; disableWishlistButton = json['disable_wishlist_button'];
availableForPreOrder = json['available_for_pre_order']; availableForPreOrder = json['available_for_pre_order'];
preOrderAvailabilityStartDateTimeUtc = // preOrderAvailabilityStartDateTimeUtc =
json['pre_order_availability_start_date_time_utc']; // json['pre_order_availability_start_date_time_utc'];
callForPrice = json['call_for_price']; callForPrice = json['call_for_price'];
price = json['price']; price = json['price'];
oldPrice = json['old_price']; oldPrice = json['old_price'];
productCost = json['product_cost']; productCost = json['product_cost'];
specialPrice = json['special_price']; // specialPrice = json['special_price'];
specialPriceStartDateTimeUtc = json['special_price_start_date_time_utc']; // specialPriceStartDateTimeUtc = json['special_price_start_date_time_utc'];
specialPriceEndDateTimeUtc = json['special_price_end_date_time_utc']; // specialPriceEndDateTimeUtc = json['special_price_end_date_time_utc'];
customerEntersPrice = json['customer_enters_price']; customerEntersPrice = json['customer_enters_price'];
minimumCustomerEnteredPrice = json['minimum_customer_entered_price']; minimumCustomerEnteredPrice = json['minimum_customer_entered_price'];
maximumCustomerEnteredPrice = json['maximum_customer_entered_price']; maximumCustomerEnteredPrice = json['maximum_customer_entered_price'];
@ -311,19 +315,19 @@ class Products {
basepriceBaseAmount = json['baseprice_base_amount']; basepriceBaseAmount = json['baseprice_base_amount'];
hasTierPrices = json['has_tier_prices']; hasTierPrices = json['has_tier_prices'];
hasDiscountsApplied = json['has_discounts_applied']; hasDiscountsApplied = json['has_discounts_applied'];
discountName = json['discount_name']; // discountName = json['discount_name'];
discountNamen = json['discount_namen']; // discountNamen = json['discount_namen'];
discountDescription = json['discount_description']; // discountDescription = json['discount_description'];
discountDescriptionn = json['discount_Descriptionn']; // discountDescriptionn = json['discount_Descriptionn'];
discountPercentage = json['discount_percentage']; // discountPercentage = json['discount_percentage'];
currency = json['currency']; currency = json['currency'];
currencyn = json['currencyn']; currencyn = json['currencyn'];
weight = json['weight']; weight = json['weight'];
length = json['length']; length = json['length'];
width = json['width']; width = json['width'];
height = json['height']; height = json['height'];
availableStartDateTimeUtc = json['available_start_date_time_utc']; // availableStartDateTimeUtc = json['available_start_date_time_utc'];
availableEndDateTimeUtc = json['available_end_date_time_utc']; // availableEndDateTimeUtc = json['available_end_date_time_utc'];
displayOrder = json['display_order']; displayOrder = json['display_order'];
published = json['published']; published = json['published'];
deleted = json['deleted']; deleted = json['deleted'];
@ -331,14 +335,64 @@ class Products {
updatedOnUtc = json['updated_on_utc']; updatedOnUtc = json['updated_on_utc'];
productType = json['product_type']; productType = json['product_type'];
parentGroupedProductId = json['parent_grouped_product_id']; parentGroupedProductId = json['parent_grouped_product_id'];
vendorId = json['vendor_id']; // if (json['role_ids'] != null) {
seName = json['se_name']; // roleIds = new List<Null>();
// json['role_ids'].forEach((v) {
// roleIds.add(new Null.fromJson(v));
// });
// }
// if (json['discount_ids'] != null) {
// discountIds = new List<Null>();
// json['discount_ids'].forEach((v) {
// discountIds.add(new Null.fromJson(v));
// });
// }
// if (json['store_ids'] != null) {
// storeIds = new List<Null>();
// json['store_ids'].forEach((v) {
// storeIds.add(new Null.fromJson(v));
// });
// }
manufacturerIds = json['manufacturer_ids'].cast<int>();
// if (json['reviews'] != null) {
// reviews = new List<Null>();
// json['reviews'].forEach((v) {
// reviews.add(new Null.fromJson(v));
// });
// }
if (json['images'] != null) { if (json['images'] != null) {
images = new List<Images>(); images = new List<Images>();
json['images'].forEach((v) { json['images'].forEach((v) {
images.add(new Images.fromJson(v)); images.add(new Images.fromJson(v));
}); });
} }
// if (json['attributes'] != null) {
// attributes = new List<Null>();
// json['attributes'].forEach((v) {
// attributes.add(new Null.fromJson(v));
// });
// }
if (json['specifications'] != null) {
specifications = new List<Specifications>();
json['specifications'].forEach((v) {
specifications.add(new Specifications.fromJson(v));
});
}
// if (json['associated_product_ids'] != null) {
// associatedProductIds = new List<Null>();
// json['associated_product_ids'].forEach((v) {
// associatedProductIds.add(new Null.fromJson(v));
// });
// }
// if (json['tags'] != null) {
// tags = new List<Null>();
// json['tags'].forEach((v) {
// tags.add(new Null.fromJson(v));
// });
// }
vendorId = json['vendor_id'];
seName = json['se_name'];
isinwishlist = json['isinwishlist'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -347,15 +401,19 @@ class Products {
data['visible_individually'] = this.visibleIndividually; data['visible_individually'] = this.visibleIndividually;
data['name'] = this.name; data['name'] = this.name;
data['namen'] = this.namen; data['namen'] = this.namen;
if (this.localizedNames != null) {
data['localized_names'] =
this.localizedNames.map((v) => v.toJson()).toList();
}
data['short_description'] = this.shortDescription; data['short_description'] = this.shortDescription;
data['short_descriptionn'] = this.shortDescriptionn; data['short_descriptionn'] = this.shortDescriptionn;
data['full_description'] = this.fullDescription; data['full_description'] = this.fullDescription;
data['full_descriptionn'] = this.fullDescriptionn; data['full_descriptionn'] = this.fullDescriptionn;
data['markas_new'] = this.markasNew; data['markas_new'] = this.markasNew;
data['show_on_home_page'] = this.showOnHomePage; data['show_on_home_page'] = this.showOnHomePage;
data['meta_keywords'] = this.metaKeywords; // data['meta_keywords'] = this.metaKeywords;
data['meta_description'] = this.metaDescription; // data['meta_description'] = this.metaDescription;
data['meta_title'] = this.metaTitle; // data['meta_title'] = this.metaTitle;
data['allow_customer_reviews'] = this.allowCustomerReviews; data['allow_customer_reviews'] = this.allowCustomerReviews;
data['approved_rating_sum'] = this.approvedRatingSum; data['approved_rating_sum'] = this.approvedRatingSum;
data['not_approved_rating_sum'] = this.notApprovedRatingSum; data['not_approved_rating_sum'] = this.notApprovedRatingSum;
@ -364,10 +422,10 @@ class Products {
data['sku'] = this.sku; data['sku'] = this.sku;
data['is_rx'] = this.isRx; data['is_rx'] = this.isRx;
data['prescription_required'] = this.prescriptionRequired; data['prescription_required'] = this.prescriptionRequired;
data['rx_message'] = this.rxMessage; // data['rx_message'] = this.rxMessage;
data['rx_messagen'] = this.rxMessagen; // data['rx_messagen'] = this.rxMessagen;
data['manufacturer_part_number'] = this.manufacturerPartNumber; // data['manufacturer_part_number'] = this.manufacturerPartNumber;
data['gtin'] = this.gtin; // data['gtin'] = this.gtin;
data['is_gift_card'] = this.isGiftCard; data['is_gift_card'] = this.isGiftCard;
data['require_other_products'] = this.requireOtherProducts; data['require_other_products'] = this.requireOtherProducts;
data['automatically_add_required_products'] = data['automatically_add_required_products'] =
@ -375,7 +433,7 @@ class Products {
data['is_download'] = this.isDownload; data['is_download'] = this.isDownload;
data['unlimited_downloads'] = this.unlimitedDownloads; data['unlimited_downloads'] = this.unlimitedDownloads;
data['max_number_of_downloads'] = this.maxNumberOfDownloads; data['max_number_of_downloads'] = this.maxNumberOfDownloads;
data['download_expiration_days'] = this.downloadExpirationDays; // data['download_expiration_days'] = this.downloadExpirationDays;
data['has_sample_download'] = this.hasSampleDownload; data['has_sample_download'] = this.hasSampleDownload;
data['has_user_agreement'] = this.hasUserAgreement; data['has_user_agreement'] = this.hasUserAgreement;
data['is_recurring'] = this.isRecurring; data['is_recurring'] = this.isRecurring;
@ -403,22 +461,22 @@ class Products {
this.allowBackInStockSubscriptions; this.allowBackInStockSubscriptions;
data['order_minimum_quantity'] = this.orderMinimumQuantity; data['order_minimum_quantity'] = this.orderMinimumQuantity;
data['order_maximum_quantity'] = this.orderMaximumQuantity; data['order_maximum_quantity'] = this.orderMaximumQuantity;
data['allowed_quantities'] = this.allowedQuantities; // data['allowed_quantities'] = this.allowedQuantities;
data['allow_adding_only_existing_attribute_combinations'] = data['allow_adding_only_existing_attribute_combinations'] =
this.allowAddingOnlyExistingAttributeCombinations; this.allowAddingOnlyExistingAttributeCombinations;
data['disable_buy_button'] = this.disableBuyButton; data['disable_buy_button'] = this.disableBuyButton;
data['disable_wishlist_button'] = this.disableWishlistButton; data['disable_wishlist_button'] = this.disableWishlistButton;
data['available_for_pre_order'] = this.availableForPreOrder; data['available_for_pre_order'] = this.availableForPreOrder;
data['pre_order_availability_start_date_time_utc'] = // data['pre_order_availability_start_date_time_utc'] =
this.preOrderAvailabilityStartDateTimeUtc; // this.preOrderAvailabilityStartDateTimeUtc;
data['call_for_price'] = this.callForPrice; data['call_for_price'] = this.callForPrice;
data['price'] = this.price; data['price'] = this.price;
data['old_price'] = this.oldPrice; data['old_price'] = this.oldPrice;
data['product_cost'] = this.productCost; data['product_cost'] = this.productCost;
data['special_price'] = this.specialPrice; // data['special_price'] = this.specialPrice;
data['special_price_start_date_time_utc'] = // data['special_price_start_date_time_utc'] =
this.specialPriceStartDateTimeUtc; // this.specialPriceStartDateTimeUtc;
data['special_price_end_date_time_utc'] = this.specialPriceEndDateTimeUtc; // data['special_price_end_date_time_utc'] = this.specialPriceEndDateTimeUtc;
data['customer_enters_price'] = this.customerEntersPrice; data['customer_enters_price'] = this.customerEntersPrice;
data['minimum_customer_entered_price'] = this.minimumCustomerEnteredPrice; data['minimum_customer_entered_price'] = this.minimumCustomerEnteredPrice;
data['maximum_customer_entered_price'] = this.maximumCustomerEnteredPrice; data['maximum_customer_entered_price'] = this.maximumCustomerEnteredPrice;
@ -427,19 +485,19 @@ class Products {
data['baseprice_base_amount'] = this.basepriceBaseAmount; data['baseprice_base_amount'] = this.basepriceBaseAmount;
data['has_tier_prices'] = this.hasTierPrices; data['has_tier_prices'] = this.hasTierPrices;
data['has_discounts_applied'] = this.hasDiscountsApplied; data['has_discounts_applied'] = this.hasDiscountsApplied;
data['discount_name'] = this.discountName; // data['discount_name'] = this.discountName;
data['discount_namen'] = this.discountNamen; // data['discount_namen'] = this.discountNamen;
data['discount_description'] = this.discountDescription; // data['discount_description'] = this.discountDescription;
data['discount_Descriptionn'] = this.discountDescriptionn; // data['discount_Descriptionn'] = this.discountDescriptionn;
data['discount_percentage'] = this.discountPercentage; // data['discount_percentage'] = this.discountPercentage;
data['currency'] = this.currency; data['currency'] = this.currency;
data['currencyn'] = this.currencyn; data['currencyn'] = this.currencyn;
data['weight'] = this.weight; data['weight'] = this.weight;
data['length'] = this.length; data['length'] = this.length;
data['width'] = this.width; data['width'] = this.width;
data['height'] = this.height; data['height'] = this.height;
data['available_start_date_time_utc'] = this.availableStartDateTimeUtc; // data['available_start_date_time_utc'] = this.availableStartDateTimeUtc;
data['available_end_date_time_utc'] = this.availableEndDateTimeUtc; // data['available_end_date_time_utc'] = this.availableEndDateTimeUtc;
data['display_order'] = this.displayOrder; data['display_order'] = this.displayOrder;
data['published'] = this.published; data['published'] = this.published;
data['deleted'] = this.deleted; data['deleted'] = this.deleted;
@ -447,12 +505,58 @@ class Products {
data['updated_on_utc'] = this.updatedOnUtc; data['updated_on_utc'] = this.updatedOnUtc;
data['product_type'] = this.productType; data['product_type'] = this.productType;
data['parent_grouped_product_id'] = this.parentGroupedProductId; data['parent_grouped_product_id'] = this.parentGroupedProductId;
data['vendor_id'] = this.vendorId; // if (this.roleIds != null) {
data['se_name'] = this.seName; // data['role_ids'] = this.roleIds.map((v) => v.toJson()).toList();
// }
// if (this.discountIds != null) {
// data['discount_ids'] = this.discountIds.map((v) => v.toJson()).toList();
// }
// if (this.storeIds != null) {
// data['store_ids'] = this.storeIds.map((v) => v.toJson()).toList();
// }
data['manufacturer_ids'] = this.manufacturerIds;
// if (this.reviews != null) {
// data['reviews'] = this.reviews.map((v) => v.toJson()).toList();
// }
if (this.images != null) { if (this.images != null) {
data['images'] = this.images.map((v) => v.toJson()).toList(); data['images'] = this.images.map((v) => v.toJson()).toList();
} }
// if (this.attributes != null) {
// data['attributes'] = this.attributes.map((v) => v.toJson()).toList();
// }
if (this.specifications != null) {
data['specifications'] =
this.specifications.map((v) => v.toJson()).toList();
}
// if (this.associatedProductIds != null) {
// data['associated_product_ids'] =
// this.associatedProductIds.map((v) => v.toJson()).toList();
// }
// if (this.tags != null) {
// data['tags'] = this.tags.map((v) => v.toJson()).toList();
// }
data['vendor_id'] = this.vendorId;
data['se_name'] = this.seName;
data['isinwishlist'] = this.isinwishlist;
return data;
}
}
class LocalizedNames {
int languageId;
String localizedName;
LocalizedNames({this.languageId, this.localizedName});
LocalizedNames.fromJson(Map<String, dynamic> json) {
languageId = json['language_id'];
localizedName = json['localized_name'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['language_id'] = this.languageId;
data['localized_name'] = this.localizedName;
return data; return data;
} }
} }
@ -484,3 +588,40 @@ class Images {
return data; return data;
} }
} }
class Specifications {
int id;
int displayOrder;
String defaultValue;
String defaultValuen;
String name;
String nameN;
Specifications(
{this.id,
this.displayOrder,
this.defaultValue,
this.defaultValuen,
this.name,
this.nameN});
Specifications.fromJson(Map<String, dynamic> json) {
id = json['id'];
displayOrder = json['display_order'];
defaultValue = json['default_value'];
defaultValuen = json['default_valuen'];
name = json['name'];
nameN = json['nameN'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['display_order'] = this.displayOrder;
data['default_value'] = this.defaultValue;
data['default_valuen'] = this.defaultValuen;
data['name'] = this.name;
data['nameN'] = this.nameN;
return data;
}
}

@ -3,21 +3,18 @@ import 'package:diplomaticquarterapp/core/model/labs/LabOrderResult.dart';
import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart';
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_special_result.dart';
import 'package:diplomaticquarterapp/core/model/labs/request_patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/model/labs/request_patient_lab_special_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/request_patient_lab_special_result.dart';
import 'package:diplomaticquarterapp/core/model/labs/request_send_lab_report_email.dart'; import 'package:diplomaticquarterapp/core/model/labs/request_send_lab_report_email.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
class LabsService extends BaseService { class LabsService extends BaseService {
List<PatientLabOrders> patientLabOrdersList = List(); List<PatientLabOrders> patientLabOrdersList = List();
Future getPatientLabOrdersList() async { Future getPatientLabOrdersList() async {
hasError = false; hasError = false;
Map<String,dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
await baseAppClient.post(GET_Patient_LAB_ORDERS, await baseAppClient.post(GET_Patient_LAB_ORDERS, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
patientLabOrdersList.clear(); patientLabOrdersList.clear();
response['ListPLO'].forEach((hospital) { response['ListPLO'].forEach((hospital) {
patientLabOrdersList.add(PatientLabOrders.fromJson(hospital)); patientLabOrdersList.add(PatientLabOrders.fromJson(hospital));
@ -28,26 +25,20 @@ class LabsService extends BaseService {
}, body: body); }, body: body);
} }
RequestPatientLabSpecialResult _requestPatientLabSpecialResult = RequestPatientLabSpecialResult _requestPatientLabSpecialResult = RequestPatientLabSpecialResult();
RequestPatientLabSpecialResult();
List<PatientLabSpecialResult> patientLabSpecialResult = List(); List<PatientLabSpecialResult> patientLabSpecialResult = List();
List<LabResult> labResultList = List(); List<LabResult> labResultList = List();
List<LabOrderResult> labOrdersResultsList = List(); List<LabOrderResult> labOrdersResultsList = List();
Future getLaboratoryResult( Future getLaboratoryResult({String projectID, int clinicID, String invoiceNo, String orderNo}) async {
{String projectID,
int clinicID,
String invoiceNo,
String orderNo}) async {
hasError = false; hasError = false;
_requestPatientLabSpecialResult.projectID = projectID; _requestPatientLabSpecialResult.projectID = projectID;
_requestPatientLabSpecialResult.clinicID = clinicID; _requestPatientLabSpecialResult.clinicID = clinicID;
_requestPatientLabSpecialResult.invoiceNo = invoiceNo; _requestPatientLabSpecialResult.invoiceNo = invoiceNo;
_requestPatientLabSpecialResult.orderNo = orderNo; _requestPatientLabSpecialResult.orderNo = orderNo;
await baseAppClient.post(GET_Patient_LAB_SPECIAL_RESULT, await baseAppClient.post(GET_Patient_LAB_SPECIAL_RESULT, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
patientLabSpecialResult.clear(); patientLabSpecialResult.clear();
response['ListPLSR'].forEach((hospital) { response['ListPLSR'].forEach((hospital) {
patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital)); patientLabSpecialResult.add(PatientLabSpecialResult.fromJson(hospital));
@ -67,8 +58,7 @@ class LabsService extends BaseService {
body['SetupID'] = patientLabOrder.setupID; body['SetupID'] = patientLabOrder.setupID;
body['ProjectID'] = patientLabOrder.projectID; body['ProjectID'] = patientLabOrder.projectID;
body['ClinicID'] = patientLabOrder.clinicID; body['ClinicID'] = patientLabOrder.clinicID;
await baseAppClient.post(GET_Patient_LAB_RESULT, await baseAppClient.post(GET_Patient_LAB_RESULT, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
patientLabSpecialResult.clear(); patientLabSpecialResult.clear();
labResultList.clear(); labResultList.clear();
response['ListPLR'].forEach((lab) { response['ListPLR'].forEach((lab) {
@ -80,7 +70,65 @@ class LabsService extends BaseService {
}, body: body); }, body: body);
} }
Future getPatientLabOrdersResults({PatientLabOrders patientLabOrder,String procedure}) async { Future generateCovidLabReport(LabResult covidLabResult, String isOutsideKSA) async {
hasError = false;
Map<String, dynamic> body = Map();
body['To'] = user.emailAddress;
body['OrderNo'] = covidLabResult.orderNo;
body['OrderLineItemNo'] = covidLabResult.orderLineItemNo;
body['LineItemNo'] = covidLabResult.resultValueBasedLineItemNo;
body['CertificateFormat'] = 5;
body['GeneratedBy'] = 102;
body['ShowPassportNumber'] = isOutsideKSA;
body['isDentalAllowedBackend'] = false;
body['SetupID'] = covidLabResult.setupID;
body['ProjectID'] = covidLabResult.projectID;
dynamic localRes;
await baseAppClient.post(SEND_COVID_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
return Future.value(localRes);
}
Future updateCovidPassportNumber(String passportNumber) async {
hasError = false;
Map<String, dynamic> body = Map();
body['PassportNo'] = passportNumber;
dynamic localRes;
await baseAppClient.post(COVID_PASSPORT_UPDATE, onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
return Future.value(localRes);
}
Future getCovidPassportNumber() async {
hasError = false;
Map<String, dynamic> body = Map();
dynamic localRes;
await baseAppClient.post(GET_PATIENT_PASSPORT_NUMBER, onSuccess: (dynamic response, int statusCode) {
localRes = response;
}, onFailure: (String error, int statusCode) {
hasError = true;
super.error = error;
}, body: body);
return Future.value(localRes);
}
Future getPatientLabOrdersResults({PatientLabOrders patientLabOrder, String procedure}) async {
hasError = false; hasError = false;
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['InvoiceNo'] = patientLabOrder.invoiceNo; body['InvoiceNo'] = patientLabOrder.invoiceNo;
@ -90,9 +138,8 @@ class LabsService extends BaseService {
body['ProjectID'] = patientLabOrder.projectID; body['ProjectID'] = patientLabOrder.projectID;
body['ClinicID'] = patientLabOrder.clinicID; body['ClinicID'] = patientLabOrder.clinicID;
body['Procedure'] = procedure; body['Procedure'] = procedure;
await baseAppClient.post(GET_Patient_LAB_ORDERS_RESULT, await baseAppClient.post(GET_Patient_LAB_ORDERS_RESULT, onSuccess: (dynamic response, int statusCode) {
onSuccess: (dynamic response, int statusCode) { labOrdersResultsList.clear();
labOrdersResultsList.clear();
response['ListPLR'].forEach((lab) { response['ListPLR'].forEach((lab) {
labOrdersResultsList.add(LabOrderResult.fromJson(lab)); labOrdersResultsList.add(LabOrderResult.fromJson(lab));
}); });
@ -102,28 +149,23 @@ class LabsService extends BaseService {
}, body: body); }, body: body);
} }
RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail _requestSendLabReportEmail = RequestSendLabReportEmail();
RequestSendLabReportEmail();
Future sendLabReportEmail({PatientLabOrders patientLabOrder}) async { Future sendLabReportEmail({PatientLabOrders patientLabOrder}) async {
_requestSendLabReportEmail.projectID = patientLabOrder.projectID; _requestSendLabReportEmail.projectID = patientLabOrder.projectID;
_requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo; _requestSendLabReportEmail.invoiceNo = patientLabOrder.invoiceNo;
_requestSendLabReportEmail.doctorName = patientLabOrder.doctorName; _requestSendLabReportEmail.doctorName = patientLabOrder.doctorName;
_requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription; _requestSendLabReportEmail.clinicName = patientLabOrder.clinicDescription;
_requestSendLabReportEmail.patientName = user.firstName +" "+ user.lastName; _requestSendLabReportEmail.patientName = user.firstName + " " + user.lastName;
_requestSendLabReportEmail.patientIditificationNum = _requestSendLabReportEmail.patientIditificationNum = user.patientIdentificationNo;
user.patientIdentificationNo;
_requestSendLabReportEmail.dateofBirth = user.dateofBirth; _requestSendLabReportEmail.dateofBirth = user.dateofBirth;
_requestSendLabReportEmail.to = user.emailAddress; _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.patientMobileNumber = user.mobileNumber;
_requestSendLabReportEmail.projectName = patientLabOrder.projectName; _requestSendLabReportEmail.projectName = patientLabOrder.projectName;
_requestSendLabReportEmail.setupID = user.setupID; _requestSendLabReportEmail.setupID = user.setupID;
await baseAppClient.post(SEND_LAB_RESULT_EMAIL, await baseAppClient.post(SEND_LAB_RESULT_EMAIL, onSuccess: (dynamic response, int statusCode) {}, onFailure: (String error, int statusCode) {
onSuccess: (dynamic response, int statusCode) {
}, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: _requestSendLabReportEmail.toJson()); }, body: _requestSendLabReportEmail.toJson());

@ -9,6 +9,7 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/models/DoctorScheduleR
class MedicalService extends BaseService { class MedicalService extends BaseService {
List<AppoitmentAllHistoryResultList> appoitmentAllHistoryResultList = List(); List<AppoitmentAllHistoryResultList> appoitmentAllHistoryResultList = List();
List<DoctorScheduleResponse> doctorScheduleResponse = List(); List<DoctorScheduleResponse> doctorScheduleResponse = List();
List<String> freeSlots = [];
getAppointmentHistory({bool isActiveAppointment = false}) async { getAppointmentHistory({bool isActiveAppointment = false}) async {
hasError = false; hasError = false;
super.error = ""; super.error = "";
@ -46,7 +47,7 @@ class MedicalService extends BaseService {
}, body: body); }, body: body);
} }
Future<Map> getSchedule(DoctorList doctorRequest) async { getSchedule(DoctorList doctorRequest) async {
Map<String, dynamic> request; Map<String, dynamic> request;
request = { request = {
'DoctorID': doctorRequest.doctorID, 'DoctorID': doctorRequest.doctorID,
@ -61,8 +62,29 @@ class MedicalService extends BaseService {
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
throw error; throw error;
}, body: request); }, body: request);
doctorScheduleResponse.clear();
localRes['List_DoctorWorkingHoursTable'].forEach((item) => localRes['List_DoctorWorkingHoursTable'].forEach((item) =>
{doctorScheduleResponse.add(DoctorScheduleResponse.fromJson(item))}); {doctorScheduleResponse.add(DoctorScheduleResponse.fromJson(item))});
} }
getFreeSlot(DoctorList doctorRequest) async {
Map<String, dynamic> request;
request = {
'DoctorID': doctorRequest.doctorID,
'ProjectID': doctorRequest.projectID,
'ClinicID': doctorRequest.clinicID,
'DoctorWorkingHoursDays': 7
};
dynamic localRes;
await baseAppClient.post(GET_DOCTOR_FREE_SLOTS,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
freeSlots.clear();
localRes['FreeTimeSlots'].forEach((item) => freeSlots.add(item));
// localRes['List_DoctorWorkingHoursTable'].forEach((item) =>
// {doctorScheduleResponse.add(DoctorScheduleResponse.fromJson(item))});
}
} }

@ -10,7 +10,6 @@ import 'package:diplomaticquarterapp/uitl/utils.dart';
class PharmacyModuleService extends BaseService { class PharmacyModuleService extends BaseService {
final AppSharedPreferences sharedPref = AppSharedPreferences(); final AppSharedPreferences sharedPref = AppSharedPreferences();
bool isFinished = true; bool isFinished = true;
bool hasError = false;
String errorMsg = ''; String errorMsg = '';
String url = ""; String url = "";
@ -114,6 +113,7 @@ class PharmacyModuleService extends BaseService {
} }
Future getTopManufacturerList() async { Future getTopManufacturerList() async {
hasError = false;
Map<String, String> queryParams = {'page': '1', 'limit': '8'}; Map<String, String> queryParams = {'page': '1', 'limit': '8'};
try { try {
await baseAppClient.getPharmacy(GET_PHARMACY_TOP_MANUFACTURER, await baseAppClient.getPharmacy(GET_PHARMACY_TOP_MANUFACTURER,

@ -45,8 +45,6 @@ class PrescriptionService extends BaseService {
_prescriptionsList.add(Prescriptions.fromJson(prescriptions)); _prescriptionsList.add(Prescriptions.fromJson(prescriptions));
}); });
print(_prescriptionsList.length); print(_prescriptionsList.length);
print("response is -------------"+response);
print(response);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -14,7 +14,7 @@ class MedicalViewModel extends BaseViewModel {
_medicalService.appoitmentAllHistoryResultList; _medicalService.appoitmentAllHistoryResultList;
List<DoctorScheduleResponse> get getDoctorScheduleList => List<DoctorScheduleResponse> get getDoctorScheduleList =>
_medicalService.doctorScheduleResponse; _medicalService.doctorScheduleResponse;
List<String> get freeSlots => _medicalService.freeSlots;
getAppointmentHistory() async { getAppointmentHistory() async {
if (authenticatedUserObject.isLogin) { if (authenticatedUserObject.isLogin) {
setState(ViewState.Busy); setState(ViewState.Busy);
@ -38,4 +38,16 @@ class MedicalViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
getFreeSlots(DoctorList doctorRequest) async {
if (authenticatedUserObject.isLogin) {
setState(ViewState.Busy);
await _medicalService.getFreeSlot(doctorRequest);
if (_medicalService.hasError) {
error = _medicalService.error;
setState(ViewState.Error);
} else
setState(ViewState.Idle);
}
}
} }

@ -34,7 +34,7 @@ class PharmacyModuleViewModel extends BaseViewModel {
_pharmacyService.lastVisitedProducts; _pharmacyService.lastVisitedProducts;
List<PharmacyProduct> get recommendedProductList => List<Map<String, dynamic>> get recommendedProductList =>
_recommendedProductService.recommendedList; _recommendedProductService.recommendedList;
List<Prescriptions> get prescriptionsList => List<Prescriptions> get prescriptionsList =>
@ -74,6 +74,7 @@ class PharmacyModuleViewModel extends BaseViewModel {
setState(ViewState.Idle); setState(ViewState.Idle);
} }
} }
Future generatePharmacyToken() async { Future generatePharmacyToken() async {
setState(ViewState.Busy); setState(ViewState.Busy);
await _pharmacyService.generatePharmacyToken(); await _pharmacyService.generatePharmacyToken();
@ -137,7 +138,7 @@ class PharmacyModuleViewModel extends BaseViewModel {
} }
} }
/////////////RecommendedProducts //////////////////////////////////////////RecommendedProducts
getRecommendedProducts(productId) async { getRecommendedProducts(productId) async {
hasError = false; hasError = false;
setState(ViewState.Busy); setState(ViewState.Busy);

@ -0,0 +1,76 @@
class DentalProceduresModel {
List<ListIsPatientHasOnGoingEstimation> listIsPatientHasOnGoingEstimation;
DentalProceduresModel({this.listIsPatientHasOnGoingEstimation});
DentalProceduresModel.fromJson(Map<String, dynamic> json) {
if (json['List_IsPatientHasOnGoingEstimation'] != null) {
listIsPatientHasOnGoingEstimation =
new List<ListIsPatientHasOnGoingEstimation>();
json['List_IsPatientHasOnGoingEstimation'].forEach((v) {
listIsPatientHasOnGoingEstimation
.add(new ListIsPatientHasOnGoingEstimation.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
if (this.listIsPatientHasOnGoingEstimation != null) {
data['List_IsPatientHasOnGoingEstimation'] = this
.listIsPatientHasOnGoingEstimation
.map((v) => v.toJson())
.toList();
}
return data;
}
}
class ListIsPatientHasOnGoingEstimation {
dynamic setupID;
dynamic estimationNo;
int projectID;
String procedureId;
int patientID;
int sequenceNo;
int neededTime;
String procedureName;
dynamic procedureNameN;
ListIsPatientHasOnGoingEstimation(
{this.setupID,
this.estimationNo,
this.projectID,
this.procedureId,
this.patientID,
this.sequenceNo,
this.neededTime,
this.procedureName,
this.procedureNameN});
ListIsPatientHasOnGoingEstimation.fromJson(Map<String, dynamic> json) {
setupID = json['SetupID'];
estimationNo = json['EstimationNo'];
projectID = json['ProjectID'];
procedureId = json['ProcedureId'];
patientID = json['PatientID'];
sequenceNo = json['sequenceNo'];
neededTime = json['NeededTime'];
procedureName = json['ProcedureName'];
procedureNameN = json['ProcedureNameN'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['SetupID'] = this.setupID;
data['EstimationNo'] = this.estimationNo;
data['ProjectID'] = this.projectID;
data['ProcedureId'] = this.procedureId;
data['PatientID'] = this.patientID;
data['sequenceNo'] = this.sequenceNo;
data['NeededTime'] = this.neededTime;
data['ProcedureName'] = this.procedureName;
data['ProcedureNameN'] = this.procedureNameN;
return data;
}
}

@ -61,15 +61,15 @@ class Wishlist {
productAttributes: List<dynamic>.from(json["product_attributes"].map((x) => x)), productAttributes: List<dynamic>.from(json["product_attributes"].map((x) => x)),
customerEnteredPrice: json["customer_entered_price"], customerEnteredPrice: json["customer_entered_price"],
quantity: json["quantity"], quantity: json["quantity"],
discountAmountInclTax: json["discount_amount_incl_tax"], discountAmountInclTax: json["discount_amount_incl_tax"] != null ? json["discount_amount_incl_tax"] :0.0,
subtotal: json["subtotal"], subtotal: json["subtotal"],
subtotalWithVat: json["subtotal_with_vat"], subtotalWithVat: json["subtotal_with_vat"],
subtotalVatAmount: json["subtotal_vat_amount"], subtotalVatAmount: json["subtotal_vat_amount"],
subtotalVatRate: json["subtotal_vat_rate"], subtotalVatRate: json["subtotal_vat_rate"],
currency: json["currency"], currency: json["currency"],
currencyn: json["currencyn"], currencyn: json["currencyn"],
rentalStartDateUtc: json["rental_start_date_utc"], rentalStartDateUtc: json["rental_start_date_utc"] != null ? DateTime.parse(json["rental_start_date_utc"]) : DateTime.now(),
rentalEndDateUtc: json["rental_end_date_utc"], rentalEndDateUtc: json["rental_end_date_utc"] != null ? DateTime.parse(json["rental_end_date_utc"]) : DateTime.now(),
createdOnUtc: DateTime.parse(json["created_on_utc"]), createdOnUtc: DateTime.parse(json["created_on_utc"]),
updatedOnUtc: DateTime.parse(json["updated_on_utc"]), updatedOnUtc: DateTime.parse(json["updated_on_utc"]),
shoppingCartType: json["shopping_cart_type"], shoppingCartType: json["shopping_cart_type"],
@ -172,7 +172,7 @@ class Customer {
systemName: json["system_name"], systemName: json["system_name"],
lastIpAddress: json["last_ip_address"], lastIpAddress: json["last_ip_address"],
createdOnUtc: DateTime.parse(json["created_on_utc"]), createdOnUtc: DateTime.parse(json["created_on_utc"]),
lastLoginDateUtc: DateTime.parse(json["last_login_date_utc"]), lastLoginDateUtc: json["last_login_date_utc"] != null ? DateTime.parse(json["last_login_date_utc"]) : DateTime.now(),
lastActivityDateUtc: DateTime.parse(json["last_activity_date_utc"]), lastActivityDateUtc: DateTime.parse(json["last_activity_date_utc"]),
registeredInStoreId: json["registered_in_store_id"], registeredInStoreId: json["registered_in_store_id"],
roleIds: List<dynamic>.from(json["role_ids"].map((x) => x)), roleIds: List<dynamic>.from(json["role_ids"].map((x) => x)),
@ -335,9 +335,9 @@ class Product {
this.fullDescriptionn, this.fullDescriptionn,
this.markasNew, this.markasNew,
this.showOnHomePage, this.showOnHomePage,
this.metaKeywords, // this.metaKeywords,
this.metaDescription, // this.metaDescription,
this.metaTitle, // this.metaTitle,
this.allowCustomerReviews, this.allowCustomerReviews,
this.approvedRatingSum, this.approvedRatingSum,
this.notApprovedRatingSum, this.notApprovedRatingSum,
@ -348,15 +348,15 @@ class Product {
this.prescriptionRequired, this.prescriptionRequired,
this.rxMessage, this.rxMessage,
this.rxMessagen, this.rxMessagen,
this.manufacturerPartNumber, // this.manufacturerPartNumber,
this.gtin, // this.gtin,
this.isGiftCard, this.isGiftCard,
this.requireOtherProducts, this.requireOtherProducts,
this.automaticallyAddRequiredProducts, this.automaticallyAddRequiredProducts,
this.isDownload, this.isDownload,
this.unlimitedDownloads, this.unlimitedDownloads,
this.maxNumberOfDownloads, this.maxNumberOfDownloads,
this.downloadExpirationDays, // this.downloadExpirationDays,
this.hasSampleDownload, this.hasSampleDownload,
this.hasUserAgreement, this.hasUserAgreement,
this.isRecurring, this.isRecurring,
@ -382,7 +382,7 @@ class Product {
this.allowBackInStockSubscriptions, this.allowBackInStockSubscriptions,
this.orderMinimumQuantity, this.orderMinimumQuantity,
this.orderMaximumQuantity, this.orderMaximumQuantity,
this.allowedQuantities, // this.allowedQuantities,
this.allowAddingOnlyExistingAttributeCombinations, this.allowAddingOnlyExistingAttributeCombinations,
this.disableBuyButton, this.disableBuyButton,
this.disableWishlistButton, this.disableWishlistButton,
@ -448,9 +448,9 @@ class Product {
String fullDescriptionn; String fullDescriptionn;
bool markasNew; bool markasNew;
bool showOnHomePage; bool showOnHomePage;
dynamic metaKeywords; // dynamic metaKeywords;
dynamic metaDescription; // dynamic metaDescription;
dynamic metaTitle; // dynamic metaTitle;
bool allowCustomerReviews; bool allowCustomerReviews;
dynamic approvedRatingSum; dynamic approvedRatingSum;
dynamic notApprovedRatingSum; dynamic notApprovedRatingSum;
@ -461,15 +461,15 @@ class Product {
bool prescriptionRequired; bool prescriptionRequired;
dynamic rxMessage; dynamic rxMessage;
dynamic rxMessagen; dynamic rxMessagen;
dynamic manufacturerPartNumber; // dynamic manufacturerPartNumber;
dynamic gtin; // dynamic gtin;
bool isGiftCard; bool isGiftCard;
bool requireOtherProducts; bool requireOtherProducts;
bool automaticallyAddRequiredProducts; bool automaticallyAddRequiredProducts;
bool isDownload; bool isDownload;
bool unlimitedDownloads; bool unlimitedDownloads;
dynamic maxNumberOfDownloads; dynamic maxNumberOfDownloads;
dynamic downloadExpirationDays; // dynamic downloadExpirationDays;
bool hasSampleDownload; bool hasSampleDownload;
bool hasUserAgreement; bool hasUserAgreement;
bool isRecurring; bool isRecurring;
@ -495,7 +495,7 @@ class Product {
bool allowBackInStockSubscriptions; bool allowBackInStockSubscriptions;
dynamic orderMinimumQuantity; dynamic orderMinimumQuantity;
dynamic orderMaximumQuantity; dynamic orderMaximumQuantity;
dynamic allowedQuantities; // dynamic allowedQuantities;
bool allowAddingOnlyExistingAttributeCombinations; bool allowAddingOnlyExistingAttributeCombinations;
bool disableBuyButton; bool disableBuyButton;
bool disableWishlistButton; bool disableWishlistButton;
@ -561,9 +561,9 @@ class Product {
fullDescriptionn: json["full_descriptionn"], fullDescriptionn: json["full_descriptionn"],
markasNew: json["markas_new"], markasNew: json["markas_new"],
showOnHomePage: json["show_on_home_page"], showOnHomePage: json["show_on_home_page"],
metaKeywords: json["meta_keywords"], // metaKeywords: json["meta_keywords"],
metaDescription: json["meta_description"], // metaDescription: json["meta_description"],
metaTitle: json["meta_title"], // metaTitle: json["meta_title"],
allowCustomerReviews: json["allow_customer_reviews"], allowCustomerReviews: json["allow_customer_reviews"],
approvedRatingSum: json["approved_rating_sum"], approvedRatingSum: json["approved_rating_sum"],
notApprovedRatingSum: json["not_approved_rating_sum"], notApprovedRatingSum: json["not_approved_rating_sum"],
@ -572,17 +572,17 @@ class Product {
sku: json["sku"], sku: json["sku"],
isRx: json["is_rx"], isRx: json["is_rx"],
prescriptionRequired: json["prescription_required"], prescriptionRequired: json["prescription_required"],
rxMessage: json["rx_message"], rxMessage: json["rx_message"] != null ? json["rx_message"] : "" ,
rxMessagen: json["rx_messagen"], rxMessagen: json["rx_messagen"] != null ? json["rx_messagen"] : "",
manufacturerPartNumber: json["manufacturer_part_number"], // manufacturerPartNumber: json["manufacturer_part_number"],
gtin: json["gtin"], // gtin: json["gtin"],
isGiftCard: json["is_gift_card"], isGiftCard: json["is_gift_card"],
requireOtherProducts: json["require_other_products"], requireOtherProducts: json["require_other_products"],
automaticallyAddRequiredProducts: json["automatically_add_required_products"], automaticallyAddRequiredProducts: json["automatically_add_required_products"],
isDownload: json["is_download"], isDownload: json["is_download"],
unlimitedDownloads: json["unlimited_downloads"], unlimitedDownloads: json["unlimited_downloads"],
maxNumberOfDownloads: json["max_number_of_downloads"], maxNumberOfDownloads: json["max_number_of_downloads"],
downloadExpirationDays: json["download_expiration_days"], // downloadExpirationDays: json["download_expiration_days"],
hasSampleDownload: json["has_sample_download"], hasSampleDownload: json["has_sample_download"],
hasUserAgreement: json["has_user_agreement"], hasUserAgreement: json["has_user_agreement"],
isRecurring: json["is_recurring"], isRecurring: json["is_recurring"],
@ -608,19 +608,19 @@ class Product {
allowBackInStockSubscriptions: json["allow_back_in_stock_subscriptions"], allowBackInStockSubscriptions: json["allow_back_in_stock_subscriptions"],
orderMinimumQuantity: json["order_minimum_quantity"], orderMinimumQuantity: json["order_minimum_quantity"],
orderMaximumQuantity: json["order_maximum_quantity"], orderMaximumQuantity: json["order_maximum_quantity"],
allowedQuantities: json["allowed_quantities"], // allowedQuantities: json["allowed_quantities"],
allowAddingOnlyExistingAttributeCombinations: json["allow_adding_only_existing_attribute_combinations"], allowAddingOnlyExistingAttributeCombinations: json["allow_adding_only_existing_attribute_combinations"],
disableBuyButton: json["disable_buy_button"], disableBuyButton: json["disable_buy_button"],
disableWishlistButton: json["disable_wishlist_button"], disableWishlistButton: json["disable_wishlist_button"],
availableForPreOrder: json["available_for_pre_order"], availableForPreOrder: json["available_for_pre_order"],
preOrderAvailabilityStartDateTimeUtc: json["pre_order_availability_start_date_time_utc"], preOrderAvailabilityStartDateTimeUtc: json["pre_order_availability_start_date_time_utc"] != null ? DateTime.parse(json["pre_order_availability_start_date_time_utc"]) : DateTime.now(),
callForPrice: json["call_for_price"], callForPrice: json["call_for_price"],
price: json["price"].toDouble(), price: json["price"].toDouble(),
oldPrice: json["old_price"], oldPrice: json["old_price"],
productCost: json["product_cost"].toDouble(), productCost: json["product_cost"].toDouble(),
specialPrice: json["special_price"], specialPrice: json["special_price"] != null ? json["special_price"] : 0.0 ,
specialPriceStartDateTimeUtc: json["special_price_start_date_time_utc"], specialPriceStartDateTimeUtc: json["special_price_start_date_time_utc"] != null ? DateTime.parse(json["special_price_start_date_time_utc"]) : DateTime.now(),
specialPriceEndDateTimeUtc: json["special_price_end_date_time_utc"], specialPriceEndDateTimeUtc: json["special_price_end_date_time_utc"] != null ? DateTime.parse(json["special_price_end_date_time_utc"]) : DateTime.now(),
customerEntersPrice: json["customer_enters_price"], customerEntersPrice: json["customer_enters_price"],
minimumCustomerEnteredPrice: json["minimum_customer_entered_price"], minimumCustomerEnteredPrice: json["minimum_customer_entered_price"],
maximumCustomerEnteredPrice: json["maximum_customer_entered_price"], maximumCustomerEnteredPrice: json["maximum_customer_entered_price"],
@ -675,9 +675,9 @@ class Product {
"full_descriptionn": fullDescriptionn, "full_descriptionn": fullDescriptionn,
"markas_new": markasNew, "markas_new": markasNew,
"show_on_home_page": showOnHomePage, "show_on_home_page": showOnHomePage,
"meta_keywords": metaKeywords, // "meta_keywords": metaKeywords,
"meta_description": metaDescription, // "meta_description": metaDescription,
"meta_title": metaTitle, // "meta_title": metaTitle,
"allow_customer_reviews": allowCustomerReviews, "allow_customer_reviews": allowCustomerReviews,
"approved_rating_sum": approvedRatingSum, "approved_rating_sum": approvedRatingSum,
"not_approved_rating_sum": notApprovedRatingSum, "not_approved_rating_sum": notApprovedRatingSum,
@ -688,15 +688,15 @@ class Product {
"prescription_required": prescriptionRequired, "prescription_required": prescriptionRequired,
"rx_message": rxMessage, "rx_message": rxMessage,
"rx_messagen": rxMessagen, "rx_messagen": rxMessagen,
"manufacturer_part_number": manufacturerPartNumber, // "manufacturer_part_number": manufacturerPartNumber,
"gtin": gtin, // "gtin": gtin,
"is_gift_card": isGiftCard, "is_gift_card": isGiftCard,
"require_other_products": requireOtherProducts, "require_other_products": requireOtherProducts,
"automatically_add_required_products": automaticallyAddRequiredProducts, "automatically_add_required_products": automaticallyAddRequiredProducts,
"is_download": isDownload, "is_download": isDownload,
"unlimited_downloads": unlimitedDownloads, "unlimited_downloads": unlimitedDownloads,
"max_number_of_downloads": maxNumberOfDownloads, "max_number_of_downloads": maxNumberOfDownloads,
"download_expiration_days": downloadExpirationDays, // "download_expiration_days": downloadExpirationDays,
"has_sample_download": hasSampleDownload, "has_sample_download": hasSampleDownload,
"has_user_agreement": hasUserAgreement, "has_user_agreement": hasUserAgreement,
"is_recurring": isRecurring, "is_recurring": isRecurring,
@ -722,7 +722,7 @@ class Product {
"allow_back_in_stock_subscriptions": allowBackInStockSubscriptions, "allow_back_in_stock_subscriptions": allowBackInStockSubscriptions,
"order_minimum_quantity": orderMinimumQuantity, "order_minimum_quantity": orderMinimumQuantity,
"order_maximum_quantity": orderMaximumQuantity, "order_maximum_quantity": orderMaximumQuantity,
"allowed_quantities": allowedQuantities, // "allowed_quantities": allowedQuantities,
"allow_adding_only_existing_attribute_combinations": allowAddingOnlyExistingAttributeCombinations, "allow_adding_only_existing_attribute_combinations": allowAddingOnlyExistingAttributeCombinations,
"disable_buy_button": disableBuyButton, "disable_buy_button": disableBuyButton,
"disable_wishlist_button": disableWishlistButton, "disable_wishlist_button": disableWishlistButton,

@ -33,11 +33,15 @@ class CMCLocationPage extends StatefulWidget {
class _CMCLocationPageState extends State<CMCLocationPage> { class _CMCLocationPageState extends State<CMCLocationPage> {
double latitude = 0; double latitude = 0;
double longitude = 0; double longitude = 0;
bool showCurrentLocation = false;
@override @override
void initState() { void initState() {
latitude = widget.latitude; latitude = widget.latitude;
longitude = widget.longitude; longitude = widget.longitude;
if(latitude == 0.0 && longitude == 0.0) {
showCurrentLocation = true;
}
super.initState(); super.initState();
} }
@ -149,7 +153,7 @@ class _CMCLocationPageState extends State<CMCLocationPage> {
); );
}, },
initialPosition: LatLng(latitude, longitude), initialPosition: LatLng(latitude, longitude),
useCurrentLocation: false, useCurrentLocation: showCurrentLocation,
), ),
)); ));
} }

@ -3,6 +3,7 @@ import 'package:diplomaticquarterapp/core/model/AlHabibMedicalService/Comprehens
import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart'; import 'package:diplomaticquarterapp/core/service/AlHabibMedicalService/customer_addresses_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/AlHabibMedicalService/cmc_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/uitl/location_util.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.dart'; import 'package:diplomaticquarterapp/widgets/dialogs/select_location_dialog.dart';
import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart'; import 'package:diplomaticquarterapp/pages/AlHabibMedicalService/HomeHealthCare/NewHomeHealthCare/location_page.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
@ -44,6 +45,7 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
double latitude = 0; double latitude = 0;
double longitude = 0; double longitude = 0;
AddressInfo _selectedAddress; AddressInfo _selectedAddress;
bool showCurrentLocation = false;
@override @override
void initState() { void initState() {
@ -56,14 +58,26 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
super.initState(); super.initState();
} }
setLatitudeAndLongitude({bool isSetState = false, String latLong}) { setLatitudeAndLongitude({bool isSetState = false, String latLong}) async {
if (latLong == null) if (latLong == null){
latLong = widget if(widget.model.addressesList.isEmpty) {
.model.addressesList[widget.model.addressesList.length - 1].latLong;
List latLongArr = latLong.split(',');
latitude = double.parse(latLongArr[0]); setState(() {
longitude = double.parse(latLongArr[1]); showCurrentLocation = true;
});
} else {
latLong = widget
.model.addressesList[widget.model.addressesList.length - 1].latLong;
}
}
if(!showCurrentLocation) {
List latLongArr = latLong.split(',');
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
}
} }
@override @override
@ -144,9 +158,11 @@ class _NewCMCStepTowPageState extends State<NewCMCStepTowPage> {
); );
}, },
initialPosition: LatLng(latitude, longitude), initialPosition: LatLng(latitude, longitude),
useCurrentLocation: false, useCurrentLocation: showCurrentLocation,
), ),
Container( if(widget.model.addressesList.isNotEmpty)
Container(
child: InkWell( child: InkWell(
onTap: () => onTap: () =>
confirmSelectLocationDialog(widget.model.addressesList), confirmSelectLocationDialog(widget.model.addressesList),

@ -33,12 +33,16 @@ class _LocationPageState
extends State<LocationPage> { extends State<LocationPage> {
double latitude = 0; double latitude = 0;
double longitude = 0; double longitude = 0;
bool showCurrentLocation = false;
@override @override
void initState() { void initState() {
latitude = widget.latitude; latitude = widget.latitude;
longitude = widget.longitude; longitude = widget.longitude;
if(latitude == 0.0 && longitude == 0.0) {
showCurrentLocation = true;
}
super.initState(); super.initState();
} }
@ -141,7 +145,7 @@ class _LocationPageState
); );
}, },
initialPosition: LatLng(latitude, longitude), initialPosition: LatLng(latitude, longitude),
useCurrentLocation: false, useCurrentLocation: showCurrentLocation,
), ),
)); ));
} }

@ -46,6 +46,8 @@ class _NewHomeHealthCareStepTowPageState
double latitude = 0; double latitude = 0;
double longitude = 0; double longitude = 0;
AddressInfo _selectedAddress; AddressInfo _selectedAddress;
bool showCurrentLocation = false;
@override @override
void initState() { void initState() {
@ -60,13 +62,25 @@ class _NewHomeHealthCareStepTowPageState
} }
setLatitudeAndLongitude({bool isSetState = false, String latLong}) { setLatitudeAndLongitude({bool isSetState = false, String latLong}) {
if (latLong == null) if (latLong == null){
latLong = widget.model.addressesList[widget.model.addressesList if(widget.model.addressesList.isEmpty) {
.length - 1].latLong; setState(() {
List latLongArr = latLong.split(','); showCurrentLocation = true;
});
} else {
latLong = widget.model.addressesList[widget.model.addressesList
.length - 1].latLong;
}
}
if(!showCurrentLocation) {
List latLongArr = latLong.split(',');
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
}
latitude = double.parse(latLongArr[0]);
longitude = double.parse(latLongArr[1]);
} }
@override @override
@ -147,8 +161,9 @@ class _NewHomeHealthCareStepTowPageState
); );
}, },
initialPosition: LatLng(latitude, longitude), initialPosition: LatLng(latitude, longitude),
useCurrentLocation: false, useCurrentLocation: showCurrentLocation,
), ),
if(widget.model.addressesList.isNotEmpty)
Container( Container(
child: InkWell( child: InkWell(
onTap: () => onTap: () =>

@ -64,6 +64,7 @@ class _BloodCholesterolState extends State<BloodCholesterol> {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).bloodCholesterol, appBarTitle: TranslationBase.of(context).bloodCholesterol,
isShowDecPage: false,
body: Padding( body: Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: SingleChildScrollView( child: SingleChildScrollView(

@ -66,6 +66,7 @@ class _TriglyceridesState extends State<Triglycerides> {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: TranslationBase.of(context).triglycerides, appBarTitle: TranslationBase.of(context).triglycerides,
isShowDecPage: false,
body: Padding( body: Padding(
padding: const EdgeInsets.all(16.0), padding: const EdgeInsets.all(16.0),
child: SingleChildScrollView( child: SingleChildScrollView(

@ -8,7 +8,8 @@ class MyWebView extends StatelessWidget {
final String title; final String title;
final String selectedUrl; final String selectedUrl;
final Completer<WebViewController> _controller = Completer<WebViewController>(); final Completer<WebViewController> _controller =
Completer<WebViewController>();
MyWebView({ MyWebView({
@required this.title, @required this.title,
@ -20,6 +21,7 @@ class MyWebView extends StatelessWidget {
return AppScaffold( return AppScaffold(
isShowAppBar: true, isShowAppBar: true,
appBarTitle: title, appBarTitle: title,
isShowDecPage: false,
body: WebView( body: WebView(
initialUrl: selectedUrl, initialUrl: selectedUrl,
javascriptMode: JavascriptMode.unrestricted, javascriptMode: JavascriptMode.unrestricted,

@ -1,11 +1,18 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/DentalChiefComplaintsModel.dart';
import 'package:diplomaticquarterapp/models/Appointments/DentalProceduresModel.dart';
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart'; import 'package:diplomaticquarterapp/models/Appointments/SearchInfoModel.dart';
import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DentalComplaintCard.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DentalComplaintCard.dart';
import 'package:diplomaticquarterapp/pages/livecare/widgets/clinic_card.dart'; import 'package:diplomaticquarterapp/pages/BookAppointment/widgets/DoctorView.dart';
import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsList.dart';
import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart'; import 'package:diplomaticquarterapp/services/clinic_services/get_clinic_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.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/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/others/app_expandable_notifier.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -22,12 +29,18 @@ class _DentalComplaintsState extends State<DentalComplaints> {
List<ListDentalChiefComplain> complaintsList = []; List<ListDentalChiefComplain> complaintsList = [];
AppSharedPreferences sharedPref = AppSharedPreferences(); AppSharedPreferences sharedPref = AppSharedPreferences();
bool isDataLoaded = false; bool isDataLoaded = false;
bool hasDentalPlan = false;
var languageID; var languageID;
int totalAppointmentTime = 0;
List<DoctorList> doctorsList = [];
DentalProceduresModel dentalProceduresModel;
List<PatientDoctorAppointmentList> patientDoctorAppointmentListHospital = List();
@override @override
void initState() { void initState() {
WidgetsBinding.instance WidgetsBinding.instance.addPostFrameCallback((_) => checkIfHasDentalPlan());
.addPostFrameCallback((_) => getChiefComplaintsList());
super.initState(); super.initState();
} }
@ -38,37 +51,206 @@ class _DentalComplaintsState extends State<DentalComplaints> {
appBarTitle: "Symptoms", appBarTitle: "Symptoms",
body: Container( body: Container(
margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0), margin: EdgeInsets.fromLTRB(10.0, 10.0, 10.0, 0.0),
child: ListView.builder( child: !hasDentalPlan
itemCount: complaintsList.length, ? ListView.builder(
itemBuilder: (BuildContext context, int index) { itemCount: complaintsList.length,
return Container( itemBuilder: (BuildContext context, int index) {
margin: EdgeInsets.only(bottom: 10.0), return Container(
child: DentalComplaintCard( margin: EdgeInsets.only(bottom: 10.0),
listDentalChiefComplain: complaintsList[index], child: DentalComplaintCard(
languageID: languageID, listDentalChiefComplain: complaintsList[index],
languageID: languageID,
),
);
},
)
: Container(
child: SingleChildScrollView(
child: Column(
children: [
Container(
margin: EdgeInsets.only(top: 10.0),
child: Text(TranslationBase.of(context).dentalProcedureList, textAlign: TextAlign.center, style: TextStyle(fontSize: 18.0, fontWeight: FontWeight.bold, letterSpacing: 0.5)),
),
Container(
margin: EdgeInsets.only(top: 20.0),
child: Table(
children: getProceduresData(),
),
),
...List.generate(
patientDoctorAppointmentListHospital.length,
(index) => AppExpandableNotifier(
isExpand: true,
title: patientDoctorAppointmentListHospital[index].filterName + " - " + patientDoctorAppointmentListHospital[index].distanceInKMs + " " + TranslationBase.of(context).km,
bodyWidget: Column(
crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: patientDoctorAppointmentListHospital[index].patientDoctorAppointmentList.map((doctor) {
return DoctorView(
doctor: doctor,
isLiveCareAppointment: false,
);
}).toList(),
)),
)
],
),
), ),
); ),
}, ),
);
}
List<TableRow> getProceduresData() {
List<TableRow> tableRow = [];
tableRow.add(
TableRow(
children: [
Container(
child: Container(
child: Center(
child: Text(TranslationBase.of(context).procedureName, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold, fontSize: 14.0)),
),
),
),
Container(
child: Container(
margin: EdgeInsets.only(bottom: 10.0),
child: Center(
child: Text(TranslationBase.of(context).timeNeeded, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold, fontSize: 14.0)),
),
),
),
],
),
);
dentalProceduresModel.listIsPatientHasOnGoingEstimation.forEach((procedure) {
tableRow.add(TableRow(children: [
Container(
child: Container(
child: Center(
child: Text(procedure.procedureName, textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontSize: 14.0)),
),
),
), ),
Container(
child: Container(
child: Center(
child: Text(procedure.neededTime.toString() + " mins", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontSize: 14.0)),
),
),
),
]));
});
tableRow.add(
TableRow(
children: [
Container(
child: Container(
child: Center(
child: Text(TranslationBase.of(context).totalTimeNeeded, textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold, fontSize: 14.0)),
),
),
),
Container(
child: Container(
margin: EdgeInsets.only(bottom: 10.0),
child: Center(
child: Text(totalAppointmentTime.toString() + " mins", textAlign: TextAlign.center, style: TextStyle(color: Colors.black, fontWeight: FontWeight.bold, fontSize: 14.0)),
),
),
),
],
), ),
); );
return tableRow;
} }
getLanguageID() async { getLanguageID() async {
languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar'); languageID = await sharedPref.getStringWithDefaultValue(APP_LANGUAGE, 'ar');
} }
checkIfHasDentalPlan() {
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
service.checkIfHasDentalPlan(widget.searchInfo.ProjectID, context).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
if (res['List_IsPatientHasOnGoingEstimation'].length != 0) {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).continuePlan,
okText: TranslationBase.of(context).yes,
cancelText: TranslationBase.of(context).no,
okFunction: () => {Navigator.of(context).pop(), continueDentalPlan()},
cancelFunction: () => {getChiefComplaintsList()});
dialog.showAlertDialog(context);
} else {
getChiefComplaintsList();
}
}
}).catchError((err) {
print(err);
});
}
continueDentalPlan() {
DoctorsListService service = new DoctorsListService();
GifLoaderDialogUtils.showMyDialog(context);
int appoTime = 0;
service.getDoctorsList(int.parse("17"), widget.searchInfo.ProjectID, false, context, isContinueDentalPlan: true).then((res) {
GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) {
print(res['List_IsPatientHasOnGoingEstimation']);
dentalProceduresModel = DentalProceduresModel.fromJson(res);
dentalProceduresModel.listIsPatientHasOnGoingEstimation.forEach((procedure) {
appoTime += procedure.neededTime;
});
setState(() {
hasDentalPlan = true;
totalAppointmentTime = appoTime;
});
if (res['DoctorList'].length != 0) {
doctorsList.clear();
res['DoctorList'].forEach((v) {
doctorsList.add(new DoctorList.fromJson(v));
});
doctorsList.forEach((element) {
List<PatientDoctorAppointmentList> doctorByHospital = patientDoctorAppointmentListHospital
.where(
(elementClinic) => elementClinic.filterName == element.projectName,
)
.toList();
if (doctorByHospital.length != 0) {
patientDoctorAppointmentListHospital[patientDoctorAppointmentListHospital.indexOf(doctorByHospital[0])].patientDoctorAppointmentList.add(element);
} else {
patientDoctorAppointmentListHospital
.add(PatientDoctorAppointmentList(filterName: element.projectName, distanceInKMs: element.projectDistanceInKiloMeters.toString(), patientDoctorAppointment: element));
}
});
} else {}
} else {
AppToast.showErrorToast(message: res['ErrorEndUserMessage']);
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
AppToast.showErrorToast(message: err);
});
}
getChiefComplaintsList() { getChiefComplaintsList() {
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
getLanguageID(); getLanguageID();
ClinicListService service = new ClinicListService(); ClinicListService service = new ClinicListService();
service service.getChiefComplaintsList(widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, context).then((res) {
.getChiefComplaintsList(
widget.searchInfo.ClinicID, widget.searchInfo.ProjectID, context)
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
print(res['List_DentalChiefComplain']);
setState(() { setState(() {
res['List_DentalChiefComplain'].forEach((v) { res['List_DentalChiefComplain'].forEach((v) {
complaintsList.add(new ListDentalChiefComplain.fromJson(v)); complaintsList.add(new ListDentalChiefComplain.fromJson(v));

@ -21,9 +21,11 @@ class DocAvailableAppointments extends StatefulWidget {
static String selectedDate; static String selectedDate;
static String selectedTime; static String selectedTime;
bool isLiveCareAppointment; bool isLiveCareAppointment;
final dynamic doctorSchedule;
DocAvailableAppointments( DocAvailableAppointments(
{@required this.doctor, @required this.isLiveCareAppointment}); {@required this.doctor,
this.doctorSchedule,
@required this.isLiveCareAppointment});
@override @override
_DocAvailableAppointmentsState createState() => _DocAvailableAppointmentsState createState() =>
@ -67,6 +69,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
WidgetsBinding.instance.addPostFrameCallback((_) async { WidgetsBinding.instance.addPostFrameCallback((_) async {
getCurrentLanguage(); getCurrentLanguage();
if (widget.isLiveCareAppointment) if (widget.isLiveCareAppointment)
getDoctorScheduledFreeSlots(context, widget.doctor); getDoctorScheduledFreeSlots(context, widget.doctor);
else { else {
@ -107,9 +110,7 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
} }
void _onCalendarCreated( void _onCalendarCreated(
DateTime first, DateTime last, CalendarFormat format) { DateTime first, DateTime last, CalendarFormat format) {}
print('CALLBACK: _onCalendarCreated');
}
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
@ -350,9 +351,24 @@ class _DocAvailableAppointmentsState extends State<DocAvailableAppointments>
freeSlotsResponse = res['FreeTimeSlots']; freeSlotsResponse = res['FreeTimeSlots'];
print("res['FreeTimeSlots']"); print("res['FreeTimeSlots']");
print(res['FreeTimeSlots'].length); print(res['FreeTimeSlots'].length);
_getJSONSlots().then((value) => {
setState(() => {_events.clear(), _events = value}) _getJSONSlots().then((value) {
}); setState(() => {
_events.clear(),
_events = value,
if (widget.doctorSchedule != null)
{
_calendarController.setSelectedDay(
DateUtil.convertStringToDate(
widget.doctorSchedule['Date']),
isProgrammatic: true),
_onDaySelected(
DateUtil.convertStringToDate(
widget.doctorSchedule['Date']),
List())
}
});
});
} else { } else {
DocAvailableAppointments.areAppointmentsAvailable = false; DocAvailableAppointments.areAppointmentsAvailable = false;
} }

@ -1,67 +1,10 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorProfile.dart';
import 'package:diplomaticquarterapp/models/Appointments/doctor_pre_post_image.dart'; import 'package:diplomaticquarterapp/models/Appointments/doctor_pre_post_image.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
class DoctorPostPreImagesPage extends StatefulWidget{ class DoctorPostPreImagesContent extends StatefulWidget {
final DoctorPrePostImages doctorPrePostImages;
const DoctorPostPreImagesPage({this.doctorPrePostImages});
@override
State<StatefulWidget> createState() => DoctorPostPreImagesPageState();
}
class DoctorPostPreImagesPageState extends State<DoctorPostPreImagesPage>{
@override
Widget build(BuildContext context) {
var images = widget.doctorPrePostImages;
return AppScaffold(
appBarTitle: TranslationBase.of(context).beforeAfterImages,
isShowAppBar: true,
isShowDecPage: false,
body: Padding(
padding: const EdgeInsets.symmetric(vertical: 20, horizontal: 10),
child: Row(
children: [
Expanded(
child: Column(
children: [
Text("Before Image", style: TextStyle(color: Colors.black, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),),
Image.memory(images.getPreBytes(), errorBuilder: (ctx,err, trace){
return Container(
color: Colors.grey.withOpacity(0.25),
);
},)
],
)
),
Divider(color: Colors.grey.withOpacity(0.5)),
Expanded(
child: Column(
children: [
Text("After Image", style: TextStyle(color: Colors.black, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),),
Image.memory(images.getPostBytes(),errorBuilder: (ctx,err, trace){
return Container(
color: Colors.grey.withOpacity(0.25),
);
},)
],
)
)
],
),
)
);
}
}
class DoctorPostPreImagesContent extends StatefulWidget{
final DoctorPrePostImages doctorPrePostImages; final DoctorPrePostImages doctorPrePostImages;
const DoctorPostPreImagesContent({this.doctorPrePostImages}); const DoctorPostPreImagesContent({this.doctorPrePostImages});
@ -70,14 +13,13 @@ class DoctorPostPreImagesContent extends StatefulWidget{
DoctorPostPreImagesContentState createState() => DoctorPostPreImagesContentState(); DoctorPostPreImagesContentState createState() => DoctorPostPreImagesContentState();
} }
class DoctorPostPreImagesContentState extends State<DoctorPostPreImagesContent>{ class DoctorPostPreImagesContentState extends State<DoctorPostPreImagesContent> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
var images = widget.doctorPrePostImages; var images = widget.doctorPrePostImages;
return Material( return Center(
color: Colors.transparent, child: Material(
child: Center( color: Colors.transparent,
child: Column( child: Column(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
children: [ children: [
@ -85,31 +27,45 @@ class DoctorPostPreImagesContentState extends State<DoctorPostPreImagesContent>{
children: [ children: [
Expanded( Expanded(
child: Column( child: Column(
children: [ children: [
Text("Before", style: TextStyle(color: Colors.white, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),), Text(
SizedBox(height: 10,), "Before",
Image.memory(images.getPreBytes(), errorBuilder: (ctx,err, trace){ style: TextStyle(color: Colors.white, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),
return Container( ),
color: Colors.grey.withOpacity(0.25), SizedBox(
); height: 10,
},) ),
], Image.memory(
images.getPreBytes(),
errorBuilder: (ctx, err, trace) {
return Container(
color: Colors.grey.withOpacity(0.25),
);
},
) )
), ],
)),
Divider(color: Colors.grey.withOpacity(0.5)), Divider(color: Colors.grey.withOpacity(0.5)),
Expanded( Expanded(
child: Column( child: Column(
children: [ children: [
Text("After", style: TextStyle(color: Colors.white, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),), Text(
SizedBox(height: 10,), "After",
Image.memory(images.getPostBytes(),errorBuilder: (ctx,err, trace){ style: TextStyle(color: Colors.white, fontSize: 17, fontWeight: FontWeight.bold, letterSpacing: 1),
return Container( ),
color: Colors.grey.withOpacity(0.25), SizedBox(
); height: 10,
},) ),
], Image.memory(
images.getPostBytes(),
errorBuilder: (ctx, err, trace) {
return Container(
color: Colors.grey.withOpacity(0.25),
);
},
) )
) ],
))
], ],
), ),
], ],
@ -117,5 +73,4 @@ class DoctorPostPreImagesContentState extends State<DoctorPostPreImagesContent>{
), ),
); );
} }
}
}

@ -1,8 +1,8 @@
import 'dart:collection';
import 'dart:convert'; import 'dart:convert';
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidPaymentInfoResponse.dart';
import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart'; import 'package:diplomaticquarterapp/models/CovidDriveThru/CovidTestProceduresResponse.dart';
import 'package:diplomaticquarterapp/pages/medical/labs/passport_update_page.dart';
import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart'; import 'package:diplomaticquarterapp/services/covid-drivethru/covid-drivethru.dart';
import 'package:diplomaticquarterapp/uitl/app_toast.dart'; import 'package:diplomaticquarterapp/uitl/app_toast.dart';
import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart'; import 'package:diplomaticquarterapp/uitl/gif_loader_dialog_utils.dart';
@ -11,19 +11,20 @@ import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
import 'covid-payment-details.dart'; import 'covid-payment-details.dart';
class CovidDirveThruQuestions extends StatefulWidget{
class CovidDirveThruQuestions extends StatefulWidget {
final String projectId; final String projectId;
final List<CovidTestProceduresResponse> proceduresList; final List<CovidTestProceduresResponse> proceduresList;
CovidDirveThruQuestions({@required this.projectId, @required this.proceduresList}); CovidDirveThruQuestions({@required this.projectId, @required this.proceduresList});
@override @override
CovidDirveThruQuestionsState createState() => CovidDirveThruQuestionsState(); CovidDirveThruQuestionsState createState() => CovidDirveThruQuestionsState();
} }
class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions>{
class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions> {
List qa; List qa;
@override @override
@ -33,10 +34,11 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions>{
} }
TranslationBase localize; TranslationBase localize;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
localize = TranslationBase.of(context); localize = TranslationBase.of(context);
var isArabic = localize.isArabic(); var isArabic = localize.isArabic();
return AppScaffold( return AppScaffold(
appBarTitle: TranslationBase.of(context).covidTest, appBarTitle: TranslationBase.of(context).covidTest,
isShowAppBar: true, isShowAppBar: true,
@ -49,54 +51,50 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions>{
), ),
Expanded( Expanded(
child: ListView.separated( child: ListView.separated(
padding: EdgeInsets.symmetric(horizontal: 20), padding: EdgeInsets.symmetric(horizontal: 20),
itemCount: qa.length, itemCount: qa.length,
itemBuilder: (ctx, idx){ itemBuilder: (ctx, idx) {
var obj = qa[idx]; var obj = qa[idx];
var qtext = isArabic ? obj["questionAR"] : obj["questionEN"]; var qtext = isArabic ? obj["questionAR"] : obj["questionEN"];
return Padding(
padding: const EdgeInsets.symmetric(vertical: 10),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(qtext, style: TextStyle(fontSize: 15, letterSpacing: 1.5)),
Row(
children: [
Radio<int>(
value: 1,
groupValue: obj["ans"],
onChanged: (newValue){
setState(() {
obj["ans"] = newValue;
});
}
),
Text(localize.yes),
],
),
Row( return Padding(
children: [ padding: const EdgeInsets.symmetric(vertical: 10),
Radio<int>( child: Column(
value: 0, crossAxisAlignment: CrossAxisAlignment.start,
groupValue: obj["ans"], children: [
onChanged: (newValue){ Text(qtext, style: TextStyle(fontSize: 15, letterSpacing: 1.5)),
setState(() { Row(
obj["ans"] = newValue; children: [
}); Radio<int>(
} value: 1,
), groupValue: obj["ans"],
Text(localize.no), onChanged: (newValue) {
], setState(() {
) obj["ans"] = newValue;
], });
), }),
); Text(localize.yes),
}, ],
separatorBuilder: (ctx, idx) => Divider(height: 0.25, color: Colors.grey.withOpacity(0.5)), ),
) Row(
), children: [
Radio<int>(
value: 0,
groupValue: obj["ans"],
onChanged: (newValue) {
setState(() {
obj["ans"] = newValue;
});
}),
Text(localize.no),
],
)
],
),
);
},
separatorBuilder: (ctx, idx) => Divider(height: 0.25, color: Colors.grey.withOpacity(0.5)),
)),
Padding( Padding(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10), padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 10),
child: FractionallySizedBox( child: FractionallySizedBox(
@ -105,31 +103,43 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions>{
height: 50, height: 50,
color: Theme.of(context).appBarTheme.color, color: Theme.of(context).appBarTheme.color,
disabledColor: Theme.of(context).appBarTheme.color.withOpacity(0.25), disabledColor: Theme.of(context).appBarTheme.color.withOpacity(0.25),
shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10) ), shape: RoundedRectangleBorder(borderRadius: BorderRadius.circular(10)),
child: Text(localize.next, style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),), child: Text(
onPressed: next localize.next,
), style: TextStyle(color: Colors.white, fontSize: 13, letterSpacing: 1),
),
onPressed: next),
), ),
), ),
], ],
) ));
);
} }
next() async{ next() async {
bool all = true; bool all = true;
qa.forEach((element) { qa.forEach((element) {
all = all && (element["ans"] == 1 || element["ans"] == 0); all = all && (element["ans"] == 1 || element["ans"] == 0);
}); });
if(all) if (all) if (qa[0]["ans"] == 1) {
getPaymentInfo(context,widget.projectId); openPassportUpdatePage();
} else {
getPaymentInfo(context, widget.projectId);
}
else else
AppToast.showErrorToast(message: localize.pleaseSelectAllQuestionToContinue); AppToast.showErrorToast(message: localize.pleaseSelectAllQuestionToContinue);
} }
List getQuestionsFromJson(){ openPassportUpdatePage() {
var questionsJson = Navigator.push(context, FadePage(page: PassportUpdatePage())).then((value) {
""" print(value);
if(value != null && value == true) {
getPaymentInfo(context, widget.projectId);
}
});
}
List getQuestionsFromJson() {
var questionsJson = """
[{"id":1,"questionEN":"Is the test intended for travel?","questionAR":"هل تجري التحليل بغرض السفر؟","ans":2},{"id":2,"questionEN":"Coming from outside KSA within last 2 weeks?","questionAR":"هل قدمت من خارج المملكة خلال الأسبوعين الماضيين؟","ans":2},{"id":3,"questionEN":"Do you currently have fever?","questionAR":"هل تعاني حاليا من حرارة؟","ans":2},{"id":4,"questionEN":"Did you have fever in last 2 weeks?","questionAR":"هل عانيت من حرارة في الأسبوعين الماضيين؟","ans":2},{"id":5,"questionEN":"Do you have a sore throat?","questionAR":"هل لديك التهاب في الحلق؟","ans":2},{"id":6,"questionEN":"Do you have a runny nose?","questionAR":"هل لديك سيلان بالأنف؟"},{"id":7,"questionEN":"Do you have a cough?","questionAR":"هل لديك سعال؟","ans":2},{"id":8,"questionEN":"Do you have shortness of breath?","questionAR":"هل تعانين من ضيق في التنفس؟","ans":2},{"id":9,"questionEN":"Do you have nausea?","questionAR":"هل تعانين من غثيان؟","ans":2},{"id":10,"questionEN":"Do you have vomiting?","questionAR":"هل تعاني من القيء؟","ans":2},{"id":11,"questionEN":"Do you have a headache?","questionAR":"هل تعاني من صداع في الرأس؟","ans":2},{"id":12,"questionEN":"Do you have muscle pain?","questionAR":"هل تعانين من آلام عضلية؟","ans":2},{"id":13,"questionEN":"Do you have joint pain?","questionAR":"هل تعانين من آلام المفاصل؟","ans":2},{"id":14,"questionEN":"Do you have diarrhea?","questionAR":"هل لديك اسهال؟","ans":2}]"""; [{"id":1,"questionEN":"Is the test intended for travel?","questionAR":"هل تجري التحليل بغرض السفر؟","ans":2},{"id":2,"questionEN":"Coming from outside KSA within last 2 weeks?","questionAR":"هل قدمت من خارج المملكة خلال الأسبوعين الماضيين؟","ans":2},{"id":3,"questionEN":"Do you currently have fever?","questionAR":"هل تعاني حاليا من حرارة؟","ans":2},{"id":4,"questionEN":"Did you have fever in last 2 weeks?","questionAR":"هل عانيت من حرارة في الأسبوعين الماضيين؟","ans":2},{"id":5,"questionEN":"Do you have a sore throat?","questionAR":"هل لديك التهاب في الحلق؟","ans":2},{"id":6,"questionEN":"Do you have a runny nose?","questionAR":"هل لديك سيلان بالأنف؟"},{"id":7,"questionEN":"Do you have a cough?","questionAR":"هل لديك سعال؟","ans":2},{"id":8,"questionEN":"Do you have shortness of breath?","questionAR":"هل تعانين من ضيق في التنفس؟","ans":2},{"id":9,"questionEN":"Do you have nausea?","questionAR":"هل تعانين من غثيان؟","ans":2},{"id":10,"questionEN":"Do you have vomiting?","questionAR":"هل تعاني من القيء؟","ans":2},{"id":11,"questionEN":"Do you have a headache?","questionAR":"هل تعاني من صداع في الرأس؟","ans":2},{"id":12,"questionEN":"Do you have muscle pain?","questionAR":"هل تعانين من آلام عضلية؟","ans":2},{"id":13,"questionEN":"Do you have joint pain?","questionAR":"هل تعانين من آلام المفاصل؟","ans":2},{"id":14,"questionEN":"Do you have diarrhea?","questionAR":"هل لديك اسهال؟","ans":2}]""";
var map = json.decode(questionsJson) as List; var map = json.decode(questionsJson) as List;
return map; return map;
@ -137,29 +147,22 @@ class CovidDirveThruQuestionsState extends State<CovidDirveThruQuestions>{
getPaymentInfo(BuildContext context, String projectID) { getPaymentInfo(BuildContext context, String projectID) {
CovidDriveThruService service = new CovidDriveThruService(); CovidDriveThruService service = new CovidDriveThruService();
CovidPaymentInfoResponse covidPaymentInfoResponse = CovidPaymentInfoResponse covidPaymentInfoResponse = new CovidPaymentInfoResponse();
new CovidPaymentInfoResponse();
GifLoaderDialogUtils.showMyDialog(context); GifLoaderDialogUtils.showMyDialog(context);
service.getCovidPaymentInformation(context, int.parse(projectID), widget.proceduresList[0].procedureID) service.getCovidPaymentInformation(context, int.parse(projectID), widget.proceduresList[0].procedureID).then((res) {
.then((res) {
GifLoaderDialogUtils.hideDialog(context); GifLoaderDialogUtils.hideDialog(context);
if (res['MessageStatus'] == 1) { if (res['MessageStatus'] == 1) {
// setState(() {
// covidPaymentInfoResponse =
// CovidPaymentInfoResponse.fromJson(res['COVID19_PatientShare']);
// });
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: CovidPaymentDetails( page: CovidPaymentDetails(
covidPaymentInfoResponse: covidPaymentInfoResponse, covidPaymentInfoResponse: covidPaymentInfoResponse,
projectID: int.parse(projectID), projectID: int.parse(projectID),
proceduresList: widget.proceduresList, proceduresList: widget.proceduresList,
))); )));
} else {} } else {}
}).catchError((err) { }).catchError((err) {
print(err); print(err);
}); });
} }
}
}

@ -15,16 +15,17 @@ import 'package:diplomaticquarterapp/pages/MyAppointments/SchedulePage.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'widgets/AppointmentActions.dart'; import 'widgets/AppointmentActions.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
class AppointmentDetails extends StatefulWidget { class AppointmentDetails extends StatefulWidget {
AppoitmentAllHistoryResultList appo; AppoitmentAllHistoryResultList appo;
static bool isLoading = false; static bool isLoading = false;
final dynamic doctorSchedule;
static bool showFooterButton = false; static bool showFooterButton = false;
AppointmentDetails({@required this.appo}); AppointmentDetails({@required this.appo, this.doctorSchedule});
@override @override
_AppointmentDetailsState createState() => _AppointmentDetailsState(); _AppointmentDetailsState createState() => _AppointmentDetailsState();
@ -34,13 +35,20 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
with SingleTickerProviderStateMixin { with SingleTickerProviderStateMixin {
static TabController _tabController; static TabController _tabController;
AppSharedPreferences sharedPref = AppSharedPreferences();
List<DoctorRateDetails> doctorDetailsList = List(); List<DoctorRateDetails> doctorDetailsList = List();
@override @override
void initState() { void initState() {
_tabController = new TabController(length: 2, vsync: this);
AppointmentDetails.showFooterButton = false; AppointmentDetails.showFooterButton = false;
print(widget.appo.clinicID); if (widget.doctorSchedule != null) {
_tabController =
new TabController(length: 2, vsync: this, initialIndex: 1);
widget.appo.appointmentDate = widget.doctorSchedule['Date'];
} else {
_tabController = new TabController(length: 2, vsync: this);
}
setTab();
super.initState(); super.initState();
} }
@ -233,6 +241,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
enableFooterButton: enableFooterButton), enableFooterButton: enableFooterButton),
DocAvailableAppointments( DocAvailableAppointments(
doctor: getDoctorObject(), doctor: getDoctorObject(),
doctorSchedule: widget.doctorSchedule,
isLiveCareAppointment: isLiveCareAppointment:
widget.appo.isLiveCareAppointment) widget.appo.isLiveCareAppointment)
], ],
@ -241,7 +250,7 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
), ),
], ],
), ),
_tabController.index == 0 _tabController.index == 1
? Positioned( ? Positioned(
right: 30.0, right: 30.0,
//top: 30.0, //top: 30.0,
@ -607,6 +616,18 @@ class _AppointmentDetailsState extends State<AppointmentDetails>
} }
void openSchedule() { void openSchedule() {
Navigator.push(context, FadePage(page: SchedulePage(getDoctorObject()))); Navigator.push(
context,
FadePage(
page: SchedulePage(
appo: widget.appo,
doctorList: getDoctorObject(),
)));
}
setTab() async {
var scheduleDoctor = await sharedPref.getObject(DOCTOR_SCHEDULE_DATE_SEL);
widget.appo.appointmentDate = scheduleDoctor['Date'];
} }
} }

@ -1,4 +1,5 @@
import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart'; import 'package:diplomaticquarterapp/models/Appointments/DoctorListResponse.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/AppointmentDetails.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/models/DoctorScheduleResponse.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/models/DoctorScheduleResponse.dart';
import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/indicator.dart'; import 'package:diplomaticquarterapp/pages/MyAppointments/widgets/indicator.dart';
@ -6,16 +7,22 @@ import 'package:diplomaticquarterapp/services/appointment_services/GetDoctorsLis
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart'; import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/uitl/date_uitl.dart'; import 'package:diplomaticquarterapp/uitl/date_uitl.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:hexcolor/hexcolor.dart';
import 'package:diplomaticquarterapp/widgets/data_display/text.dart'; import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/medical/medical_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/models/Appointments/AppoimentAllHistoryResultList.dart';
class SchedulePage extends StatefulWidget { class SchedulePage extends StatefulWidget {
final DoctorList doctorList; final DoctorList doctorList;
final AppoitmentAllHistoryResultList appo;
SchedulePage(this.doctorList); SchedulePage({
this.appo,
this.doctorList,
});
@override @override
_SchedulePageState createState() => _SchedulePageState(); _SchedulePageState createState() => _SchedulePageState();
} }
@ -25,139 +32,226 @@ class _SchedulePageState extends State<SchedulePage> {
PageController _pageController = PageController(); PageController _pageController = PageController();
double currentPage = 0; double currentPage = 0;
int selectedindex = 0; int selectedindex = 0;
bool isLoading = true; List weeks = [];
List<DoctorScheduleResponse> doctorScheduleResponse = []; List<DoctorScheduleResponse> doctorScheduleResponse = [];
final List<Widget> introWidgetsList = <Widget>[ int weekMS = 604800 * 1000;
Text('Hello'), DoctorList doctorList;
Text('Hi'), List<String> freeSlots = [];
Text('hey') bool isPageChange = false;
];
AppSharedPreferences sharedPref = AppSharedPreferences();
@override @override
void initState() { void initState() {
//getSchedule(widget.doctorList, context); this.doctorList = widget.doctorList;
// _pageController.addListener(() {
// setState(() {
// currentPage = _pageController.page;
// });
// });
super.initState(); super.initState();
} }
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<MedicalViewModel>( return BaseView<MedicalViewModel>(
onModelReady: (model) => model.getDoctorSchedule(widget.doctorList), onModelReady: (model) => model.getDoctorSchedule(doctorList),
builder: (_, model, widget) => AppScaffold( builder: (_, model, widget) => BaseView<MedicalViewModel>(
appBarTitle: TranslationBase.of(context).schedule, onModelReady: (model2) => model2.getFreeSlots(doctorList),
isShowAppBar: true, builder: (_, model2, widget2) {
baseViewModel: model, if (model.freeSlots.length > 0 && isPageChange == false) {
body: SizedBox( this.freeSlots = model.freeSlots;
height: MediaQuery.of(context).size.height, this.doctorScheduleResponse = model.getDoctorScheduleList;
child: Stack(
children: [ this.generateWeeksSchedules();
Container( }
child: PageView.builder( return AppScaffold(
controller: _pageController, appBarTitle: TranslationBase.of(context).schedule,
itemCount: 3, isShowAppBar: true,
onPageChanged: (index) { baseViewModel: model2,
setState(() { body: SizedBox(
this.currentPage = index.toDouble(); height: MediaQuery.of(context).size.height,
}); child: Stack(
}, children: [
itemBuilder: (context, index) { Container(
return Container( margin: EdgeInsets.only(top: 40),
child: ListView.builder( child: PageView.builder(
itemCount: model.getDoctorScheduleList.length, controller: _pageController,
itemBuilder: (context, index) => ClipRRect( itemCount: weeks.length,
borderRadius: const BorderRadius.all( onPageChanged: (index) {
Radius.circular(20.0)), setState(() {
child: Container( isPageChange = true;
padding: EdgeInsets.only( this.currentPage = index.toDouble();
left: 10, });
right: 10, },
top: 20, itemBuilder: (context, index) {
bottom: 20), return Container(
margin: EdgeInsets.only( child: ListView.builder(
left: 20, itemCount: weeks[index].length,
right: 20, itemBuilder: (context, index2) =>
top: 7, InkWell(
bottom: 7), onTap: () {
decoration: BoxDecoration( openBookAppointment(
boxShadow: [ weeks[index][index2]);
BoxShadow( },
color: Colors.green, child: Row(
offset: Offset(-10, 0)), children: [
], Expanded(
borderRadius: flex: 1,
const BorderRadius.all( child: Padding(
Radius.circular(10.0)), padding:
color: Colors.white), EdgeInsets.only(
child: Row( left: 20),
children: [ child: Row(
Expanded( children: [
child: Row(children: [ Column(
Column( children: [
children: [ Texts(
Texts( weeks[index][index2]
model [
.getDoctorScheduleList[ 'DayName'],
index] fontSize:
.dayName, 13,
color: ),
HexColor('#0bb690'), Texts(
), getDayMonths(
Texts( DateUtil
DateUtil .convertStringToDate(
.getDayMonthYearDateFormatted( weeks[index][index2]['Date'],
DateUtil ),
.convertStringToDate( ),
model fontWeight:
.getDoctorScheduleList[ FontWeight.bold,
index] fontSize:
.date, 18,
), )
],
)
])),
), ),
color: Expanded(
HexColor('#0bb690'), flex: 3,
) child: ClipRRect(
], borderRadius:
) const BorderRadius
]), .all(
), Radius.circular(
Expanded( 20.0)),
child: Texts( child: Container(
model padding:
.getDoctorScheduleList[ EdgeInsets.only(
index] left:
.workingHours, 10,
color: HexColor('#0bb690'), right:
), 10,
) top: 20,
], bottom:
))))); 20),
}, margin: EdgeInsets.only(
)), left: 20,
PageViewIndicator( right: 20,
isActive: true, top: 7,
currentPage: this.currentPage, bottom: 7),
length: introWidgetsList.length, decoration: BoxDecoration(
) boxShadow: [
], weeks[index][index2]['fullDay'] ==
)))); false
? BoxShadow(
color: Colors.green,
offset: Offset(-5, 0))
: BoxShadow(),
],
borderRadius:
const BorderRadius.all(Radius.circular(
10.0)),
color: Colors
.white),
child: Row(
children: [
Expanded(
child:
Texts(
weeks[index][index2]
[
'WorkingHours'],
fontWeight:
FontWeight.w400,
),
)
],
))),
)
],
))));
},
)),
PageViewIndicator(
isActive: true,
currentPage: this.currentPage,
length: weeks.length,
)
],
)));
}));
}
generateWeeksSchedules() {
this.weeks.clear();
for (var i = 0; i < 8; i++) {
var weekSchedule = generateNewWeekSchedule(i);
this.markWeekFreeDays(weekSchedule);
this.weeks.add(weekSchedule);
}
//print(this.weeks);
}
markWeekFreeDays(schedule) {
for (var workDay in schedule) {
workDay['fullDay'] = !this.hasFreeSlot(workDay['Date']);
}
}
generateNewWeekSchedule(weekIndex) {
var weekMSOffset = weekIndex * weekMS;
var newWeekSchedule = [];
for (var workDay in this.doctorScheduleResponse) {
Map<String, dynamic> newWorkDay = Map();
newWorkDay['Date'] = DateUtil.convertDateMSToJsonDate(
DateUtil.convertStringToDate(workDay.date).millisecondsSinceEpoch +
weekMSOffset);
newWorkDay['DayName'] = workDay.dayName;
newWorkDay['WorkingHours'] = workDay.workingHours;
newWeekSchedule.add(newWorkDay);
}
return newWeekSchedule;
}
hasFreeSlot(String jsonDate) {
var date = DateUtil.convertStringToDate(jsonDate);
var scheduleDay = date;
for (var event in this.freeSlots) {
var date = DateUtil.convertStringToDate(event);
var nDate = DateTime(date.year, date.month, date.day);
if (nDate.millisecondsSinceEpoch == scheduleDay.millisecondsSinceEpoch) {
return true;
}
}
return false;
}
String getDayMonths(DateTime dateTime) {
String dateFormat =
'${dateTime.day} ${DateUtil.getMonth(dateTime.month).toString().substring(0, 3)}';
return dateFormat;
} }
//getSchedule(DoctorList doctor, BuildContext context) { openBookAppointment(selectedDate) {
//GifLoaderDialogUtils.showMyDialog(context); //sharedPref.setObject(DOCTOR_SCHEDULE_DATE_SEL, selectedDate);
//service = new DoctorsListService(); Navigator.push(
// service.getSchedule(doctor).then((value) { context,
// doctorScheduleResponse.clear(); FadePage(
// setState(() { page: AppointmentDetails(
// value['List_DoctorWorkingHoursTable'].forEach((item) => { appo: widget.appo,
// doctorScheduleResponse.add(DoctorScheduleResponse.fromJson(item)) doctorSchedule: selectedDate,
// }); ),
// GifLoaderDialogUtils.hideDialog(context); ),
// }); );
// }); }
// }
} }

@ -17,11 +17,11 @@ class PageViewIndicator extends StatelessWidget {
Widget _indicator(bool isActive) { Widget _indicator(bool isActive) {
return Positioned( return Positioned(
bottom: 10, top: 20,
left: 0, left: 0,
right: 0, right: 0,
child: Container( child: Container(
margin: EdgeInsets.only(bottom: 35), margin: EdgeInsets.only(top: 0),
child: Row( child: Row(
mainAxisSize: MainAxisSize.min, mainAxisSize: MainAxisSize.min,
mainAxisAlignment: MainAxisAlignment.center, mainAxisAlignment: MainAxisAlignment.center,
@ -37,7 +37,7 @@ class PageViewIndicator extends StatelessWidget {
Widget circleBar(bool isActive) { Widget circleBar(bool isActive) {
return AnimatedContainer( return AnimatedContainer(
duration: Duration(milliseconds: 150), duration: Duration(milliseconds: 150),
margin: EdgeInsets.symmetric(horizontal: 8), margin: EdgeInsets.symmetric(horizontal: 3),
height: isActive ? 12 : 8, height: isActive ? 12 : 8,
width: isActive ? 12 : 8, width: isActive ? 12 : 8,
decoration: BoxDecoration( decoration: BoxDecoration(

@ -66,8 +66,8 @@ class _Login extends State<Login> {
super.initState(); super.initState();
if(BASE_URL.contains("uat.")){ if(BASE_URL.contains("uat.")){
nationalIDorFile.text = "1231755"; nationalIDorFile.text = "2001273";
mobileNumberController.text = mobileNo = "537503378"; mobileNumberController.text = mobileNo = "0555416043";
} }
} }
@ -278,10 +278,10 @@ class _Login extends State<Login> {
// result['CRSVerificationStatus']; // result['CRSVerificationStatus'];
projectViewModel.user = authenticatedUserObject.user; projectViewModel.user = authenticatedUserObject.user;
await pharmacyModuleViewModel.generatePharmacyToken().then((value) async { // await pharmacyModuleViewModel.generatePharmacyToken().then((value) async {
if (pharmacyModuleViewModel.error.isNotEmpty) // if (pharmacyModuleViewModel.error.isNotEmpty)
await pharmacyModuleViewModel.createUser(); // await pharmacyModuleViewModel.createUser();
}); // });
appointmentRateViewModel appointmentRateViewModel
.getIsLastAppointmentRatedList() .getIsLastAppointmentRatedList()

@ -0,0 +1,125 @@
import 'package:diplomaticquarterapp/core/service/medical/labs_service.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/input/text_field.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
class PassportUpdatePage extends StatefulWidget {
@override
_PassportUpdatePageState createState() => _PassportUpdatePageState();
}
class _PassportUpdatePageState extends State<PassportUpdatePage> {
TextEditingController passportNumber = new TextEditingController();
bool _isButtonDisabled;
@override
void initState() {
WidgetsBinding.instance.addPostFrameCallback((_) => getPassportNumber());
super.initState();
}
@override
Widget build(BuildContext context) {
return AppScaffold(
appBarTitle: TranslationBase.of(context).passportNumber,
isShowAppBar: true,
isBottomBar: true,
body: Container(
child: SingleChildScrollView(
child: Column(
crossAxisAlignment: CrossAxisAlignment.center,
children: [
Container(
margin: EdgeInsets.all(45.0),
child: Text(TranslationBase.of(context).enterPassportNumber, textAlign: TextAlign.center, style: TextStyle(fontSize: 22.0, fontWeight: FontWeight.bold, color: Colors.black)),
),
Container(
margin: EdgeInsets.only(top: 5.0, bottom: 5.0),
child: SvgPicture.asset("assets/images/new-design/passport.svg", width: 250.0, fit: BoxFit.fill),
),
Container(
margin: EdgeInsets.only(left: 50.0, right: 50.0, top: 25.0),
child: TextFields(
keyboardType: TextInputType.text,
fontWeight: FontWeight.normal,
controller: passportNumber,
onChanged: (value) => {_onPassportTextChanged(value)},
padding: EdgeInsets.only(top: 20, bottom: 20, left: 10, right: 10),
hintText: TranslationBase.of(context).passportNumber,
))
],
),
),
),
bottomSheet: Container(
margin: EdgeInsets.only(top: 10.0, left: 30.0, right: 30.0, bottom: 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width,
height: 45.0,
child: RaisedButton(
color: new Color(0xFFc5272d),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: Colors.red[300],
onPressed: () {
if (_isButtonDisabled == false)
updatePassportNumber();
else
AppToast.showErrorToast(message: TranslationBase.of(context).validPassportNumber);
},
child: Text(TranslationBase.of(context).submit, style: TextStyle(fontSize: 18.0)),
),
),
),
);
}
_onPassportTextChanged(content) {
if (content.length >= 1) {
setState(() {
_isButtonDisabled = false;
});
} else {
setState(() {
_isButtonDisabled = true;
});
}
}
void updatePassportNumber() {
LabsService service = new LabsService();
GifLoaderDialogUtils.showMyDialog(context);
service.updateCovidPassportNumber(passportNumber.text).then((res) {
GifLoaderDialogUtils.hideDialog(context);
Navigator.of(context).pop(true);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
void getPassportNumber() {
LabsService service = new LabsService();
GifLoaderDialogUtils.showMyDialog(context);
service.getCovidPassportNumber().then((res) {
GifLoaderDialogUtils.hideDialog(context);
print(res['Covid19_Certificate_GetPassportList'][0]['PassportNo']);
passportNumber.text = res['Covid19_Certificate_GetPassportList'][0]['PassportNo'];
if(res['Covid19_Certificate_GetPassportList'][0]['PassportNo'] != "") {
_isButtonDisabled = false;
}
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
}

@ -15,7 +15,7 @@ import 'package:flutter/material.dart';
import 'package:font_awesome_flutter/font_awesome_flutter.dart'; import 'package:font_awesome_flutter/font_awesome_flutter.dart';
import 'package:provider/provider.dart'; import 'package:provider/provider.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/recommendedProduct_model.dart';
import 'screens/cart-order-page.dart'; import 'screens/cart-order-page.dart';
int price = 0; int price = 0;
@ -28,12 +28,15 @@ String itemID;
var customerId; var customerId;
CompareList compareItems = new CompareList(); CompareList compareItems = new CompareList();
PharmacyProduct specificationData; PharmacyProduct specificationData;
//Products recommendedData;
class ProductDetailPage extends StatefulWidget { class ProductDetailPage extends StatefulWidget {
final PharmacyProduct product; final PharmacyProduct product;
// final Products recommendedProducts;
ProductDetailPage(this.product, );
ProductDetailPage(this.product);
@override @override
__ProductDetailPageState createState() => __ProductDetailPageState(); __ProductDetailPageState createState() => __ProductDetailPageState();
@ -73,6 +76,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
price = 1; price = 1;
specificationData = widget.product; specificationData = widget.product;
userInfo(); userInfo();
// recommendedData= widget.recommendedProducts;
super.initState(); super.initState();
} }
@ -631,10 +635,11 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
), ),
SingleChildScrollView( SingleChildScrollView(
child: Container( child: Container(
width: 410,
color: Colors.white, color: Colors.white,
child: Column( child: Column(
// crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
mainAxisAlignment: MainAxisAlignment.start, // mainAxisAlignment: MainAxisAlignment.start,
// mainAxisSize: MainAxisSize.min, // mainAxisSize: MainAxisSize.min,
children: [ children: [
Container( Container(
@ -645,7 +650,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
// margin: EdgeInsets.symmetric(horizontal: 6, vertical: 4), // margin: EdgeInsets.symmetric(horizontal: 6, vertical: 4),
child: BaseView<PharmacyModuleViewModel>( child: BaseView<PharmacyModuleViewModel>(
onModelReady: (model) => model.getRecommendedProducts(widget.product.id.toString()), onModelReady: (model) => model.getRecommendedProducts(widget.product.id),
builder: (_, model, wi) => Container( builder: (_, model, wi) => Container(
child: child:
// Text(model.recommendedProductList[0].id), // Text(model.recommendedProductList[0].id),
@ -664,7 +669,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
Navigator.push( Navigator.push(
context, context,
FadePage( FadePage(
page: ProductDetailPage(model.recommendedProductList[index]), page: ProductDetailPage(widget.product.id),
)); ));
}, },
child: Card( child: Card(
@ -694,26 +699,40 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
child: Align( child: Align(
alignment: Alignment.topRight, alignment: Alignment.topRight,
child: IconButton( child: IconButton(
icon: Icon(!isInWishlit ? Icons.favorite_border : Icons.favorite), icon: Icon(model.recommendedProductList[index]['isinwishlist'] != true ? Icons.favorite_border : Icons.favorite),
color: !isInWishlit ? Colors.grey : Colors.red, color: model.recommendedProductList[index]['isinwishlist'] != true ? Colors.grey : Colors.red,
onPressed: () async { onPressed: () async {
if (customerId != null) { if (customerId != null ) {
if (!isInWishlit) { if (!isInWishlit && model.recommendedProductList[index]['isinwishlist'] != true) {
await addToWishlistFunction(model.recommendedProductList[index].id); GifLoaderDialogUtils.showMyDialog(context);
await addToWishlistFunction(model.recommendedProductList[index]['id']);
// checkWishlist();
GifLoaderDialogUtils.hideDialog(context);
setState((){
model.recommendedProductList[index]['isinwishlist'] = true;
});
} else { } else {
await deleteFromWishlistFunction(model.recommendedProductList[index].id); GifLoaderDialogUtils.showMyDialog(context);
await deleteFromWishlistFunction(model.recommendedProductList[index]['id']);
GifLoaderDialogUtils.hideDialog(context);
setState((){
model.recommendedProductList[index]['isinwishlist'] = false;
});
} }
} else { } else {
return; return ;
} }
setState(() {}); setState(() {
// checkWishlist();
});
}, },
)), )),
// child: Align( // child: Align(
// alignment: Alignment.topRight, // alignment: Alignment.topRight,
// child:itemID.contains(model.recommendedProductList[index].id) // child:itemID.contains(model.recommendedProductList[index]['id'])
// // !isInWishlist // // !isInWishlist
// ? IconButton( // ? IconButton(
// icon: Icon(Icons.favorite_border), // icon: Icon(Icons.favorite_border),
@ -751,10 +770,10 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
alignment: alignment:
Alignment.center, Alignment.center,
// padding: EdgeInsets.only(left: 25, bottom: 20), // padding: EdgeInsets.only(left: 25, bottom: 20),
child: (model.recommendedProductList[index].images != null && child: (model.recommendedProductList[index]['images'] != null &&
model.recommendedProductList[index].images.length > 0) model.recommendedProductList[index]['images'].length > 0)
? Image.network( ? Image.network(
model.recommendedProductList[index].images[0].src.toString(), model.recommendedProductList[index]['images'][0]['src'].toString(),
// item.images[0].src, // item.images[0].src,
fit: BoxFit.cover, fit: BoxFit.cover,
height: 60, height: 60,
@ -766,7 +785,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
), ),
), ),
Container( Container(
width: model.recommendedProductList[index].rxMessage != width: model.recommendedProductList[index]['rx_message'] !=
null null
? MediaQuery.of(context).size.width / ? MediaQuery.of(context).size.width /
5 5
@ -782,8 +801,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
), ),
child: child:
Texts( Texts(
model.recommendedProductList[index].rxMessage != null model.recommendedProductList[index]['rx_message'] != null
? model.recommendedProductList[index].rxMessage ? model.recommendedProductList[index]['rx_message']
: "", : "",
color: color:
Colors.white, Colors.white,
@ -811,8 +830,8 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
Text( Text(
languageID == languageID ==
"ar" "ar"
? model.recommendedProductList[index].namen ? model.recommendedProductList[index]['namen']
: model.recommendedProductList[index].name, : model.recommendedProductList[index]['name'],
style: style:
TextStyle( TextStyle(
color: color:
@ -831,7 +850,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
5), 5),
child: child:
Texts( Texts(
"SAR ${model.recommendedProductList[index].price}", "SAR ${model.recommendedProductList[index]['price']}",
bold: bold:
true, true,
fontSize: fontSize:
@ -858,7 +877,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
child: child:
RatingBar.readOnly( RatingBar.readOnly(
initialRating: initialRating:
model.recommendedProductList[index].approvedRatingSum.toDouble(), model.recommendedProductList[index]['approved_rating_sum'].toDouble(),
// initialRating: productRate, // initialRating: productRate,
size: size:
13.0, 13.0,
@ -878,7 +897,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
), ),
), ),
Texts( Texts(
"(${model.recommendedProductList[index].approvedTotalReviews.toString()})", "(${model.recommendedProductList[index]['approved_total_reviews'].toString()})",
// bold: true, // bold: true,
fontSize: fontSize:
12, 12,
@ -892,7 +911,7 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
}), }),
) )
: Container( : Container(
// child: Text("NO DATA"), child: Text("There is no product"),
), ),
)), )),
), ),
@ -2092,6 +2111,7 @@ addToWishlistFunction(itemID) async {
ProductDetailViewModel x = new ProductDetailViewModel(); ProductDetailViewModel x = new ProductDetailViewModel();
isInWishlit = true; isInWishlit = true;
await x.addToWishlistData(itemID); await x.addToWishlistData(itemID);
} }
deleteFromWishlistFunction(itemID) async { deleteFromWishlistFunction(itemID) async {

File diff suppressed because it is too large Load Diff

@ -0,0 +1,14 @@
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:flutter/material.dart';
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
class AboutApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return AppScaffold(
isShowAppBar: true,
appBarTitle: TranslationBase.of(context).aboutApp,
isShowDecPage: false,
body: Container());
}
}

@ -33,6 +33,14 @@ class _Settings extends State<Settings> with TickerProviderStateMixin {
AppGlobal.context = context; AppGlobal.context = context;
return Scaffold( return Scaffold(
appBar: AppBar( appBar: AppBar(
actions: [
IconButton(
icon: Icon(Icons.info, color: Colors.white),
onPressed: () {
//openInfoPage()
},
)
],
bottom: TabBar( bottom: TabBar(
// isScrollable: true, // isScrollable: true,
@ -51,8 +59,7 @@ class _Settings extends State<Settings> with TickerProviderStateMixin {
controller: _tabController, controller: _tabController,
), ),
title: Text(TranslationBase.of(context).settings, title: Text(TranslationBase.of(context).settings,
style: style: TextStyle(color: Colors.white)),
TextStyle(color: Theme.of(context).textTheme.bodyText2.color)),
leading: Builder( leading: Builder(
builder: (BuildContext context) { builder: (BuildContext context) {
return ArrowBack(); return ArrowBack();

@ -30,7 +30,7 @@ class DoctorsListService extends BaseService {
Future<Map> getDoctorsList( Future<Map> getDoctorsList(
int clinicID, int projectID, bool isNearest, BuildContext context, int clinicID, int projectID, bool isNearest, BuildContext context,
{doctorId, doctorName}) async { {doctorId, doctorName, isContinueDentalPlan = false}) async {
Map<String, dynamic> request; Map<String, dynamic> request;
if (await this.sharedPref.getObject(USER_PROFILE) != null) { if (await this.sharedPref.getObject(USER_PROFILE) != null) {
@ -61,20 +61,18 @@ class DoctorsListService extends BaseService {
"ClinicID": clinicID, "ClinicID": clinicID,
"ProjectID": projectID, "ProjectID": projectID,
"DoctorName": doctorName, //!= null ? doctorId : 0, "DoctorName": doctorName, //!= null ? doctorId : 0,
"ContinueDentalPlan": false, "ContinueDentalPlan": isContinueDentalPlan,
"IsSearchAppointmnetByClinicID": true, "IsSearchAppointmnetByClinicID": isContinueDentalPlan ? false : true,
"PatientID": authUser.patientID != null ? authUser.patientID : 0, "PatientID": authUser.patientID != null ? authUser.patientID : 0,
"gender": authUser.gender != null ? authUser.gender : 0, "gender": authUser.gender != null ? authUser.gender : 0,
"age": authUser.age != null ? authUser.age : 0, "age": authUser.age != null ? authUser.age : 0,
"IsGetNearAppointment": false, "IsGetNearAppointment": false,
// "Latitude": 0,
// "Longitude": 0,
// "License": true,
"SearchForVoiceCommand": "SearchForVoiceCommand":
doctorId != null && doctorId.length > 0 ? true : false, doctorId != null && doctorId.length > 0 ? true : false,
"DoctorIDsList": doctorId, "DoctorIDsList": doctorId,
"Latitude": lat != null ? lat.toString() : 0, "Latitude": lat != null ? lat.toString() : 0,
"Longitude": long != null ? long.toString() : 0, "Longitude": long != null ? long.toString() : 0,
"isDentalAllowedBackend": isContinueDentalPlan,
"IsGetNearAppointment": isNearest, "IsGetNearAppointment": isNearest,
if (isNearest) if (isNearest)
"SelectedDate": DateUtil.convertDateToString(DateTime.now()), "SelectedDate": DateUtil.convertDateToString(DateTime.now()),
@ -1483,7 +1481,6 @@ class DoctorsListService extends BaseService {
int projectId, BuildContext context) async { int projectId, BuildContext context) async {
Map<String, dynamic> request; Map<String, dynamic> request;
Request req = appGlobal.getPublicRequest();
request = { request = {
"AppointmentNo": appointmentNo, "AppointmentNo": appointmentNo,
"NFC_Code": nfcCode, "NFC_Code": nfcCode,
@ -1498,4 +1495,21 @@ class DoctorsListService extends BaseService {
}, body: request); }, body: request);
return Future.value(localRes); return Future.value(localRes);
} }
Future<Map> checkIfHasDentalPlan(int projectID, BuildContext context) async {
Map<String, dynamic> request;
request = {
"ProjectID": projectID,
};
dynamic localRes;
await baseAppClient.post(HAS_DENTAL_PLAN,
onSuccess: (response, statusCode) async {
localRes = response;
}, onFailure: (String error, int statusCode) {
throw error;
}, body: request);
return Future.value(localRes);
}
} }

@ -16,24 +16,25 @@ class RecommendedProductService extends BaseService{
AuthenticatedUser authUser = new AuthenticatedUser(); AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider(); AuthProvider authProvider = new AuthProvider();
List<PharmacyProduct> _recommendedProductList = List(); List<Map<String, dynamic>> _recommendedProductList = List();
List<PharmacyProduct> get recommendedList => _recommendedProductList; List<Map<String, Object>> get recommendedList => _recommendedProductList;
String url ="";
Future getRecommendedProducts(productId) async { Future getRecommendedProducts(productId) async {
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
hasError = false; hasError = false;
url =GET_RECOMMENDED_PRODUCT+productId;
await baseAppClient.getPharmacy(url, await baseAppClient.getPharmacy(GET_RECOMMENDED_PRODUCT+"$productId/$customerId",
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_recommendedProductList.clear(); _recommendedProductList.clear();
response['products'].forEach((item) { response['products'].forEach((item) {
_recommendedProductList.add(PharmacyProduct.fromJson(item)); _recommendedProductList.add(item);
print("----------------------------------");
print("Test data");
print(_recommendedProductList[0]);
print(item['name']);
print(response);
}); });
print("---------------------Recommended Product List------------------------");
print(_recommendedProductList.length);
//print(item['name']);
print(response);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -63,6 +63,15 @@ class DateUtil {
return dateFormat; return dateFormat;
} }
static String convertDateMSToJsonDate(utc) {
var dt = new DateTime.fromMicrosecondsSinceEpoch(utc);
return "/Date(" +
(dt.millisecondsSinceEpoch * 1000).toString() +
'+0300' +
")/";
}
/// check Date /// check Date
/// [dateString] String we want to convert /// [dateString] String we want to convert
static String checkDate(DateTime checkedTime) { static String checkDate(DateTime checkedTime) {

File diff suppressed because it is too large Load Diff

@ -1,7 +1,13 @@
import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart'; import 'package:diplomaticquarterapp/core/model/labs/lab_result.dart';
import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart'; import 'package:diplomaticquarterapp/core/model/labs/patient_lab_orders.dart';
import 'package:diplomaticquarterapp/core/service/medical/labs_service.dart';
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
import 'package:diplomaticquarterapp/pages/medical/labs/passport_update_page.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/translations_delegate_base.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_dialog.dart';
import 'package:diplomaticquarterapp/widgets/dialogs/confirm_send_email_dialog.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/cupertino.dart'; import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
@ -10,15 +16,17 @@ import 'package:provider/provider.dart';
import '../../text.dart'; import '../../text.dart';
import 'FlowChartPage.dart'; import 'FlowChartPage.dart';
class LabResultWidget extends StatelessWidget { class LabResultWidget extends StatelessWidget {
final String filterName;
final String filterName ;
final List<LabResult> patientLabResultList; final List<LabResult> patientLabResultList;
final PatientLabOrders patientLabOrder; final PatientLabOrders patientLabOrder;
LabResultWidget({Key key, this.filterName, this.patientLabResultList, this.patientLabOrder}) : super(key: key); LabResult covidLabResult;
LabResultWidget({Key key, this.filterName, this.patientLabResultList, this.patientLabOrder}) : super(key: key);
ProjectViewModel projectViewModel; ProjectViewModel projectViewModel;
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
projectViewModel = Provider.of(context); projectViewModel = Provider.of(context);
@ -29,8 +37,7 @@ class LabResultWidget extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start, crossAxisAlignment: CrossAxisAlignment.start,
children: <Widget>[ children: <Widget>[
Row( Row(
mainAxisAlignment: mainAxisAlignment: MainAxisAlignment.spaceBetween,
MainAxisAlignment.spaceBetween,
children: [ children: [
Texts(filterName), Texts(filterName),
InkWell( InkWell(
@ -40,7 +47,7 @@ class LabResultWidget extends StatelessWidget {
FadePage( FadePage(
page: FlowChartPage( page: FlowChartPage(
filterName: filterName, filterName: filterName,
patientLabOrder: patientLabOrder, patientLabOrder: patientLabOrder,
), ),
), ),
); );
@ -55,16 +62,100 @@ class LabResultWidget extends StatelessWidget {
), ),
Table( Table(
border: TableBorder.symmetric( border: TableBorder.symmetric(
inside: BorderSide( inside: BorderSide(width: 2.0, color: Colors.grey[300]),
width: 2.0, color: Colors.grey[300]),
), ),
children: fullData(patientLabResultList,context), children: fullData(patientLabResultList, context),
), ),
checkIfCovidLab(patientLabResultList)
? Container(
margin: EdgeInsets.only(top: 10.0),
child: ButtonTheme(
shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(10.0),
),
minWidth: MediaQuery.of(context).size.width * 0.91,
height: 45.0,
child: RaisedButton(
color: new Color(0xFFc5272d),
textColor: Colors.white,
disabledTextColor: Colors.white,
disabledColor: Colors.red[300],
onPressed: () {
showKSADialog(context);
},
child: Text(TranslationBase.of(context).generateCovidCertificate, style: TextStyle(fontSize: 18.0)),
),
),
)
: Container(),
], ],
), ),
); );
} }
List<TableRow> fullData(List<LabResult> labResultList,context) {
generateCovidCertificate(BuildContext context, String isOutsideKSA) {
LabsService service = new LabsService();
GifLoaderDialogUtils.showMyDialog(context);
service.generateCovidLabReport(covidLabResult, isOutsideKSA).then((res) {
GifLoaderDialogUtils.hideDialog(context);
AppToast.showSuccessToast(message: TranslationBase.of(context).emailSentSuccessfully);
}).catchError((err) {
GifLoaderDialogUtils.hideDialog(context);
print(err);
});
}
openPassportUpdatePage(BuildContext context) {
Navigator.push(context, FadePage(page: PassportUpdatePage())).then((value) {
print(value);
if(value != null && value == true) {
showConfirmMessage(context, projectViewModel.user.emailAddress, "yes");
}
});
}
void showKSADialog(BuildContext context) {
ConfirmDialog dialog = new ConfirmDialog(
context: context,
confirmMessage: TranslationBase.of(context).isReportOutsideKsa,
okText: TranslationBase.of(context).yes,
cancelText: TranslationBase.of(context).no,
okFunction: () => {
Navigator.of(context).pop(),
openPassportUpdatePage(context)
// showConfirmMessage(context, projectViewModel.user.emailAddress, "yes")
},
cancelFunction: () => {showConfirmMessage(context, projectViewModel.user.emailAddress, "no")});
dialog.showAlertDialog(context);
}
void showConfirmMessage(BuildContext context, String email, String isOutsideKSA) {
showDialog(
context: context,
child: ConfirmSendEmailDialog(
email: email,
onTapSendEmail: () {
generateCovidCertificate(context, isOutsideKSA);
},
),
);
}
bool checkIfCovidLab(List<LabResult> labResultList) {
bool isCovidResult = false;
labResultList.forEach((order) {
if (order.testCode.toUpperCase().contains("COVID") && order.isCertificateAllowed.toString() == "true") {
isCovidResult = true;
covidLabResult = order;
}
print(covidLabResult.testCode);
});
return isCovidResult;
}
List<TableRow> fullData(List<LabResult> labResultList, context) {
List<TableRow> tableRow = []; List<TableRow> tableRow = [];
tableRow.add( tableRow.add(
TableRow( TableRow(
@ -74,12 +165,8 @@ class LabResultWidget extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
? Radius.circular(0.0) topRight: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
: Radius.circular(10.0),
topRight: projectViewModel.isArabic
? Radius.circular(10.0)
: Radius.circular(0.0),
), ),
), ),
child: Center( child: Center(
@ -106,12 +193,8 @@ class LabResultWidget extends StatelessWidget {
decoration: BoxDecoration( decoration: BoxDecoration(
color: Theme.of(context).primaryColor, color: Theme.of(context).primaryColor,
borderRadius: BorderRadius.only( borderRadius: BorderRadius.only(
topLeft: projectViewModel.isArabic topLeft: projectViewModel.isArabic ? Radius.circular(10.0) : Radius.circular(0.0),
? Radius.circular(10.0) topRight: projectViewModel.isArabic ? Radius.circular(0.0) : Radius.circular(10.0),
: Radius.circular(0.0),
topRight: projectViewModel.isArabic
? Radius.circular(0.0)
: Radius.circular(10.0),
), ),
), ),
child: Center( child: Center(
@ -144,7 +227,7 @@ class LabResultWidget extends StatelessWidget {
color: Colors.white, color: Colors.white,
child: Center( child: Center(
child: Texts( child: Texts(
lab.resultValue+" "+lab.uOM, lab.resultValue + " " + lab.uOM,
textAlign: TextAlign.center, textAlign: TextAlign.center,
), ),
), ),
@ -168,7 +251,4 @@ class LabResultWidget extends StatelessWidget {
}); });
return tableRow; return tableRow;
} }
} }

@ -188,7 +188,7 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
.labResultLists[index] .labResultLists[index]
.patientLabResultList, .patientLabResultList,
), ),
) ),
], ],
), ),
), ),
@ -252,7 +252,6 @@ class _LaboratoryResultWidgetState extends State<LaboratoryResultWidget> {
data: widget.details ?? TranslationBase.of(context).noDataAvailable, data: widget.details ?? TranslationBase.of(context).noDataAvailable,
)), )),
), ),
], ],
), ),
], ],

@ -28,6 +28,7 @@ class ConfirmDialog {
child: Texts(this.cancelText), child: Texts(this.cancelText),
onPressed: () { onPressed: () {
Navigator.of(context).pop(); Navigator.of(context).pop();
cancelFunction();
}); });
Widget continueButton = FlatButton(child: Texts(okText), onPressed: okFunction); Widget continueButton = FlatButton(child: Texts(okText), onPressed: okFunction);

@ -23,23 +23,23 @@ var _InAppBrowserOptions = InAppBrowserClassOptions(
class MyInAppBrowser extends InAppBrowser { class MyInAppBrowser extends InAppBrowser {
_PAYMENT_TYPE paymentType; _PAYMENT_TYPE paymentType;
// static String SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort Payment Gateway URL UAT
static String SERVICE_URL = 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 = // static String SERVICE_URL =
// 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT // 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort Payment Gateway URL LIVE
static String PREAUTH_SERVICE_URL = static String PREAUTH_SERVICE_URL =
'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store 'https://hmgwebservices.com/PayFortWeb/pages/SendPayFortRequest.aspx'; // Payfort PreAuth Payment Gateway URL UAT
// static String PRESCRIPTION_PAYMENT_WITH_ORDERID = // static String PREAUTH_SERVICE_URL =
// 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; // 'https://hmgwebservices.com/PayFortWebLive/pages/SendPayFortRequest.aspx'; //Payfort PreAuth Payment Gateway URL Live Store
static String PRESCRIPTION_PAYMENT_WITH_ORDERID = static String PRESCRIPTION_PAYMENT_WITH_ORDERID =
'https://mdlaboratories.com/exacartapi/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; //Live 'https://uat.hmgwebservices.com/epharmacy/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID=';
// static String PRESCRIPTION_PAYMENT_WITH_ORDERID =
// 'https://mdlaboratories.com/exacartapi/checkout/OpcCompleteRedirectionPaymentClientbyOrder?orderID='; //Live
// Packages // Packages
static String PACKAGES_REQUEST_PAYMENT_URL = static String PACKAGES_REQUEST_PAYMENT_URL =

Loading…
Cancel
Save