fixed order isuee

merge-update-with-lab-changes
Fatimah Alshammari 5 years ago
parent ef8312f2b8
commit ac32ba998c

@ -0,0 +1,6 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="14.769" viewBox="0 0 16 14.769">
<g id="Group_1463" data-name="Group 1463" transform="translate(-236)">
<path id="Icon_ionic-md-heart-empty" data-name="Icon ionic-md-heart-empty" d="M14.975,4.5a4.732,4.732,0,0,0-3.6,1.688A4.732,4.732,0,0,0,7.775,4.5a4.35,4.35,0,0,0-4.4,4.427c0,3.058,2.719,5.512,6.838,9.3l1.162,1.046,1.162-1.046c4.119-3.785,6.838-6.238,6.838-9.3A4.35,4.35,0,0,0,14.975,4.5ZM11.867,17.165l-.162.15-.331.3-.331-.3-.162-.15a48.887,48.887,0,0,1-4.719-4.692A5.643,5.643,0,0,1,4.61,8.927a3.2,3.2,0,0,1,.912-2.281,3.13,3.13,0,0,1,2.254-.915,3.527,3.527,0,0,1,2.658,1.25L11.375,8.1l.942-1.119a3.514,3.514,0,0,1,2.658-1.25,3.145,3.145,0,0,1,2.258.915,3.206,3.206,0,0,1,.912,2.281,5.673,5.673,0,0,1-1.554,3.546A48.986,48.986,0,0,1,11.867,17.165Z" transform="translate(232.625 -4.5)" fill="#ed1c2b"/>
<path id="Path_1790" data-name="Path 1790" d="M251.438,12.227,249.66,10.76l-3.555.651a15.239,15.239,0,0,0-1.295,2.378c.072.2,1.295,4.436,1.295,4.436l4.258,4.295,1.609,1.241L253.7,22.52l3.551-3.5,1.979-3.813-.72-3.488-1.741-.962-3.069.651-1.883,1.342Z" transform="translate(-8 -10)" fill="#ed1c2b" stroke="#ed1c2b" stroke-width="1"/>
</g>
</svg>

After

Width:  |  Height:  |  Size: 1.2 KiB

@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="14.769" viewBox="0 0 16 14.769">
<path id="Icon_ionic-md-heart-empty" data-name="Icon ionic-md-heart-empty" d="M14.975,4.5a4.732,4.732,0,0,0-3.6,1.688A4.732,4.732,0,0,0,7.775,4.5a4.35,4.35,0,0,0-4.4,4.427c0,3.058,2.719,5.512,6.838,9.3l1.162,1.046,1.162-1.046c4.119-3.785,6.838-6.238,6.838-9.3A4.35,4.35,0,0,0,14.975,4.5ZM11.867,17.165l-.162.15-.331.3-.331-.3-.162-.15a48.887,48.887,0,0,1-4.719-4.692A5.643,5.643,0,0,1,4.61,8.927a3.2,3.2,0,0,1,.912-2.281,3.13,3.13,0,0,1,2.254-.915,3.527,3.527,0,0,1,2.658,1.25L11.375,8.1l.942-1.119a3.514,3.514,0,0,1,2.658-1.25,3.145,3.145,0,0,1,2.258.915,3.206,3.206,0,0,1,.912,2.281,5.673,5.673,0,0,1-1.554,3.546A48.986,48.986,0,0,1,11.867,17.165Z" transform="translate(-3.375 -4.5)" fill="#b5b5b5"/>
</svg>

After

Width:  |  Height:  |  Size: 804 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 212 B

@ -225,7 +225,7 @@ const GET_PATIENT_HEALTH_STATS = 'Services/Patients.svc/REST/Med_GetTransactions
const CHANNEL = 3; const CHANNEL = 3;
const GENERAL_ID = 'Cs2020@2016\$2958'; const GENERAL_ID = 'Cs2020@2016\$2958';
const IP_ADDRESS = '10.20.10.20'; const IP_ADDRESS = '10.20.10.20';
const VERSION_ID = 5.8; const VERSION_ID = 8.8;
const SETUP_ID = '91877'; const SETUP_ID = '91877';
const LANGUAGE = 2; const LANGUAGE = 2;
const PATIENT_OUT_SA = 0; const PATIENT_OUT_SA = 0;

@ -1115,6 +1115,7 @@ const Map localizedValues = {
"calculate": {"en": "calculate", "ar": "حساب"}, "calculate": {"en": "calculate", "ar": "حساب"},
"enterReadingValue": {"en": "Enter the reading value", "ar": "ادخل القيمة"}, "enterReadingValue": {"en": "Enter the reading value", "ar": "ادخل القيمة"},
"result": {"en": "Result", "ar": "النتيجة"}, "result": {"en": "Result", "ar": "النتيجة"},
"sort": {"en": "Sort", "ar": "فرز"},
"bloodSugarConversion": {"en": "Blood Sugar Conversion", "ar": "السكر في الدم"}, "bloodSugarConversion": {"en": "Blood Sugar Conversion", "ar": "السكر في الدم"},
"convertBloodSugarStatement": { "convertBloodSugarStatement": {
"en": "Convert blood sugar/glucose from mmol/l (UK standard) to mg/dlt (US standard) and vice versa.", "en": "Convert blood sugar/glucose from mmol/l (UK standard) to mg/dlt (US standard) and vice versa.",

@ -79,10 +79,10 @@ class OrderModel {
dynamic storeId; dynamic storeId;
String orderGuid; String orderGuid;
bool pickUpInStore; bool pickUpInStore;
PaymentMethodSystemName paymentMethodSystemName; dynamic paymentMethodSystemName;
PaymentName paymentName; dynamic paymentName;
PaymentName paymentNamen; dynamic paymentNamen;
CustomerCurrencyCode customerCurrencyCode; dynamic customerCurrencyCode;
dynamic currencyRate; dynamic currencyRate;
dynamic customerTaxDisplayTypeId; dynamic customerTaxDisplayTypeId;
dynamic vatNumber; dynamic vatNumber;
@ -102,42 +102,42 @@ class OrderModel {
dynamic refundedAmount; dynamic refundedAmount;
dynamic rewardPointsWereAdded; dynamic rewardPointsWereAdded;
String rxAttachments; String rxAttachments;
CheckoutAttributeDescription checkoutAttributeDescription; dynamic checkoutAttributeDescription;
dynamic customerLanguageId; dynamic customerLanguageId;
dynamic affiliateId; dynamic affiliateId;
CustomerIp customerIp; dynamic customerIp;
String authorizationTransactionId; String authorizationTransactionId;
dynamic authorizationTransactionCode; dynamic authorizationTransactionCode;
dynamic authorizationTransactionResult; dynamic authorizationTransactionResult;
dynamic captureTransactionId; dynamic captureTransactionId;
dynamic captureTransactionResult; dynamic captureTransactionResult;
dynamic subscriptionTransactionId; dynamic subscriptionTransactionId;
DateTime paidDateUtc; dynamic paidDateUtc;
ShippingMethod shippingMethod; dynamic shippingMethod;
ShippingRateComputationMethodSystemName shippingRateComputationMethodSystemName; dynamic shippingRateComputationMethodSystemName;
String customValuesXml; String customValuesXml;
bool deleted; bool deleted;
DateTime createdOnUtc; dynamic createdOnUtc;
OrderModelCustomer customer; dynamic customer;
dynamic customerId; dynamic customerId;
IngAddress billingAddress; dynamic billingAddress;
IngAddress shippingAddress; dynamic shippingAddress;
List<OrderItem> orderItems; List<OrderItem> orderItems;
dynamic orderStatusId; dynamic orderStatusId;
OrderStatus orderStatus; dynamic orderStatus;
OrderStatusn orderStatusn; dynamic orderStatusn;
dynamic paymentStatusId; dynamic paymentStatusId;
PaymentStatus paymentStatus; dynamic paymentStatus;
PaymentStatusn paymentStatusn; dynamic paymentStatusn;
ShippingStatus shippingStatus; dynamic shippingStatus;
ShippingStatusn shippingStatusn; dynamic shippingStatusn;
CustomerTaxDisplayType customerTaxDisplayType; dynamic customerTaxDisplayType;
bool canCancel; bool canCancel;
bool canRefund; bool canRefund;
dynamic lakumAmount; dynamic lakumAmount;
DateTime preferDeliveryDate; dynamic preferDeliveryDate;
PreferDeliveryTime preferDeliveryTime; dynamic preferDeliveryTime;
PreferDeliveryTimen preferDeliveryTimen; dynamic preferDeliveryTimen;
factory OrderModel.fromJson(Map<String, dynamic> json) => OrderModel( factory OrderModel.fromJson(Map<String, dynamic> json) => OrderModel(
id: json["id"], id: json["id"],
@ -311,7 +311,7 @@ class IngAddress {
DateTime createdOnUtc; DateTime createdOnUtc;
dynamic province; dynamic province;
String latLong; String latLong;
LatLng getLocation(){ LatLng getLocation(){
if(latLong.contains(',')){ if(latLong.contains(',')){
var parts = latLong.trim().split(','); var parts = latLong.trim().split(',');
@ -476,10 +476,10 @@ class OrderModelCustomer {
}); });
String id; String id;
Username username; dynamic username;
BillingAddressEmail email; dynamic email;
FirstName firstName; dynamic firstName;
LastName lastName; dynamic lastName;
String languageId; String languageId;
dynamic adminComment; dynamic adminComment;
bool isTaxExempt; bool isTaxExempt;
@ -488,10 +488,10 @@ class OrderModelCustomer {
bool deleted; bool deleted;
bool isSystemAccount; bool isSystemAccount;
dynamic systemName; dynamic systemName;
LastIpAddress lastIpAddress; dynamic lastIpAddress;
DateTime createdOnUtc; dynamic createdOnUtc;
DateTime lastLoginDateUtc; dynamic lastLoginDateUtc;
DateTime lastActivityDateUtc; dynamic lastActivityDateUtc;
dynamic registeredInStoreId; dynamic registeredInStoreId;
List<dynamic> roleIds; List<dynamic> roleIds;
@ -577,6 +577,7 @@ final customerTaxDisplayTypeValues = EnumValues({
"ExcludingTax": CustomerTaxDisplayType.EXCLUDING_TAX "ExcludingTax": CustomerTaxDisplayType.EXCLUDING_TAX
}); });
class OrderItem { class OrderItem {
OrderItem({ OrderItem({
this.quantity, this.quantity,
@ -867,9 +868,9 @@ class Product {
dynamic displayOrder; dynamic displayOrder;
bool published; bool published;
bool deleted; bool deleted;
DateTime createdOnUtc; dynamic createdOnUtc;
DateTime updatedOnUtc; dynamic updatedOnUtc;
ProductType productType; dynamic productType;
dynamic parentGroupedProductId; dynamic parentGroupedProductId;
dynamic roleIds; dynamic roleIds;
dynamic discountIds; dynamic discountIds;
@ -1146,14 +1147,14 @@ class Review {
dynamic productId; dynamic productId;
dynamic storeId; dynamic storeId;
bool isApproved; bool isApproved;
Title title; dynamic title;
ReviewText reviewText; dynamic reviewText;
dynamic replyText; dynamic replyText;
dynamic rating; dynamic rating;
dynamic helpfulYesTotal; dynamic helpfulYesTotal;
dynamic helpfulNoTotal; dynamic helpfulNoTotal;
DateTime createdOnUtc; dynamic createdOnUtc;
ReviewCustomer customer; dynamic customer;
dynamic product; dynamic product;
factory Review.fromJson(Map<String, dynamic> json) => Review( factory Review.fromJson(Map<String, dynamic> json) => Review(
@ -1235,7 +1236,7 @@ class ReviewCustomer {
dynamic isOutSa; dynamic isOutSa;
dynamic patientType; dynamic patientType;
dynamic gender; dynamic gender;
DateTime birthDate; dynamic birthDate;
dynamic phone; dynamic phone;
dynamic countryCode; dynamic countryCode;
dynamic yahalaAccountno; dynamic yahalaAccountno;
@ -1244,7 +1245,7 @@ class ReviewCustomer {
List<dynamic> addresses; List<dynamic> addresses;
String id; String id;
String username; String username;
PurpleEmail email; dynamic email;
dynamic firstName; dynamic firstName;
dynamic lastName; dynamic lastName;
dynamic languageId; dynamic languageId;

@ -32,6 +32,10 @@ class Orders {
bool canCancel; bool canCancel;
bool canRefund; bool canRefund;
dynamic customerId; dynamic customerId;
double orderSubtotalExclTax;
dynamic orderShippingExclTax;
double orderTax;
Orders( Orders(
{this.id, {this.id,
@ -43,7 +47,10 @@ class Orders {
this.orderStatusn, this.orderStatusn,
this.canCancel, this.canCancel,
this.canRefund, this.canRefund,
this.customerId,}); this.customerId,
this.orderShippingExclTax,
this.orderSubtotalExclTax,
this.orderTax,});
Orders.fromJson(Map<String, dynamic> json) { Orders.fromJson(Map<String, dynamic> json) {
try { try {
@ -57,6 +64,9 @@ class Orders {
canCancel = json['can_cancel']; canCancel = json['can_cancel'];
canRefund = json['can_refund']; canRefund = json['can_refund'];
customerId = json['customer_id']; customerId = json['customer_id'];
orderSubtotalExclTax= json["order_subtotal_excl_tax"].toDouble();
orderShippingExclTax= json["order_shipping_excl_tax"];
orderTax= json["order_tax"].toDouble();
}catch(e){ }catch(e){
print(e); print(e);
} }
@ -72,6 +82,9 @@ class Orders {
data['order_status_id'] = this.orderStatusId; data['order_status_id'] = this.orderStatusId;
data['order_status'] = this.orderStatus; data['order_status'] = this.orderStatus;
data['order_statusn'] = this.orderStatusn; data['order_statusn'] = this.orderStatusn;
data ["order_subtotal_excl_tax"] = this.orderSubtotalExclTax;
data ["order_shipping_excl_tax"]= this.orderShippingExclTax;
data ["order_tax"]= this.orderTax;
return data; return data;
} }
} }

@ -1,11 +1,9 @@
class RecommendedProductModel { class RecommendedProductModel {
String messageStatus;
List<Products> products; List<Products> products;
RecommendedProductModel({this.messageStatus, this.products}); RecommendedProductModel({this.products});
RecommendedProductModel.fromJson(Map<String, dynamic> json) { RecommendedProductModel.fromJson(Map<String, dynamic> json) {
messageStatus = json['MessageStatus'];
if (json['products'] != null) { if (json['products'] != null) {
products = new List<Products>(); products = new List<Products>();
json['products'].forEach((v) { json['products'].forEach((v) {
@ -16,7 +14,6 @@ class RecommendedProductModel {
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>(); final Map<String, dynamic> data = new Map<String, dynamic>();
data['MessageStatus'] = this.messageStatus;
if (this.products != null) { if (this.products != null) {
data['products'] = this.products.map((v) => v.toJson()).toList(); data['products'] = this.products.map((v) => v.toJson()).toList();
} }
@ -29,238 +26,213 @@ class Products {
bool visibleIndividually; bool visibleIndividually;
String name; String name;
String namen; String namen;
List<LocalizedNames> localizedNames;
String shortDescription; String shortDescription;
String shortDescriptionn; String shortDescriptionn;
String fullDescription; String fullDescription;
String fullDescriptionn; String fullDescriptionn;
bool markasNew; bool markasNew;
bool showOnHomePage; bool showOnHomePage;
Null metaKeywords; dynamic metaKeywords;
Null metaDescription; dynamic metaDescription;
Null metaTitle; dynamic metaTitle;
bool allowCustomerReviews; bool allowCustomerReviews;
int approvedRatingSum; dynamic approvedRatingSum;
int notApprovedRatingSum; dynamic notApprovedRatingSum;
int approvedTotalReviews; dynamic approvedTotalReviews;
int notApprovedTotalReviews; dynamic notApprovedTotalReviews;
String sku; String sku;
bool isRx; bool isRx;
bool prescriptionRequired; bool prescriptionRequired;
Null rxMessage; dynamic rxMessage;
Null rxMessagen; dynamic rxMessagen;
Null manufacturerPartNumber; dynamic manufacturerPartNumber;
Null gtin; dynamic gtin;
bool isGiftCard; bool isGiftCard;
bool requireOtherProducts; bool requireOtherProducts;
bool automaticallyAddRequiredProducts; bool automaticallyAddRequiredProducts;
bool isDownload; bool isDownload;
bool unlimitedDownloads; bool unlimitedDownloads;
int maxNumberOfDownloads; dynamic maxNumberOfDownloads;
Null downloadExpirationDays; dynamic downloadExpirationDays;
bool hasSampleDownload; bool hasSampleDownload;
bool hasUserAgreement; bool hasUserAgreement;
bool isRecurring; bool isRecurring;
int recurringCycleLength; dynamic recurringCycleLength;
int recurringTotalCycles; dynamic recurringTotalCycles;
bool isRental; bool isRental;
int rentalPriceLength; dynamic rentalPriceLength;
bool isShipEnabled; bool isShipEnabled;
bool isFreeShipping; bool isFreeShipping;
bool shipSeparately; bool shipSeparately;
int additionalShippingCharge; dynamic additionalShippingCharge;
bool isTaxExempt; bool isTaxExempt;
bool isTelecommunicationsOrBroadcastingOrElectronicServices; bool isTelecommunicationsOrBroadcastingOrElectronicServices;
bool useMultipleWarehouses; bool useMultipleWarehouses;
int manageInventoryMethodId; dynamic manageInventoryMethodId;
int stockQuantity; dynamic stockQuantity;
String stockAvailability; String stockAvailability;
String stockAvailabilityn; String stockAvailabilityn;
bool displayStockAvailability; bool displayStockAvailability;
bool displayStockQuantity; bool displayStockQuantity;
int minStockQuantity; dynamic minStockQuantity;
int notifyAdminForQuantityBelow; dynamic notifyAdminForQuantityBelow;
bool allowBackInStockSubscriptions; bool allowBackInStockSubscriptions;
int orderMinimumQuantity; dynamic orderMinimumQuantity;
int orderMaximumQuantity; dynamic orderMaximumQuantity;
Null allowedQuantities; dynamic allowedQuantities;
bool allowAddingOnlyExistingAttributeCombinations; bool allowAddingOnlyExistingAttributeCombinations;
bool disableBuyButton; bool disableBuyButton;
bool disableWishlistButton; bool disableWishlistButton;
bool availableForPreOrder; bool availableForPreOrder;
Null preOrderAvailabilityStartDateTimeUtc; dynamic preOrderAvailabilityStartDateTimeUtc;
bool callForPrice; bool callForPrice;
double price; dynamic price;
int oldPrice; dynamic oldPrice;
double productCost; dynamic productCost;
Null specialPrice; dynamic specialPrice;
Null specialPriceStartDateTimeUtc; dynamic specialPriceStartDateTimeUtc;
Null specialPriceEndDateTimeUtc; dynamic specialPriceEndDateTimeUtc;
bool customerEntersPrice; bool customerEntersPrice;
int minimumCustomerEnteredPrice; dynamic minimumCustomerEnteredPrice;
int maximumCustomerEnteredPrice; dynamic maximumCustomerEnteredPrice;
bool basepriceEnabled; bool basepriceEnabled;
int basepriceAmount; dynamic basepriceAmount;
int basepriceBaseAmount; dynamic basepriceBaseAmount;
bool hasTierPrices; bool hasTierPrices;
bool hasDiscountsApplied; bool hasDiscountsApplied;
Null discountName; dynamic discountName;
Null discountNamen; dynamic discountNamen;
Null discountDescription; dynamic discountDescription;
Null discountDescriptionn; dynamic discountDescriptionn;
Null discountPercentage; dynamic discountPercentage;
String currency; String currency;
String currencyn; String currencyn;
double weight; double weight;
int length; dynamic length;
int width; dynamic width;
int height; dynamic height;
Null availableStartDateTimeUtc; dynamic availableStartDateTimeUtc;
Null availableEndDateTimeUtc; dynamic availableEndDateTimeUtc;
int displayOrder; dynamic displayOrder;
bool published; bool published;
bool deleted; bool deleted;
String createdOnUtc; String createdOnUtc;
String updatedOnUtc; String updatedOnUtc;
String productType; String productType;
int parentGroupedProductId; dynamic parentGroupedProductId;
List<Null> roleIds; dynamic vendorId;
List<Null> discountIds;
List<Null> storeIds;
List<int> manufacturerIds;
List<Reviews> reviews;
List<Images> images;
List<Null> attributes;
List<Specifications> specifications;
List<Null> associatedProductIds;
List<Null> tags;
int vendorId;
String seName; String seName;
List<Images> images;
Products( Products({
{this.id, this.id,
this.visibleIndividually, this.visibleIndividually,
this.name, this.name,
this.namen, this.namen,
this.localizedNames, this.shortDescription,
this.shortDescription, this.shortDescriptionn,
this.shortDescriptionn, this.fullDescription,
this.fullDescription, 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, this.approvedTotalReviews,
this.approvedTotalReviews, this.notApprovedTotalReviews,
this.notApprovedTotalReviews, this.sku,
this.sku, this.isRx,
this.isRx, 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, this.recurringCycleLength,
this.recurringCycleLength, this.recurringTotalCycles,
this.recurringTotalCycles, this.isRental,
this.isRental, this.rentalPriceLength,
this.rentalPriceLength, this.isShipEnabled,
this.isShipEnabled, this.isFreeShipping,
this.isFreeShipping, this.shipSeparately,
this.shipSeparately, this.additionalShippingCharge,
this.additionalShippingCharge, this.isTaxExempt,
this.isTaxExempt, this.isTelecommunicationsOrBroadcastingOrElectronicServices,
this.isTelecommunicationsOrBroadcastingOrElectronicServices, this.useMultipleWarehouses,
this.useMultipleWarehouses, this.manageInventoryMethodId,
this.manageInventoryMethodId, this.stockQuantity,
this.stockQuantity, this.stockAvailability,
this.stockAvailability, this.stockAvailabilityn,
this.stockAvailabilityn, this.displayStockAvailability,
this.displayStockAvailability, this.displayStockQuantity,
this.displayStockQuantity, this.minStockQuantity,
this.minStockQuantity, this.notifyAdminForQuantityBelow,
this.notifyAdminForQuantityBelow, 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, this.availableForPreOrder,
this.availableForPreOrder, this.preOrderAvailabilityStartDateTimeUtc,
this.preOrderAvailabilityStartDateTimeUtc, this.callForPrice,
this.callForPrice, this.price,
this.price, this.oldPrice,
this.oldPrice, this.productCost,
this.productCost, this.specialPrice,
this.specialPrice, this.specialPriceStartDateTimeUtc,
this.specialPriceStartDateTimeUtc, this.specialPriceEndDateTimeUtc,
this.specialPriceEndDateTimeUtc, this.customerEntersPrice,
this.customerEntersPrice, this.minimumCustomerEnteredPrice,
this.minimumCustomerEnteredPrice, this.maximumCustomerEnteredPrice,
this.maximumCustomerEnteredPrice, this.basepriceEnabled,
this.basepriceEnabled, this.basepriceAmount,
this.basepriceAmount, this.basepriceBaseAmount,
this.basepriceBaseAmount, this.hasTierPrices,
this.hasTierPrices, this.hasDiscountsApplied,
this.hasDiscountsApplied, this.discountName,
this.discountName, this.discountNamen,
this.discountNamen, this.discountDescription,
this.discountDescription, this.discountDescriptionn,
this.discountDescriptionn, this.discountPercentage,
this.discountPercentage, this.currency,
this.currency, this.currencyn,
this.currencyn, this.weight,
this.weight, this.length,
this.length, this.width,
this.width, this.height,
this.height, this.availableStartDateTimeUtc,
this.availableStartDateTimeUtc, this.availableEndDateTimeUtc,
this.availableEndDateTimeUtc, this.displayOrder,
this.displayOrder, this.published,
this.published, this.deleted,
this.deleted, this.createdOnUtc,
this.createdOnUtc, this.updatedOnUtc,
this.updatedOnUtc, this.productType,
this.productType, this.parentGroupedProductId,
this.parentGroupedProductId, this.vendorId,
this.roleIds, this.seName,
this.discountIds, this.images,
this.storeIds, });
this.manufacturerIds,
this.reviews,
this.images,
this.attributes,
this.specifications,
this.associatedProductIds,
this.tags,
this.vendorId,
this.seName});
Products.fromJson(Map<String, dynamic> json) { Products.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'];
@ -285,7 +257,7 @@ class Products {
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'];
@ -303,7 +275,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'];
@ -318,12 +290,12 @@ class Products {
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'];
@ -359,63 +331,14 @@ 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'];
if (json['role_ids'] != null) { vendorId = json['vendor_id'];
roleIds = new List<Null>(); seName = json['se_name'];
json['role_ids'].forEach((v) {
roleIds.add(null);
});
}
if (json['discount_ids'] != null) {
discountIds = new List<Null>();
json['discount_ids'].forEach((v) {
discountIds.add(null);
});
}
if (json['store_ids'] != null) {
storeIds = new List<Null>();
json['store_ids'].forEach((v) {
storeIds.add(null);
});
}
manufacturerIds = json['manufacturer_ids'].cast<int>();
if (json['reviews'] != null) {
reviews = new List<Reviews>();
json['reviews'].forEach((v) {
reviews.add(new Reviews.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(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(v);
});
}
if (json['tags'] != null) {
tags = new List<Null>();
json['tags'].forEach((v) {
tags.add(v);
});
}
vendorId = json['vendor_id'];
seName = json['se_name'];
} }
Map<String, dynamic> toJson() { Map<String, dynamic> toJson() {
@ -424,10 +347,6 @@ 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;
@ -528,289 +447,12 @@ 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;
if (this.roleIds != null) {
data['role_ids'] = this.roleIds.map((v) => v);
}
if (this.discountIds != null) {
data['discount_ids'] = this.discountIds.map((v) => v);
}
if (this.storeIds != null) {
data['store_ids'] = this.storeIds.map((v) => v);
}
data['manufacturer_ids'] = this.manufacturerIds;
if (this.reviews != null) {
data['reviews'] = this.reviews.map((v) => v.toJson()).toList();
}
if (this.images != null) {
data['images'] = this.images.map((v) => v.toJson()).toList();
}
if (this.attributes != null) {
data['attributes'] = this.attributes.map((v) => v);
}
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);
}
if (this.tags != null) {
data['tags'] = this.tags.map((v) => v);
}
data['vendor_id'] = this.vendorId; data['vendor_id'] = this.vendorId;
data['se_name'] = this.seName; data['se_name'] = this.seName;
return data; if (this.images != null) {
} data['images'] = this.images.map((v) => v.toJson()).toList();
}
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;
}
}
class Reviews {
int id;
int position;
int reviewId;
int customerId;
int productId;
int storeId;
bool isApproved;
String title;
String reviewText;
Null replyText;
int rating;
int helpfulYesTotal;
int helpfulNoTotal;
String createdOnUtc;
Customer customer;
Null product;
Reviews(
{this.id,
this.position,
this.reviewId,
this.customerId,
this.productId,
this.storeId,
this.isApproved,
this.title,
this.reviewText,
this.replyText,
this.rating,
this.helpfulYesTotal,
this.helpfulNoTotal,
this.createdOnUtc,
this.customer,
this.product});
Reviews.fromJson(Map<String, dynamic> json) {
id = json['id'];
position = json['position'];
reviewId = json['review_id'];
customerId = json['customer_id'];
productId = json['product_id'];
storeId = json['store_id'];
isApproved = json['is_approved'];
title = json['title'];
reviewText = json['review_text'];
replyText = json['reply_text'];
rating = json['rating'];
helpfulYesTotal = json['helpful_yes_total'];
helpfulNoTotal = json['helpful_no_total'];
createdOnUtc = json['created_on_utc'];
customer = json['customer'] != null
? new Customer.fromJson(json['customer'])
: null;
product = json['product'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['position'] = this.position;
data['review_id'] = this.reviewId;
data['customer_id'] = this.customerId;
data['product_id'] = this.productId;
data['store_id'] = this.storeId;
data['is_approved'] = this.isApproved;
data['title'] = this.title;
data['review_text'] = this.reviewText;
data['reply_text'] = this.replyText;
data['rating'] = this.rating;
data['helpful_yes_total'] = this.helpfulYesTotal;
data['helpful_no_total'] = this.helpfulNoTotal;
data['created_on_utc'] = this.createdOnUtc;
if (this.customer != null) {
data['customer'] = this.customer.toJson();
}
data['product'] = this.product;
return data;
}
}
class Customer {
Null fileNumber;
Null iqamaNumber;
int isOutSa;
int patientType;
Null gender;
String birthDate;
Null phone;
Null countryCode;
Null yahalaAccountno;
Null billingAddress;
Null shippingAddress;
List<Null> addresses;
String id;
String username;
String email;
Null firstName;
Null lastName;
Null languageId;
Null adminComment;
Null isTaxExempt;
Null hasShoppingCartItems;
Null active;
Null deleted;
Null isSystemAccount;
Null systemName;
Null lastIpAddress;
Null createdOnUtc;
Null lastLoginDateUtc;
Null lastActivityDateUtc;
Null registeredInStoreId;
List<Null> roleIds;
Customer(
{this.fileNumber,
this.iqamaNumber,
this.isOutSa,
this.patientType,
this.gender,
this.birthDate,
this.phone,
this.countryCode,
this.yahalaAccountno,
this.billingAddress,
this.shippingAddress,
this.addresses,
this.id,
this.username,
this.email,
this.firstName,
this.lastName,
this.languageId,
this.adminComment,
this.isTaxExempt,
this.hasShoppingCartItems,
this.active,
this.deleted,
this.isSystemAccount,
this.systemName,
this.lastIpAddress,
this.createdOnUtc,
this.lastLoginDateUtc,
this.lastActivityDateUtc,
this.registeredInStoreId,
this.roleIds});
Customer.fromJson(Map<String, dynamic> json) {
fileNumber = json['file_number'];
iqamaNumber = json['iqama_number'];
isOutSa = json['is_out_sa'];
patientType = json['patient_type'];
gender = json['gender'];
birthDate = json['birth_date'];
phone = json['phone'];
countryCode = json['country_code'];
yahalaAccountno = json['yahala_accountno'];
billingAddress = json['billing_address'];
shippingAddress = json['shipping_address'];
if (json['addresses'] != null) {
addresses = new List<Null>();
json['addresses'].forEach((v) {
addresses.add(v);
});
}
id = json['id'];
username = json['username'];
email = json['email'];
firstName = json['first_name'];
lastName = json['last_name'];
languageId = json['language_id'];
adminComment = json['admin_comment'];
isTaxExempt = json['is_tax_exempt'];
hasShoppingCartItems = json['has_shopping_cart_items'];
active = json['active'];
deleted = json['deleted'];
isSystemAccount = json['is_system_account'];
systemName = json['system_name'];
lastIpAddress = json['last_ip_address'];
createdOnUtc = json['created_on_utc'];
lastLoginDateUtc = json['last_login_date_utc'];
lastActivityDateUtc = json['last_activity_date_utc'];
registeredInStoreId = json['registered_in_store_id'];
if (json['role_ids'] != null) {
roleIds = new List<Null>();
json['role_ids'].forEach((v) {
roleIds.add(null);
});
} }
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['file_number'] = this.fileNumber;
data['iqama_number'] = this.iqamaNumber;
data['is_out_sa'] = this.isOutSa;
data['patient_type'] = this.patientType;
data['gender'] = this.gender;
data['birth_date'] = this.birthDate;
data['phone'] = this.phone;
data['country_code'] = this.countryCode;
data['yahala_accountno'] = this.yahalaAccountno;
data['billing_address'] = this.billingAddress;
data['shipping_address'] = this.shippingAddress;
if (this.addresses != null) {
data['addresses'] = this.addresses.map((v) => v);
}
data['id'] = this.id;
data['username'] = this.username;
data['email'] = this.email;
data['first_name'] = this.firstName;
data['last_name'] = this.lastName;
data['language_id'] = this.languageId;
data['admin_comment'] = this.adminComment;
data['is_tax_exempt'] = this.isTaxExempt;
data['has_shopping_cart_items'] = this.hasShoppingCartItems;
data['active'] = this.active;
data['deleted'] = this.deleted;
data['is_system_account'] = this.isSystemAccount;
data['system_name'] = this.systemName;
data['last_ip_address'] = this.lastIpAddress;
data['created_on_utc'] = this.createdOnUtc;
data['last_login_date_utc'] = this.lastLoginDateUtc;
data['last_activity_date_utc'] = this.lastActivityDateUtc;
data['registered_in_store_id'] = this.registeredInStoreId;
if (this.roleIds != null) {
data['role_ids'] = this.roleIds.map((v) => v);
}
return data; return data;
} }
} }
@ -842,40 +484,3 @@ 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;
}
}

@ -1,11 +1,9 @@
import 'package:diplomaticquarterapp/config/config.dart'; import 'package:diplomaticquarterapp/config/config.dart';
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/core/service/base_service.dart'; import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/Prescriptions.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/Prescriptions.dart';
class PrescriptionService extends BaseService { class PrescriptionService extends BaseService {
final AppSharedPreferences sharedPref = AppSharedPreferences(); final AppSharedPreferences sharedPref = AppSharedPreferences();
bool isFinished = true; bool isFinished = true;
@ -16,7 +14,6 @@ class PrescriptionService extends BaseService {
List<Prescriptions> _prescriptionsList = List(); List<Prescriptions> _prescriptionsList = List();
List<Prescriptions> get prescriptionsList => _prescriptionsList; List<Prescriptions> get prescriptionsList => _prescriptionsList;
// Future getPrescription() async { // Future getPrescription() async {
// hasError = false; // hasError = false;
// url = PRESCRIPTION; // url = PRESCRIPTION;
@ -35,29 +32,23 @@ class PrescriptionService extends BaseService {
// }); // });
// } // }
Future getPrescription() async { Future getPrescription() async {
url = PRESCRIPTION; url = PRESCRIPTION;
print("Print PRESCRIPTION url" + url); print("Print PRESCRIPTION url" + url);
hasError = false; hasError = false;
<<<<<<< HEAD
Map<String, dynamic> body = Map(); Map<String, dynamic> body = Map();
body['isDentalAllowedBackend'] = false; body['isDentalAllowedBackend'] = false;
await baseAppClient.post(PRESCRIPTION,
=======
url = PRESCRIPTION;
print("Print PRESCRIPTION url" + url); print("Print PRESCRIPTION url" + url);
await baseAppClient.post(url, await baseAppClient.post(url,
>>>>>>> development
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_prescriptionsList.clear(); _prescriptionsList.clear();
response['PatientPrescriptionList'].forEach((prescriptions) { response['PatientPrescriptionList'].forEach((prescriptions) {
_prescriptionsList.add(Prescriptions.fromJson(prescriptions)); _prescriptionsList.add(Prescriptions.fromJson(prescriptions));
}); });
print(_prescriptionsList.length); print(_prescriptionsList.length);
print(response); print("response is -------------"+response);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;
}, body: body); }, body: body);
} }
}
}

@ -34,13 +34,13 @@ class PharmacyModuleViewModel extends BaseViewModel {
_pharmacyService.lastVisitedProducts; _pharmacyService.lastVisitedProducts;
List<RecommendedProductModel> get recommendedProduct => List<Products> get recommendedProductList =>
_recommendedProductService.recommendedProductList; _recommendedProductService.recommendedList;
List<Prescriptions> get prescriptionsList => List<Prescriptions> get prescriptionsList =>
_prescriptionService.prescriptionsList; _prescriptionService.prescriptionsList;
bool hasError = false;
// List<PharmacyProduct> get pharmacyPrescriptionsList => PharmacyProduct.pharmacyPrescriptionsList ; // List<PharmacyProduct> get pharmacyPrescriptionsList => PharmacyProduct.pharmacyPrescriptionsList ;
Future getPharmacyHomeData() async { Future getPharmacyHomeData() async {
@ -136,10 +136,10 @@ class PharmacyModuleViewModel extends BaseViewModel {
} }
/////////////RecommendedProducts /////////////RecommendedProducts
getRecommendedProducts(ProductId) async { getRecommendedProducts(productId) async {
print("_____________________________________"); hasError = false;
print(ProductId); setState(ViewState.Busy);
await _recommendedProductService.getRecommendedProducts(ProductId.toString()); await _recommendedProductService.getRecommendedProducts(productId.toString());
if (_recommendedProductService.hasError) { if (_recommendedProductService.hasError) {
error = _recommendedProductService.error; error = _recommendedProductService.error;
setState(ViewState.Error); setState(ViewState.Error);

@ -280,45 +280,23 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
SizedBox( SizedBox(
height: 10, height: 10,
), ),
Container(
child: Text(
languageID == 'ar'
? widget.product.shortDescriptionn
: widget.product.shortDescription ??
"",
style: TextStyle(
fontSize: 16,
fontFamily: 'WorkSans-Regular'),
),
),
SizedBox(
height: 10,
),
Container(
child: Text(
TranslationBase.of(context).howToUse,
style: TextStyle(
fontSize: 17,
color: Colors.grey,
fontWeight: FontWeight.w600),
),
),
Divider(height: 1, color: Colors.grey), Divider(height: 1, color: Colors.grey),
SizedBox( SizedBox(
height: 10, height: 15,
), ),
Container( Container(
child: Text( child: Text(
languageID == 'ar' languageID == 'ar'
? widget.product.fullDescriptionn ? widget.product.fullDescriptionn
: widget.product.fullDescription, : widget.product.fullDescription ??
"",
style: TextStyle( style: TextStyle(
fontSize: 16, fontSize: 16,
fontFamily: 'WorkSans-Regular'), fontFamily: 'WorkSans-Regular'),
), ),
), ),
SizedBox( SizedBox(
height: 10, height: 20,
), ),
// Container( // Container(
// child: Text( // child: Text(
@ -329,6 +307,32 @@ class __ProductDetailPageState extends State<ProductDetailPage> {
// fontWeight: FontWeight.w600), // fontWeight: FontWeight.w600),
// ), // ),
// ), // ),
// Divider(height: 1, color: Colors.grey),
// SizedBox(
// height: 10,
// ),
// Container(
// child: Text(
// languageID == 'ar'
// ? widget.product.fullDescriptionn
// : widget.product.fullDescription,
// style: TextStyle(
// fontSize: 16,
// fontFamily: 'WorkSans-Regular'),
// ),
// ),
// SizedBox(
// height: 10,
// ),
// Container(
// child: Text(
// TranslationBase.of(context).howToUse,
// style: TextStyle(
// fontSize: 17,
// color: Colors.grey,
// fontWeight: FontWeight.w600),
// ),
// ),
// SizedBox( // SizedBox(
// height: 6, // height: 6,
// ), // ),
@ -1894,8 +1898,9 @@ checkWishlist() async {
ProductDetailViewModel x = new ProductDetailViewModel(); ProductDetailViewModel x = new ProductDetailViewModel();
await x.checkWishlistData(); await x.checkWishlistData();
for (int i = 0; i < x.wishListItems.length; i++) { for (int i = 0; i < x.wishListItems.length; i++) {
// print(itemID); print("---------Enad----wishlist---------------");
// print(x.wishListItems[i].product.id); print(itemID);
print(x.wishListItems[i].product.id);
if (itemID == x.wishListItems[i].product.id) { if (itemID == x.wishListItems[i].product.id) {
isInWishlit = true; isInWishlit = true;
// print('in wishlist'); // print('in wishlist');

@ -1,14 +1,16 @@
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart'; import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
import 'package:diplomaticquarterapp/config/size_config.dart'; import 'package:diplomaticquarterapp/config/size_config.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
import 'package:diplomaticquarterapp/core/model/pharmacies/recommendedProduct_model.dart'; import 'package:diplomaticquarterapp/core/model/pharmacies/recommendedProduct_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart'; import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/pharmacy_module_view_model.dart';
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
import 'package:diplomaticquarterapp/pages/base/base_view.dart'; import 'package:diplomaticquarterapp/pages/base/base_view.dart';
import 'package:diplomaticquarterapp/pages/landing/home_page.dart'; import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart'; import 'package:diplomaticquarterapp/pages/medical/prescriptions/prescriptions_home_page.dart';
import 'package:diplomaticquarterapp/pages/offers_categorise_page.dart'; import 'package:diplomaticquarterapp/pages/offers_categorise_page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product-brands.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/product-brands.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/lacum-activitaion-vida-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/lacum-activitaion-vida-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-main-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/lakum-main-page.dart';
import 'package:diplomaticquarterapp/pages/pharmacies/screens/recommended-product-page.dart'; import 'package:diplomaticquarterapp/pages/pharmacies/screens/recommended-product-page.dart';
@ -23,21 +25,49 @@ import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart'; import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart'; import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
import 'package:flutter/material.dart'; import 'package:flutter/material.dart';
import 'package:flutter_svg/flutter_svg.dart';
import 'package:rating_bar/rating_bar.dart'; import 'package:rating_bar/rating_bar.dart';
bool isInWishlist = false;
int price = 0;
dynamic itemID;
var product;
var customerId;
var item;
dynamic languageID; dynamic languageID;
class PharmacyPage extends StatelessWidget { List wishlistData;
// Products productModel ;
class PharmacyPage extends StatefulWidget {
// final PharmacyProduct product;
// PharmacyPage(this.product);
@override
_PharmacyPageState createState() => _PharmacyPageState();
}
class _PharmacyPageState extends State<PharmacyPage> {
dynamic wishlistVar;
getLanguageID() async { getLanguageID() async {
languageID = await sharedPref.getString(APP_LANGUAGE); languageID = await sharedPref.getString(APP_LANGUAGE);
} }
List<RecommendedProductModel> recommendedProductList = []; List<RecommendedProductModel> recommendedProductList = [];
var model; List<ProductDetailViewModel> wishList = [];
var model;
// String ProductId="4561";
//String id ="3608";
String ProductId="";
String id ="";
@override @override
void initState() { void initState() {
print("model recommended is " + model.recommendedProduct.length); checkWishlist();
// userInfo(widget.product.id, widget.product);
userInfo(id, product);
print("-------------this--------------");
print(itemID);
} }
@override @override
@ -303,102 +333,182 @@ class PharmacyPage extends StatelessWidget {
), ),
), ),
Container( Container(
height: model.recommendedProduct.length > 0 height: model.recommendedProductList.length > 0
? MediaQuery.of(context).size.height * 0.28 ? MediaQuery.of(context).size.height * 0.30
: 0, : 0,
padding: EdgeInsets.symmetric(horizontal: 16.0, vertical: 22.0), margin: EdgeInsets.symmetric(
margin: EdgeInsets.only(left: 10), horizontal: 6,
vertical: 4),
// padding: EdgeInsets.symmetric(horizontal: 5.0, vertical: 22.0),
// margin: EdgeInsets.only(left: 10),
child:BaseView<PharmacyModuleViewModel>( child:BaseView<PharmacyModuleViewModel>(
onModelReady: (model) => model.getRecommendedProducts(4561 ), onModelReady: (model) => model.getRecommendedProducts(ProductId),
builder: (_, model, wi) => model.recommendedProduct[0].products.length > 0 builder: (_, model, wi) => model.recommendedProductList.length != null
? ListView.builder( ? ListView.builder(
// itemBuilder: (ctx, i) =>
// ProductTileItem(model.recommendedProduct[i]),
// scrollDirection: Axis.horizontal,
// itemCount: model.recommendedProduct.length,
scrollDirection: Axis.horizontal, scrollDirection: Axis.horizontal,
shrinkWrap: true, shrinkWrap: true,
physics: ScrollPhysics(), physics: ScrollPhysics(),
// physics: NeverScrollableScrollPhysics(), // physics: NeverScrollableScrollPhysics(),
itemCount: model.recommendedProduct[0].products.length, itemCount: model.recommendedProductList.length,
itemBuilder: (context, index) { itemBuilder: (context, index) {
return Container( return
height: MediaQuery.of(context).size.height * 0.6, Card(
padding: EdgeInsets.only(bottom: 5.0, left: 5.0, right: 8.0), elevation: 2,
margin: EdgeInsets.only(right: 10.0), shape: RoundedRectangleBorder(
decoration: BoxDecoration( side: BorderSide(color: Colors.grey[300], width: 2),
border: Border.all( borderRadius: BorderRadius.circular(10)),
color: Colors.grey, //
style: BorderStyle.solid, margin: EdgeInsets.symmetric(
width: 1.0, horizontal: 8,
vertical: 4,
),
child: Container(
decoration: BoxDecoration(
borderRadius: BorderRadius.all(
Radius.circular(15),
), ),
color: Colors.white,
borderRadius: BorderRadius.circular(10.0)), ),
child: Column( padding: EdgeInsets.symmetric(horizontal: 4),
crossAxisAlignment: CrossAxisAlignment.start, width: MediaQuery.of(context).size.width / 3,
children: [ //
Container( child: Column(
margin: EdgeInsets.fromLTRB(0, 16, 0, 0), crossAxisAlignment: CrossAxisAlignment.start,
alignment: Alignment.center, children: [
child: (model.recommendedProduct[0].products[index].images != null &&
model.recommendedProduct[0].products[index].images.length > 0) Stack(
? Image.network( children:[
model.recommendedProduct[0].products[index].images[0].src.toString(), Container(
child: Align(
alignment: Alignment.topRight,
child: //true
itemID.contains(model.recommendedProductList[index].id)
// !isInWishlist
? IconButton(
icon: Icon(Icons.favorite_border),
color: Colors.grey,
iconSize: 30,
onPressed: () {
setState(() {
addToWishlistFunction(itemID);
});
},
)
: IconButton(
icon: Icon(Icons.favorite),
color: Colors.red,
iconSize: 30,
onPressed: () {
setState(() {
deleteFromWishlistFunction(itemID);
});
},
)
//
),
),
Container(
margin: EdgeInsets.fromLTRB(0, 16, 10, 16),
alignment: Alignment.center,
// padding: EdgeInsets.only(left: 25, bottom: 20),
child: (model.recommendedProductList[index].images != null &&
model.recommendedProductList[index].images.length > 0)
? Image.network(
model.recommendedProductList[index].images[0].src.toString(),
// item.images[0].src, // item.images[0].src,
fit: BoxFit.cover, fit: BoxFit.cover,
height: 80, height: 60,
) )
: Image.asset( : Image.asset(
"assets/images/no_image.png", "assets/images/no_image.png",
fit: BoxFit.cover, fit: BoxFit.cover,
height: 80, height: 60,
), ),
), ),
Text( Container(
model.recommendedProduct[0].products[index].shortDescription width: model.recommendedProductList[index].rxMessage != null
.toString(), ? MediaQuery.of(context).size.width / 5
style: TextStyle( : 0,
color: Colors.green, padding: EdgeInsets.all(4),
fontSize: 15.0, decoration: BoxDecoration(
color: Color(0xffb23838),
borderRadius:
BorderRadius.only(topLeft: Radius.circular(6)),
),
child: Texts(
model.recommendedProductList[index].rxMessage != null
? model.recommendedProductList[index].rxMessage : "",
color: Colors.white,
regular: true,
fontSize: 10,
fontWeight: FontWeight.w400,
),
),
] ),
Container(
margin: EdgeInsets.symmetric(
horizontal: 6,
vertical: 0,
),
child: Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
model.recommendedProductList[index].name,
style: TextStyle(
color: Colors.black,
fontSize: 13.0,
// fontWeight: FontWeight.bold, // fontWeight: FontWeight.bold,
),
),
Padding(
// padding: const EdgeInsets.only(top: 15, bottom: 10),
padding: const EdgeInsets.only(top: 10, bottom: 5),
child: Texts(
"SAR ${model.recommendedProductList[index].price}",
bold: true,
fontSize: 14,
),
),
],
),
), ),
), Row(
Padding( crossAxisAlignment:
padding: const EdgeInsets.only(top: 4, bottom: 4), CrossAxisAlignment.start,
child: Texts( children: <Widget>[
"SAR ${model.recommendedProduct[0].products[index].price}", Container(
bold: true, padding: EdgeInsets.only(right: 10),
fontSize: 14,
),
),
Row(
crossAxisAlignment:
CrossAxisAlignment.start,
children: <Widget>[
// Container(
// margin: EdgeInsets.only(left: 5), // margin: EdgeInsets.only(left: 5),
// child: Align( child: Align(
// alignment: Alignment.topLeft, alignment: Alignment.topLeft,
// child: RatingBar.readOnly( child: RatingBar.readOnly(
// initialRating: initialRating:
// model.recommendedProduct[0].products[index].reviews.toDouble(), model.recommendedProductList[index].approvedRatingSum.toDouble(),
//// initialRating: productRate, // initialRating: productRate,
// size: 15.0, size: 13.0,
// filledColor: Colors.yellow[700], filledColor: Colors.yellow[700],
// emptyColor: Colors.grey[500], emptyColor: Colors.grey[500],
// isHalfAllowed: true, isHalfAllowed: true,
// halfFilledIcon: Icons.star_half, halfFilledIcon: Icons.star_half,
// filledIcon: Icons.star, filledIcon: Icons.star,
// emptyIcon: Icons.star, emptyIcon: Icons.star,
// ), ),
// ), ),
// ), ),
]), Texts(
], "(${model.recommendedProductList[index].approvedTotalReviews.toString()})",
// bold: true,
fontSize: 12,
),
]),
],
),
), ),
); );
} }
): Container( ):
Container(
// child: Text("NO DATA"), // child: Text("NO DATA"),
), ),
), ),
@ -509,8 +619,56 @@ class PharmacyPage extends StatelessWidget {
), ),
); );
} }
addToWishlistFunction(itemID) async {
ProductDetailViewModel x = new ProductDetailViewModel();
isInWishlist = true;
await x.addToWishlistData(itemID);
}
deleteFromWishlistFunction(itemID) async {
ProductDetailViewModel x = new ProductDetailViewModel();
isInWishlist = false;
await x.addToWishlistData(itemID);
}
checkWishlist() async {
ProductDetailViewModel x = new ProductDetailViewModel();
await x.checkWishlistData();
for (int i = 0; i < x.wishListItems.length; i++) {
// itemID = x.wishListItems[i].id;
print("-------------wishlist---------------");
print(itemID);
// print(product.id);
print(x.wishListItems[i].productId);
if (itemID == x.wishListItems[i].productId) {
isInWishlist = true;
// print('in wishlist');
break;
} else {
isInWishlist = false;
// print('not in wishlist');
}
}
}
Future userInfo(id, product) async {
customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
if (customerId != null) {
itemID = id;
product = product;
checkWishlist();
}
print("customerId:$customerId");
return customerId;
}
} }
class GridViewButtons extends StatelessWidget { class GridViewButtons extends StatelessWidget {
final PharmacyModuleViewModel model; final PharmacyModuleViewModel model;
@ -643,6 +801,8 @@ class GridViewCard extends StatelessWidget {
); );
} }
String getDate(String date) { String getDate(String date) {
DateTime dateObj = DateUtil.convertStringToDate(date); DateTime dateObj = DateUtil.convertStringToDate(date);
return DateUtil.getWeekDay(dateObj.weekday) + return DateUtil.getWeekDay(dateObj.weekday) +
@ -654,3 +814,34 @@ class GridViewCard extends StatelessWidget {
dateObj.year.toString(); dateObj.year.toString();
} }
} }
class test extends StatefulWidget {
@override
_testState createState() => _testState();
}
class _testState extends State<test> {
@override
Widget build(BuildContext context) {
return Container();
}
}
//addWishlistData() async {
// ProductDetailViewModel x = new ProductDetailViewModel();
// await wishlistData.add(x.checkWishlistData());
// print("-------------testWishlist---------------");
//
//}
// checkWishlist() async {
// ProductDetailViewModel x = new ProductDetailViewModel();
// wishlistVar = await x.checkWishlistData();
// print("wishlistVar>>>>>>>>>>>>>>>");
// print(wishlistVar);
//
// }

File diff suppressed because it is too large Load Diff

@ -69,6 +69,7 @@ class _OrderPageState extends State<OrderPage> with SingleTickerProviderStateMix
TabBar( TabBar(
labelPadding: labelPadding:
EdgeInsets.only(left: 3.0, right: 3.0), EdgeInsets.only(left: 3.0, right: 3.0),
labelColor: Colors.black,
tabs: [ tabs: [
Tab(text: TranslationBase.of(context).delivered), Tab(text: TranslationBase.of(context).delivered),
Tab(text: TranslationBase.of(context).processing), Tab(text: TranslationBase.of(context).processing),

@ -48,7 +48,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
var model; var model;
var isCancel = false; var isCancel = false;
var isRefund = false; var isRefund = false;
var isActiveDelivery = true; var isActiveDelivery = false;
var dataIsCancel; var dataIsCancel;
var dataIsRefund; var dataIsRefund;
@ -66,7 +66,13 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return BaseView<OrderModelViewModel>( return BaseView<OrderModelViewModel>(
onModelReady: (model) => model.getOrderDetails(widget.orderModel.id), onModelReady: (model){
model.getOrderDetails(widget.orderModel.id).then((value){
setState(() {
isActiveDelivery = (value.orderStatusId == 995 && (value.driverID != null && value.driverID.isNotEmpty));
});
});
},
builder: (_, model, wi) => AppScaffold( builder: (_, model, wi) => AppScaffold(
appBarTitle: TranslationBase.of(context).orderDetail, appBarTitle: TranslationBase.of(context).orderDetail,
isShowAppBar: true, isShowAppBar: true,
@ -111,11 +117,9 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
borderRadius: BorderRadius.circular(30.0)), borderRadius: BorderRadius.circular(30.0)),
child: Text( child: Text(
languageID == "ar" languageID == "ar"
? model.orderListModel[0].orderStatusn.toString() ? widget.orderModel.orderStatusn.toString()
: model.orderListModel[0].orderStatus : widget.orderModel.orderStatus
.toString() .toString(),
.substring(12),
// TranslationBase.of(context).delivered,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontSize: 13.0, fontSize: 13.0,
@ -132,12 +136,7 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
children: <Widget>[ children: <Widget>[
Text( Text(
model.orderListModel[0].shippingAddress.firstName model.orderListModel[0].shippingAddress.firstName
.toString() .toString().substring(10) ,
.substring(10) +
' ' +
model.orderListModel[0].shippingAddress.lastName
.toString()
.substring(9),
style: TextStyle( style: TextStyle(
fontSize: 15.0, fontSize: 15.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -152,8 +151,8 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
children: <Widget>[ children: <Widget>[
Text( Text(
model.orderListModel[0].shippingAddress.address1 model.orderListModel[0].shippingAddress.address1
.toString() .toString().substring(9),
.substring(9), // .substring(9),
style: TextStyle( style: TextStyle(
fontSize: 10.0, fontSize: 10.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -169,9 +168,9 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
children: <Widget>[ children: <Widget>[
Text( Text(
model.orderListModel[0].shippingAddress.address2 model.orderListModel[0].shippingAddress.address2
.toString() .toString().substring(9)
.substring(9) + // .substring(9) +
' ' + + ' ' +
model.orderListModel[0].shippingAddress.country model.orderListModel[0].shippingAddress.country
.toString() + .toString() +
' ' + ' ' +
@ -239,8 +238,8 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
Container( Container(
child: flutterImage.Image.asset( child: flutterImage.Image.asset(
model.orderListModel[0] model.orderListModel[0]
.shippingRateComputationMethodSystemName != .shippingRateComputationMethodSystemName !=
"Shipping.Aramex" "Shipping.Aramex"
? "assets/images/pharmacy_module/payment/LogoParmacyGreen.png" ? "assets/images/pharmacy_module/payment/LogoParmacyGreen.png"
: "assets/images/pharmacy_module/payment/aramex_shipping_logo.png", : "assets/images/pharmacy_module/payment/aramex_shipping_logo.png",
fit: BoxFit.contain, fit: BoxFit.contain,
@ -292,8 +291,8 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
margin: EdgeInsets.only(bottom: 10.0, top: 10.0), margin: EdgeInsets.only(bottom: 10.0, top: 10.0),
child: Text( child: Text(
model.orderListModel[0].paymentName model.orderListModel[0].paymentName
.toString() .toString().substring(12),
.substring(12),
style: TextStyle( style: TextStyle(
fontSize: 13.0, fontSize: 13.0,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
@ -345,24 +344,24 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
productReviews: model.orderListModel[0] productReviews: model.orderListModel[0]
.orderItems[index].product.approvedTotalReviews, .orderItems[index].product.approvedTotalReviews,
totalPrice: totalPrice:
"${(model.orderListModel[0].orderItems[index].product.price * model.orderListModel[0].orderItems[index].quantity).toStringAsFixed(2)}", "${(model.orderListModel[0].orderItems[index].product.price * model.orderListModel[0].orderItems[index].quantity).toStringAsFixed(2)}",
qyt: model qyt: model
.orderListModel[0].orderItems[index].quantity .orderListModel[0].orderItems[index].quantity
.toString(), .toString(),
isOrderDetails: true, isOrderDetails: true,
imgs: model.orderListModel[0].orderItems[index] imgs: model.orderListModel[0].orderItems[index]
.product.images != .product.images !=
null && null &&
model.orderListModel[0].orderItems[index] model.orderListModel[0].orderItems[index]
.product.images.length != .product.images.length !=
0 0
? model.orderListModel[0].orderItems[index] ? model.orderListModel[0].orderItems[index]
.product.images[0].src .product.images[0].src
.toString() .toString()
: null, : null,
status: model.orderListModel[0].orderStatusId, status: model.orderListModel[0].orderStatusId,
product: product:
model.orderListModel[0].orderItems[index].product, model.orderListModel[0].orderItems[index].product,
), ),
); );
}), }),
@ -540,81 +539,81 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
), ),
model.orderListModel[0].orderStatusId == 10 model.orderListModel[0].orderStatusId == 10
? InkWell( ? InkWell(
onTap: () { onTap: () {
model.makeOrder(); model.makeOrder();
}, },
child: Container( child: Container(
// margin: EdgeInsets.only(top: 20.0), // margin: EdgeInsets.only(top: 20.0),
height: 50.0, height: 50.0,
color: Colors.transparent, color: Colors.transparent,
child: Container( child: Container(
padding: EdgeInsets.only(left: 130.0, right: 130.0), padding: EdgeInsets.only(left: 130.0, right: 130.0),
decoration: BoxDecoration( decoration: BoxDecoration(
border: Border.all( border: Border.all(
color: Colors.green, color: Colors.green,
style: BorderStyle.solid, style: BorderStyle.solid,
width: 4.0), width: 4.0),
color: Colors.green, color: Colors.green,
borderRadius: BorderRadius.circular(5.0)), borderRadius: BorderRadius.circular(5.0)),
child: Center( child: Center(
child: Text( child: Text(
TranslationBase.of(context).payOnline, TranslationBase.of(context).payOnline,
style: TextStyle( style: TextStyle(
color: Colors.white, color: Colors.white,
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
),
),
),
), ),
), ),
) ),
),
),
)
: Container(), : Container(),
// getCancelOrder(canCancel, canRefund), // getCancelOrder(canCancel, canRefund),
isCancel isCancel
? InkWell( ? InkWell(
onTap: () { onTap: () {
presentConfirmDialog(model, widget.orderModel.id); presentConfirmDialog(model, widget.orderModel.id);
// model.orderListModel[0].id//(widget.orderModel.id)); // model.orderListModel[0].id//(widget.orderModel.id));
// //
}, },
child: Container( child: Container(
// padding: EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0), // padding: EdgeInsets.only(left: 13.0, right: 13.0, top: 5.0),
height: 50.0, height: 50.0,
color: Colors.transparent, color: Colors.transparent,
child: Center( child: Center(
child: Text( child: Text(
TranslationBase.of(context).cancelOrder, TranslationBase.of(context).cancelOrder,
style: TextStyle( style: TextStyle(
color: Colors.red[900], color: Colors.red[900],
fontWeight: FontWeight.bold, fontWeight: FontWeight.bold,
decoration: TextDecoration.underline), decoration: TextDecoration.underline),
), ),
), ),
), ),
) )
: Container(), : Container(),
isActiveDelivery isActiveDelivery
? InkWell( ? InkWell(
onTap: () { onTap: () {
// Navigator.push( Navigator.push(
// context, context,
// MaterialPageRoute(builder: (context) => TrackDriver(order: widget.orderModel), MaterialPageRoute(builder: (context) => TrackDriver(order: model.orderListModel.first),
// )); ));
}, },
child: Container( child: Container(
height: 50.0, height: 50.0,
color: Colors.transparent, color: Colors.transparent,
child: Center( child: Center(
child: Text( child: Text(
TranslationBase.of(context).trackDeliveryDriver, TranslationBase.of(context).trackDeliveryDriver,
style: TextStyle( style: TextStyle(
color: Colors.green[900], color: Colors.green[900],
fontWeight: FontWeight.normal, fontWeight: FontWeight.normal,
decoration: TextDecoration.none), decoration: TextDecoration.none),
), ),
), ),
), ),
) )
: Container(), : Container(),
], ],
), ),
@ -702,3 +701,4 @@ class _OrderDetailsPageState extends State<OrderDetailsPage> {
} }
} }
} }

@ -5,7 +5,7 @@ import 'package:diplomaticquarterapp/core/service/base_service.dart';
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart'; import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart'; import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart'; import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
import 'package:flutter/material.dart';
@ -15,23 +15,24 @@ class RecommendedProductService extends BaseService{
AuthenticatedUser authUser = new AuthenticatedUser(); AuthenticatedUser authUser = new AuthenticatedUser();
AuthProvider authProvider = new AuthProvider(); AuthProvider authProvider = new AuthProvider();
List<RecommendedProductModel> _recommendedProductList = List(); List<Products> _recommendedProductList = List();
List<RecommendedProductModel> get recommendedProductList => _recommendedProductList; List<Products> get recommendedList => _recommendedProductList;
String url =""; String url ="";
Future getRecommendedProducts(ProductId) async { Future getRecommendedProducts(productId) async {
hasError = false; hasError = false;
url =GET_RECOMMENDED_PRODUCT+ProductId; url =GET_RECOMMENDED_PRODUCT+productId;
print("Recommended Product is"+url);
await baseAppClient.getPharmacy(url, await baseAppClient.getPharmacy(url,
onSuccess: (dynamic response, int statusCode) { onSuccess: (dynamic response, int statusCode) {
_recommendedProductList.clear(); _recommendedProductList.clear();
response['products'].forEach((item) { response['products'].forEach((item) {
_recommendedProductList.add(Products.fromJson(item));
print("----------------------------------");
print("Test data");
print(_recommendedProductList[0]);
print(item['name']);
print(response);
}); });
print("print recommended items" + _recommendedProductList.length.toString());
print(response);
}, onFailure: (String error, int statusCode) { }, onFailure: (String error, int statusCode) {
hasError = true; hasError = true;
super.error = error; super.error = error;

@ -995,6 +995,7 @@ class TranslationBase {
String get convertBloodSugarStatement => localizedValues["convertBloodSugarStatement"][locale.languageCode]; String get convertBloodSugarStatement => localizedValues["convertBloodSugarStatement"][locale.languageCode];
String get convertFrom => localizedValues["convertFrom"][locale.languageCode]; String get convertFrom => localizedValues["convertFrom"][locale.languageCode];
String get result => localizedValues["result"][locale.languageCode]; String get result => localizedValues["result"][locale.languageCode];
String get sort => localizedValues["sort"][locale.languageCode];
String get bloodSugarConversion => localizedValues["bloodSugarConversion"][locale.languageCode]; String get bloodSugarConversion => localizedValues["bloodSugarConversion"][locale.languageCode];
String get convertCholesterolStatement => localizedValues["convertCholesterolStatement"][locale.languageCode]; String get convertCholesterolStatement => localizedValues["convertCholesterolStatement"][locale.languageCode];
String get triglyceridesConvertStatement => localizedValues["triglyceridesConvertStatement"][locale.languageCode]; String get triglyceridesConvertStatement => localizedValues["triglyceridesConvertStatement"][locale.languageCode];

Loading…
Cancel
Save