Merge branch 'pharmacy' into pharmacy_mosa_branch
# Conflicts: # lib/config/config.dart # lib/config/localized_values.dart # lib/core/viewModels/pharmacyModule/PharmacyAddressesViewModel.dart # lib/pages/pharmacy/pharmacyAddresses/PharmacyAddresses.dart # lib/services/pharmacy_services/pharmacyAddress_service.dart # lib/uitl/translations_delegate_base.dartmaster
commit
38d58ebaaf
Binary file not shown.
|
After Width: | Height: | Size: 4.1 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 704 B |
@ -0,0 +1,24 @@
|
|||||||
|
class BrandsModel {
|
||||||
|
String id;
|
||||||
|
String name;
|
||||||
|
String namen;
|
||||||
|
Null image;
|
||||||
|
|
||||||
|
BrandsModel({this.id, this.name, this.namen, this.image});
|
||||||
|
|
||||||
|
BrandsModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
name = json['name'];
|
||||||
|
namen = json['namen'];
|
||||||
|
image = json['image'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['name'] = this.name;
|
||||||
|
data['namen'] = this.namen;
|
||||||
|
data['image'] = this.image;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,75 @@
|
|||||||
|
class CategoriseParentModel {
|
||||||
|
String id;
|
||||||
|
String name;
|
||||||
|
String namen;
|
||||||
|
List<LocalizedNames> localizedNames;
|
||||||
|
dynamic description;
|
||||||
|
int parentCategoryId;
|
||||||
|
int displayOrder;
|
||||||
|
dynamic image;
|
||||||
|
bool isLeaf;
|
||||||
|
|
||||||
|
CategoriseParentModel(
|
||||||
|
{this.id,
|
||||||
|
this.name,
|
||||||
|
this.namen,
|
||||||
|
this.localizedNames,
|
||||||
|
this.description,
|
||||||
|
this.parentCategoryId,
|
||||||
|
this.displayOrder,
|
||||||
|
this.image,
|
||||||
|
this.isLeaf});
|
||||||
|
|
||||||
|
CategoriseParentModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
name = json['name'];
|
||||||
|
namen = json['namen'];
|
||||||
|
if (json['localized_names'] != null) {
|
||||||
|
localizedNames = new List<LocalizedNames>();
|
||||||
|
json['localized_names'].forEach((v) {
|
||||||
|
localizedNames.add(new LocalizedNames.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
description = json['description'];
|
||||||
|
parentCategoryId = json['parent_category_id'];
|
||||||
|
displayOrder = json['display_order'];
|
||||||
|
image = json['image'];
|
||||||
|
isLeaf = json['is_leaf'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['name'] = this.name;
|
||||||
|
data['namen'] = this.namen;
|
||||||
|
if (this.localizedNames != null) {
|
||||||
|
data['localized_names'] =
|
||||||
|
this.localizedNames.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['description'] = this.description;
|
||||||
|
data['parent_category_id'] = this.parentCategoryId;
|
||||||
|
data['display_order'] = this.displayOrder;
|
||||||
|
data['image'] = this.image;
|
||||||
|
data['is_leaf'] = this.isLeaf;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,184 @@
|
|||||||
|
class FinalProductsModel {
|
||||||
|
String id;
|
||||||
|
String name;
|
||||||
|
String namen;
|
||||||
|
List<LocalizedNames> localizedNames;
|
||||||
|
String shortDescription;
|
||||||
|
String fullDescription;
|
||||||
|
String fullDescriptionn;
|
||||||
|
dynamic approvedRatingSum;
|
||||||
|
dynamic approvedTotalReviews;
|
||||||
|
String sku;
|
||||||
|
bool isRx;
|
||||||
|
dynamic rxMessage;
|
||||||
|
dynamic rxMessagen;
|
||||||
|
dynamic stockQuantity;
|
||||||
|
String stockAvailability;
|
||||||
|
String stockAvailabilityn;
|
||||||
|
bool allowBackInStockSubscriptions;
|
||||||
|
dynamic orderMinimumQuantity;
|
||||||
|
dynamic orderMaximumQuantity;
|
||||||
|
dynamic price;
|
||||||
|
dynamic oldPrice;
|
||||||
|
dynamic discountName;
|
||||||
|
dynamic discountNamen;
|
||||||
|
dynamic discountPercentage;
|
||||||
|
dynamic displayOrder;
|
||||||
|
List<dynamic> discountIds;
|
||||||
|
List<dynamic> reviews;
|
||||||
|
List<Images> images;
|
||||||
|
|
||||||
|
FinalProductsModel(
|
||||||
|
{this.id,
|
||||||
|
this.name,
|
||||||
|
this.namen,
|
||||||
|
this.localizedNames,
|
||||||
|
this.shortDescription,
|
||||||
|
this.fullDescription,
|
||||||
|
this.fullDescriptionn,
|
||||||
|
this.approvedRatingSum,
|
||||||
|
this.approvedTotalReviews,
|
||||||
|
this.sku,
|
||||||
|
this.isRx,
|
||||||
|
this.rxMessage,
|
||||||
|
this.rxMessagen,
|
||||||
|
this.stockQuantity,
|
||||||
|
this.stockAvailability,
|
||||||
|
this.stockAvailabilityn,
|
||||||
|
this.allowBackInStockSubscriptions,
|
||||||
|
this.orderMinimumQuantity,
|
||||||
|
this.orderMaximumQuantity,
|
||||||
|
this.price,
|
||||||
|
this.oldPrice,
|
||||||
|
this.discountName,
|
||||||
|
this.discountNamen,
|
||||||
|
this.discountPercentage,
|
||||||
|
this.displayOrder,
|
||||||
|
this.discountIds,
|
||||||
|
this.reviews,
|
||||||
|
this.images});
|
||||||
|
|
||||||
|
FinalProductsModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
name = json['name'];
|
||||||
|
if (json['images'] != null) {
|
||||||
|
images = new List<Images>();
|
||||||
|
json['images'].forEach((v) {
|
||||||
|
images.add(new Images.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
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'];
|
||||||
|
fullDescription = json['full_description'];
|
||||||
|
fullDescriptionn = json['full_descriptionn'];
|
||||||
|
approvedRatingSum = json['approved_rating_sum'];
|
||||||
|
approvedTotalReviews = json['approved_total_reviews'];
|
||||||
|
sku = json['sku'];
|
||||||
|
isRx = json['is_rx'];
|
||||||
|
rxMessage = json['rx_message'];
|
||||||
|
rxMessagen = json['rx_messagen'];
|
||||||
|
stockQuantity = json['stock_quantity'];
|
||||||
|
stockAvailability = json['stock_availability'];
|
||||||
|
stockAvailabilityn = json['stock_availabilityn'];
|
||||||
|
allowBackInStockSubscriptions = json['allow_back_in_stock_subscriptions'];
|
||||||
|
orderMinimumQuantity = json['order_minimum_quantity'];
|
||||||
|
orderMaximumQuantity = json['order_maximum_quantity'];
|
||||||
|
price = json['price'];
|
||||||
|
oldPrice = json['old_price'];
|
||||||
|
discountName = json['discount_name'];
|
||||||
|
discountNamen = json['discount_namen'];
|
||||||
|
discountPercentage = json['discount_percentage'];
|
||||||
|
displayOrder = json['display_order'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['name'] = this.name;
|
||||||
|
data['namen'] = this.namen;
|
||||||
|
if (this.localizedNames != null) {
|
||||||
|
data['localized_names'] =
|
||||||
|
this.localizedNames.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['short_description'] = this.shortDescription;
|
||||||
|
data['full_description'] = this.fullDescription;
|
||||||
|
data['full_descriptionn'] = this.fullDescriptionn;
|
||||||
|
data['approved_rating_sum'] = this.approvedRatingSum;
|
||||||
|
data['approved_total_reviews'] = this.approvedTotalReviews;
|
||||||
|
data['sku'] = this.sku;
|
||||||
|
data['is_rx'] = this.isRx;
|
||||||
|
data['rx_message'] = this.rxMessage;
|
||||||
|
data['rx_messagen'] = this.rxMessagen;
|
||||||
|
data['stock_quantity'] = this.stockQuantity;
|
||||||
|
data['stock_availability'] = this.stockAvailability;
|
||||||
|
data['stock_availabilityn'] = this.stockAvailabilityn;
|
||||||
|
data['allow_back_in_stock_subscriptions'] =
|
||||||
|
this.allowBackInStockSubscriptions;
|
||||||
|
data['order_minimum_quantity'] = this.orderMinimumQuantity;
|
||||||
|
data['order_maximum_quantity'] = this.orderMaximumQuantity;
|
||||||
|
data['price'] = this.price;
|
||||||
|
data['old_price'] = this.oldPrice;
|
||||||
|
data['discount_name'] = this.discountName;
|
||||||
|
data['discount_namen'] = this.discountNamen;
|
||||||
|
data['discount_percentage'] = this.discountPercentage;
|
||||||
|
data['display_order'] = this.displayOrder;
|
||||||
|
|
||||||
|
if (this.images != null) {
|
||||||
|
data['images'] = this.images.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Images {
|
||||||
|
int id;
|
||||||
|
int position;
|
||||||
|
String src;
|
||||||
|
String thumb;
|
||||||
|
String attachment;
|
||||||
|
|
||||||
|
Images({this.id, this.position, this.src, this.thumb, this.attachment});
|
||||||
|
|
||||||
|
Images.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
position = json['position'];
|
||||||
|
src = json['src'];
|
||||||
|
thumb = json['thumb'];
|
||||||
|
attachment = json['attachment'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['position'] = this.position;
|
||||||
|
data['src'] = this.src;
|
||||||
|
data['thumb'] = this.thumb;
|
||||||
|
data['attachment'] = this.attachment;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,579 @@
|
|||||||
|
class OfferProductsModel {
|
||||||
|
String id;
|
||||||
|
bool visibleIndividually;
|
||||||
|
String name;
|
||||||
|
String namen;
|
||||||
|
List<LocalizedNames> localizedNames;
|
||||||
|
String shortDescription;
|
||||||
|
String shortDescriptionn;
|
||||||
|
String fullDescription;
|
||||||
|
String fullDescriptionn;
|
||||||
|
bool markasNew;
|
||||||
|
bool showOnHomePage;
|
||||||
|
dynamic metaKeywords;
|
||||||
|
dynamic metaDescription;
|
||||||
|
dynamic metaTitle;
|
||||||
|
bool allowCustomerReviews;
|
||||||
|
dynamic approvedRatingSum;
|
||||||
|
dynamic notApprovedRatingSum;
|
||||||
|
dynamic approvedTotalReviews;
|
||||||
|
dynamic notApprovedTotalReviews;
|
||||||
|
String sku;
|
||||||
|
bool isRx;
|
||||||
|
bool prescriptionRequired;
|
||||||
|
dynamic rxMessage;
|
||||||
|
dynamic rxMessagen;
|
||||||
|
dynamic manufacturerPartNumber;
|
||||||
|
dynamic gtin;
|
||||||
|
bool isGiftCard;
|
||||||
|
bool requireOtherProducts;
|
||||||
|
bool automaticallyAddRequiredProducts;
|
||||||
|
bool isDownload;
|
||||||
|
bool unlimitedDownloads;
|
||||||
|
dynamic maxNumberOfDownloads;
|
||||||
|
dynamic downloadExpirationDays;
|
||||||
|
bool hasSampleDownload;
|
||||||
|
bool hasUserAgreement;
|
||||||
|
bool isRecurring;
|
||||||
|
dynamic recurringCycleLength;
|
||||||
|
dynamic recurringTotalCycles;
|
||||||
|
bool isRental;
|
||||||
|
dynamic rentalPriceLength;
|
||||||
|
bool isShipEnabled;
|
||||||
|
bool isFreeShipping;
|
||||||
|
bool shipSeparately;
|
||||||
|
dynamic additionalShippingCharge;
|
||||||
|
bool isTaxExempt;
|
||||||
|
bool isTelecommunicationsOrBroadcastingOrElectronicServices;
|
||||||
|
bool useMultipleWarehouses;
|
||||||
|
dynamic manageInventoryMethodId;
|
||||||
|
dynamic stockQuantity;
|
||||||
|
String stockAvailability;
|
||||||
|
String stockAvailabilityn;
|
||||||
|
bool displayStockAvailability;
|
||||||
|
bool displayStockQuantity;
|
||||||
|
dynamic minStockQuantity;
|
||||||
|
dynamic notifyAdminForQuantityBelow;
|
||||||
|
bool allowBackInStockSubscriptions;
|
||||||
|
dynamic orderMinimumQuantity;
|
||||||
|
dynamic orderMaximumQuantity;
|
||||||
|
dynamic allowedQuantities;
|
||||||
|
bool allowAddingOnlyExistingAttributeCombinations;
|
||||||
|
bool disableBuyButton;
|
||||||
|
bool disableWishlistButton;
|
||||||
|
bool availableForPreOrder;
|
||||||
|
dynamic preOrderAvailabilityStartDateTimeUtc;
|
||||||
|
bool callForPrice;
|
||||||
|
dynamic price;
|
||||||
|
dynamic oldPrice;
|
||||||
|
dynamic productCost;
|
||||||
|
dynamic specialPrice;
|
||||||
|
dynamic specialPriceStartDateTimeUtc;
|
||||||
|
dynamic specialPriceEndDateTimeUtc;
|
||||||
|
bool customerEntersPrice;
|
||||||
|
dynamic minimumCustomerEnteredPrice;
|
||||||
|
dynamic maximumCustomerEnteredPrice;
|
||||||
|
bool basepriceEnabled;
|
||||||
|
dynamic basepriceAmount;
|
||||||
|
dynamic basepriceBaseAmount;
|
||||||
|
bool hasTierPrices;
|
||||||
|
bool hasDiscountsApplied;
|
||||||
|
String discountName;
|
||||||
|
String discountNamen;
|
||||||
|
String discountDescription;
|
||||||
|
String discountDescriptionn;
|
||||||
|
dynamic discountPercentage;
|
||||||
|
String currency;
|
||||||
|
String currencyn;
|
||||||
|
dynamic weight;
|
||||||
|
dynamic length;
|
||||||
|
dynamic width;
|
||||||
|
dynamic height;
|
||||||
|
dynamic availableStartDateTimeUtc;
|
||||||
|
dynamic availableEndDateTimeUtc;
|
||||||
|
dynamic displayOrder;
|
||||||
|
bool published;
|
||||||
|
bool deleted;
|
||||||
|
String createdOnUtc;
|
||||||
|
String updatedOnUtc;
|
||||||
|
String productType;
|
||||||
|
dynamic parentGroupedProductId;
|
||||||
|
List<dynamic> roleIds;
|
||||||
|
List<dynamic> discountIds;
|
||||||
|
List<dynamic> storeIds;
|
||||||
|
List<dynamic> manufacturerIds;
|
||||||
|
List<dynamic> reviews;
|
||||||
|
List<Images> images;
|
||||||
|
List<dynamic> attributes;
|
||||||
|
List<Specifications> specifications;
|
||||||
|
List<dynamic> associatedProductIds;
|
||||||
|
List<dynamic> tags;
|
||||||
|
dynamic vendorId;
|
||||||
|
String seName;
|
||||||
|
|
||||||
|
OfferProductsModel(
|
||||||
|
{this.id,
|
||||||
|
this.visibleIndividually,
|
||||||
|
this.name,
|
||||||
|
this.namen,
|
||||||
|
this.localizedNames,
|
||||||
|
this.shortDescription,
|
||||||
|
this.shortDescriptionn,
|
||||||
|
this.fullDescription,
|
||||||
|
this.fullDescriptionn,
|
||||||
|
this.markasNew,
|
||||||
|
this.showOnHomePage,
|
||||||
|
this.metaKeywords,
|
||||||
|
this.metaDescription,
|
||||||
|
this.metaTitle,
|
||||||
|
this.allowCustomerReviews,
|
||||||
|
this.approvedRatingSum,
|
||||||
|
this.notApprovedRatingSum,
|
||||||
|
this.approvedTotalReviews,
|
||||||
|
this.notApprovedTotalReviews,
|
||||||
|
this.sku,
|
||||||
|
this.isRx,
|
||||||
|
this.prescriptionRequired,
|
||||||
|
this.rxMessage,
|
||||||
|
this.rxMessagen,
|
||||||
|
this.manufacturerPartNumber,
|
||||||
|
this.gtin,
|
||||||
|
this.isGiftCard,
|
||||||
|
this.requireOtherProducts,
|
||||||
|
this.automaticallyAddRequiredProducts,
|
||||||
|
this.isDownload,
|
||||||
|
this.unlimitedDownloads,
|
||||||
|
this.maxNumberOfDownloads,
|
||||||
|
this.downloadExpirationDays,
|
||||||
|
this.hasSampleDownload,
|
||||||
|
this.hasUserAgreement,
|
||||||
|
this.isRecurring,
|
||||||
|
this.recurringCycleLength,
|
||||||
|
this.recurringTotalCycles,
|
||||||
|
this.isRental,
|
||||||
|
this.rentalPriceLength,
|
||||||
|
this.isShipEnabled,
|
||||||
|
this.isFreeShipping,
|
||||||
|
this.shipSeparately,
|
||||||
|
this.additionalShippingCharge,
|
||||||
|
this.isTaxExempt,
|
||||||
|
this.isTelecommunicationsOrBroadcastingOrElectronicServices,
|
||||||
|
this.useMultipleWarehouses,
|
||||||
|
this.manageInventoryMethodId,
|
||||||
|
this.stockQuantity,
|
||||||
|
this.stockAvailability,
|
||||||
|
this.stockAvailabilityn,
|
||||||
|
this.displayStockAvailability,
|
||||||
|
this.displayStockQuantity,
|
||||||
|
this.minStockQuantity,
|
||||||
|
this.notifyAdminForQuantityBelow,
|
||||||
|
this.allowBackInStockSubscriptions,
|
||||||
|
this.orderMinimumQuantity,
|
||||||
|
this.orderMaximumQuantity,
|
||||||
|
this.allowedQuantities,
|
||||||
|
this.allowAddingOnlyExistingAttributeCombinations,
|
||||||
|
this.disableBuyButton,
|
||||||
|
this.disableWishlistButton,
|
||||||
|
this.availableForPreOrder,
|
||||||
|
this.preOrderAvailabilityStartDateTimeUtc,
|
||||||
|
this.callForPrice,
|
||||||
|
this.price,
|
||||||
|
this.oldPrice,
|
||||||
|
this.productCost,
|
||||||
|
this.specialPrice,
|
||||||
|
this.specialPriceStartDateTimeUtc,
|
||||||
|
this.specialPriceEndDateTimeUtc,
|
||||||
|
this.customerEntersPrice,
|
||||||
|
this.minimumCustomerEnteredPrice,
|
||||||
|
this.maximumCustomerEnteredPrice,
|
||||||
|
this.basepriceEnabled,
|
||||||
|
this.basepriceAmount,
|
||||||
|
this.basepriceBaseAmount,
|
||||||
|
this.hasTierPrices,
|
||||||
|
this.hasDiscountsApplied,
|
||||||
|
this.discountName,
|
||||||
|
this.discountNamen,
|
||||||
|
this.discountDescription,
|
||||||
|
this.discountDescriptionn,
|
||||||
|
this.discountPercentage,
|
||||||
|
this.currency,
|
||||||
|
this.currencyn,
|
||||||
|
this.weight,
|
||||||
|
this.length,
|
||||||
|
this.width,
|
||||||
|
this.height,
|
||||||
|
this.availableStartDateTimeUtc,
|
||||||
|
this.availableEndDateTimeUtc,
|
||||||
|
this.displayOrder,
|
||||||
|
this.published,
|
||||||
|
this.deleted,
|
||||||
|
this.createdOnUtc,
|
||||||
|
this.updatedOnUtc,
|
||||||
|
this.productType,
|
||||||
|
this.parentGroupedProductId,
|
||||||
|
this.roleIds,
|
||||||
|
this.discountIds,
|
||||||
|
this.storeIds,
|
||||||
|
this.manufacturerIds,
|
||||||
|
this.reviews,
|
||||||
|
this.images,
|
||||||
|
this.attributes,
|
||||||
|
this.specifications,
|
||||||
|
this.associatedProductIds,
|
||||||
|
this.tags,
|
||||||
|
this.vendorId,
|
||||||
|
this.seName});
|
||||||
|
|
||||||
|
OfferProductsModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
visibleIndividually = json['visible_individually'];
|
||||||
|
name = json['name'];
|
||||||
|
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'];
|
||||||
|
shortDescriptionn = json['short_descriptionn'];
|
||||||
|
fullDescription = json['full_description'];
|
||||||
|
fullDescriptionn = json['full_descriptionn'];
|
||||||
|
markasNew = json['markas_new'];
|
||||||
|
showOnHomePage = json['show_on_home_page'];
|
||||||
|
metaKeywords = json['meta_keywords'];
|
||||||
|
metaDescription = json['meta_description'];
|
||||||
|
metaTitle = json['meta_title'];
|
||||||
|
allowCustomerReviews = json['allow_customer_reviews'];
|
||||||
|
approvedRatingSum = json['approved_rating_sum'];
|
||||||
|
notApprovedRatingSum = json['not_approved_rating_sum'];
|
||||||
|
approvedTotalReviews = json['approved_total_reviews'];
|
||||||
|
notApprovedTotalReviews = json['not_approved_total_reviews'];
|
||||||
|
sku = json['sku'];
|
||||||
|
isRx = json['is_rx'];
|
||||||
|
prescriptionRequired = json['prescription_required'];
|
||||||
|
rxMessage = json['rx_message'];
|
||||||
|
rxMessagen = json['rx_messagen'];
|
||||||
|
manufacturerPartNumber = json['manufacturer_part_number'];
|
||||||
|
gtin = json['gtin'];
|
||||||
|
isGiftCard = json['is_gift_card'];
|
||||||
|
requireOtherProducts = json['require_other_products'];
|
||||||
|
automaticallyAddRequiredProducts =
|
||||||
|
json['automatically_add_required_products'];
|
||||||
|
isDownload = json['is_download'];
|
||||||
|
unlimitedDownloads = json['unlimited_downloads'];
|
||||||
|
maxNumberOfDownloads = json['max_number_of_downloads'];
|
||||||
|
downloadExpirationDays = json['download_expiration_days'];
|
||||||
|
hasSampleDownload = json['has_sample_download'];
|
||||||
|
hasUserAgreement = json['has_user_agreement'];
|
||||||
|
isRecurring = json['is_recurring'];
|
||||||
|
recurringCycleLength = json['recurring_cycle_length'];
|
||||||
|
recurringTotalCycles = json['recurring_total_cycles'];
|
||||||
|
isRental = json['is_rental'];
|
||||||
|
rentalPriceLength = json['rental_price_length'];
|
||||||
|
isShipEnabled = json['is_ship_enabled'];
|
||||||
|
isFreeShipping = json['is_free_shipping'];
|
||||||
|
shipSeparately = json['ship_separately'];
|
||||||
|
additionalShippingCharge = json['additional_shipping_charge'];
|
||||||
|
isTaxExempt = json['is_tax_exempt'];
|
||||||
|
isTelecommunicationsOrBroadcastingOrElectronicServices =
|
||||||
|
json['is_telecommunications_or_broadcasting_or_electronic_services'];
|
||||||
|
useMultipleWarehouses = json['use_multiple_warehouses'];
|
||||||
|
manageInventoryMethodId = json['manage_inventory_method_id'];
|
||||||
|
stockQuantity = json['stock_quantity'];
|
||||||
|
stockAvailability = json['stock_availability'];
|
||||||
|
stockAvailabilityn = json['stock_availabilityn'];
|
||||||
|
displayStockAvailability = json['display_stock_availability'];
|
||||||
|
displayStockQuantity = json['display_stock_quantity'];
|
||||||
|
minStockQuantity = json['min_stock_quantity'];
|
||||||
|
notifyAdminForQuantityBelow = json['notify_admin_for_quantity_below'];
|
||||||
|
allowBackInStockSubscriptions = json['allow_back_in_stock_subscriptions'];
|
||||||
|
orderMinimumQuantity = json['order_minimum_quantity'];
|
||||||
|
orderMaximumQuantity = json['order_maximum_quantity'];
|
||||||
|
allowedQuantities = json['allowed_quantities'];
|
||||||
|
allowAddingOnlyExistingAttributeCombinations =
|
||||||
|
json['allow_adding_only_existing_attribute_combinations'];
|
||||||
|
disableBuyButton = json['disable_buy_button'];
|
||||||
|
disableWishlistButton = json['disable_wishlist_button'];
|
||||||
|
availableForPreOrder = json['available_for_pre_order'];
|
||||||
|
preOrderAvailabilityStartDateTimeUtc =
|
||||||
|
json['pre_order_availability_start_date_time_utc'];
|
||||||
|
callForPrice = json['call_for_price'];
|
||||||
|
price = json['price'];
|
||||||
|
oldPrice = json['old_price'];
|
||||||
|
productCost = json['product_cost'];
|
||||||
|
specialPrice = json['special_price'];
|
||||||
|
specialPriceStartDateTimeUtc = json['special_price_start_date_time_utc'];
|
||||||
|
specialPriceEndDateTimeUtc = json['special_price_end_date_time_utc'];
|
||||||
|
customerEntersPrice = json['customer_enters_price'];
|
||||||
|
minimumCustomerEnteredPrice = json['minimum_customer_entered_price'];
|
||||||
|
maximumCustomerEnteredPrice = json['maximum_customer_entered_price'];
|
||||||
|
basepriceEnabled = json['baseprice_enabled'];
|
||||||
|
basepriceAmount = json['baseprice_amount'];
|
||||||
|
basepriceBaseAmount = json['baseprice_base_amount'];
|
||||||
|
hasTierPrices = json['has_tier_prices'];
|
||||||
|
hasDiscountsApplied = json['has_discounts_applied'];
|
||||||
|
discountName = json['discount_name'];
|
||||||
|
discountNamen = json['discount_namen'];
|
||||||
|
discountDescription = json['discount_description'];
|
||||||
|
discountDescriptionn = json['discount_Descriptionn'];
|
||||||
|
discountPercentage = json['discount_percentage'];
|
||||||
|
currency = json['currency'];
|
||||||
|
currencyn = json['currencyn'];
|
||||||
|
weight = json['weight'];
|
||||||
|
length = json['length'];
|
||||||
|
width = json['width'];
|
||||||
|
height = json['height'];
|
||||||
|
availableStartDateTimeUtc = json['available_start_date_time_utc'];
|
||||||
|
availableEndDateTimeUtc = json['available_end_date_time_utc'];
|
||||||
|
displayOrder = json['display_order'];
|
||||||
|
published = json['published'];
|
||||||
|
deleted = json['deleted'];
|
||||||
|
createdOnUtc = json['created_on_utc'];
|
||||||
|
updatedOnUtc = json['updated_on_utc'];
|
||||||
|
productType = json['product_type'];
|
||||||
|
parentGroupedProductId = json['parent_grouped_product_id'];
|
||||||
|
|
||||||
|
discountIds = json['discount_ids'].cast<int>();
|
||||||
|
|
||||||
|
if (json['images'] != null) {
|
||||||
|
images = new List<Images>();
|
||||||
|
json['images'].forEach((v) {
|
||||||
|
images.add(new Images.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
vendorId = json['vendor_id'];
|
||||||
|
seName = json['se_name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['visible_individually'] = this.visibleIndividually;
|
||||||
|
data['name'] = this.name;
|
||||||
|
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_descriptionn'] = this.shortDescriptionn;
|
||||||
|
data['full_description'] = this.fullDescription;
|
||||||
|
data['full_descriptionn'] = this.fullDescriptionn;
|
||||||
|
data['markas_new'] = this.markasNew;
|
||||||
|
data['show_on_home_page'] = this.showOnHomePage;
|
||||||
|
data['meta_keywords'] = this.metaKeywords;
|
||||||
|
data['meta_description'] = this.metaDescription;
|
||||||
|
data['meta_title'] = this.metaTitle;
|
||||||
|
data['allow_customer_reviews'] = this.allowCustomerReviews;
|
||||||
|
data['approved_rating_sum'] = this.approvedRatingSum;
|
||||||
|
data['not_approved_rating_sum'] = this.notApprovedRatingSum;
|
||||||
|
data['approved_total_reviews'] = this.approvedTotalReviews;
|
||||||
|
data['not_approved_total_reviews'] = this.notApprovedTotalReviews;
|
||||||
|
data['sku'] = this.sku;
|
||||||
|
data['is_rx'] = this.isRx;
|
||||||
|
data['prescription_required'] = this.prescriptionRequired;
|
||||||
|
data['rx_message'] = this.rxMessage;
|
||||||
|
data['rx_messagen'] = this.rxMessagen;
|
||||||
|
data['manufacturer_part_number'] = this.manufacturerPartNumber;
|
||||||
|
data['gtin'] = this.gtin;
|
||||||
|
data['is_gift_card'] = this.isGiftCard;
|
||||||
|
data['require_other_products'] = this.requireOtherProducts;
|
||||||
|
data['automatically_add_required_products'] =
|
||||||
|
this.automaticallyAddRequiredProducts;
|
||||||
|
data['is_download'] = this.isDownload;
|
||||||
|
data['unlimited_downloads'] = this.unlimitedDownloads;
|
||||||
|
data['max_number_of_downloads'] = this.maxNumberOfDownloads;
|
||||||
|
data['download_expiration_days'] = this.downloadExpirationDays;
|
||||||
|
data['has_sample_download'] = this.hasSampleDownload;
|
||||||
|
data['has_user_agreement'] = this.hasUserAgreement;
|
||||||
|
data['is_recurring'] = this.isRecurring;
|
||||||
|
data['recurring_cycle_length'] = this.recurringCycleLength;
|
||||||
|
data['recurring_total_cycles'] = this.recurringTotalCycles;
|
||||||
|
data['is_rental'] = this.isRental;
|
||||||
|
data['rental_price_length'] = this.rentalPriceLength;
|
||||||
|
data['is_ship_enabled'] = this.isShipEnabled;
|
||||||
|
data['is_free_shipping'] = this.isFreeShipping;
|
||||||
|
data['ship_separately'] = this.shipSeparately;
|
||||||
|
data['additional_shipping_charge'] = this.additionalShippingCharge;
|
||||||
|
data['is_tax_exempt'] = this.isTaxExempt;
|
||||||
|
data['is_telecommunications_or_broadcasting_or_electronic_services'] =
|
||||||
|
this.isTelecommunicationsOrBroadcastingOrElectronicServices;
|
||||||
|
data['use_multiple_warehouses'] = this.useMultipleWarehouses;
|
||||||
|
data['manage_inventory_method_id'] = this.manageInventoryMethodId;
|
||||||
|
data['stock_quantity'] = this.stockQuantity;
|
||||||
|
data['stock_availability'] = this.stockAvailability;
|
||||||
|
data['stock_availabilityn'] = this.stockAvailabilityn;
|
||||||
|
data['display_stock_availability'] = this.displayStockAvailability;
|
||||||
|
data['display_stock_quantity'] = this.displayStockQuantity;
|
||||||
|
data['min_stock_quantity'] = this.minStockQuantity;
|
||||||
|
data['notify_admin_for_quantity_below'] = this.notifyAdminForQuantityBelow;
|
||||||
|
data['allow_back_in_stock_subscriptions'] =
|
||||||
|
this.allowBackInStockSubscriptions;
|
||||||
|
data['order_minimum_quantity'] = this.orderMinimumQuantity;
|
||||||
|
data['order_maximum_quantity'] = this.orderMaximumQuantity;
|
||||||
|
data['allowed_quantities'] = this.allowedQuantities;
|
||||||
|
data['allow_adding_only_existing_attribute_combinations'] =
|
||||||
|
this.allowAddingOnlyExistingAttributeCombinations;
|
||||||
|
data['disable_buy_button'] = this.disableBuyButton;
|
||||||
|
data['disable_wishlist_button'] = this.disableWishlistButton;
|
||||||
|
data['available_for_pre_order'] = this.availableForPreOrder;
|
||||||
|
data['pre_order_availability_start_date_time_utc'] =
|
||||||
|
this.preOrderAvailabilityStartDateTimeUtc;
|
||||||
|
data['call_for_price'] = this.callForPrice;
|
||||||
|
data['price'] = this.price;
|
||||||
|
data['old_price'] = this.oldPrice;
|
||||||
|
data['product_cost'] = this.productCost;
|
||||||
|
data['special_price'] = this.specialPrice;
|
||||||
|
data['special_price_start_date_time_utc'] =
|
||||||
|
this.specialPriceStartDateTimeUtc;
|
||||||
|
data['special_price_end_date_time_utc'] = this.specialPriceEndDateTimeUtc;
|
||||||
|
data['customer_enters_price'] = this.customerEntersPrice;
|
||||||
|
data['minimum_customer_entered_price'] = this.minimumCustomerEnteredPrice;
|
||||||
|
data['maximum_customer_entered_price'] = this.maximumCustomerEnteredPrice;
|
||||||
|
data['baseprice_enabled'] = this.basepriceEnabled;
|
||||||
|
data['baseprice_amount'] = this.basepriceAmount;
|
||||||
|
data['baseprice_base_amount'] = this.basepriceBaseAmount;
|
||||||
|
data['has_tier_prices'] = this.hasTierPrices;
|
||||||
|
data['has_discounts_applied'] = this.hasDiscountsApplied;
|
||||||
|
data['discount_name'] = this.discountName;
|
||||||
|
data['discount_namen'] = this.discountNamen;
|
||||||
|
data['discount_description'] = this.discountDescription;
|
||||||
|
data['discount_Descriptionn'] = this.discountDescriptionn;
|
||||||
|
data['discount_percentage'] = this.discountPercentage;
|
||||||
|
data['currency'] = this.currency;
|
||||||
|
data['currencyn'] = this.currencyn;
|
||||||
|
data['weight'] = this.weight;
|
||||||
|
data['length'] = this.length;
|
||||||
|
data['width'] = this.width;
|
||||||
|
data['height'] = this.height;
|
||||||
|
data['available_start_date_time_utc'] = this.availableStartDateTimeUtc;
|
||||||
|
data['available_end_date_time_utc'] = this.availableEndDateTimeUtc;
|
||||||
|
data['display_order'] = this.displayOrder;
|
||||||
|
data['published'] = this.published;
|
||||||
|
data['deleted'] = this.deleted;
|
||||||
|
data['created_on_utc'] = this.createdOnUtc;
|
||||||
|
data['updated_on_utc'] = this.updatedOnUtc;
|
||||||
|
data['product_type'] = this.productType;
|
||||||
|
data['parent_grouped_product_id'] = this.parentGroupedProductId;
|
||||||
|
if (this.roleIds != null) {
|
||||||
|
data['role_ids'] = this.roleIds.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['discount_ids'] = this.discountIds;
|
||||||
|
if (this.storeIds != null) {
|
||||||
|
data['store_ids'] = this.storeIds.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
if (this.manufacturerIds != null) {
|
||||||
|
data['manufacturer_ids'] =
|
||||||
|
this.manufacturerIds.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
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.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;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Images {
|
||||||
|
int id;
|
||||||
|
int position;
|
||||||
|
String src;
|
||||||
|
String thumb;
|
||||||
|
String attachment;
|
||||||
|
|
||||||
|
Images({this.id, this.position, this.src, this.thumb, this.attachment});
|
||||||
|
|
||||||
|
Images.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
position = json['position'];
|
||||||
|
src = json['src'];
|
||||||
|
thumb = json['thumb'];
|
||||||
|
attachment = json['attachment'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['position'] = this.position;
|
||||||
|
data['src'] = this.src;
|
||||||
|
data['thumb'] = this.thumb;
|
||||||
|
data['attachment'] = this.attachment;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,175 @@
|
|||||||
|
class OffersModel {
|
||||||
|
String id;
|
||||||
|
String name;
|
||||||
|
String namen;
|
||||||
|
List<LocalizedNames> localizedNames;
|
||||||
|
Null description;
|
||||||
|
int categoryTemplateId;
|
||||||
|
String metaKeywords;
|
||||||
|
String metaDescription;
|
||||||
|
String metaTitle;
|
||||||
|
int parentCategoryId;
|
||||||
|
int pageSize;
|
||||||
|
String pageSizeOptions;
|
||||||
|
Null priceRanges;
|
||||||
|
bool showOnHomePage;
|
||||||
|
bool includeInTopMenu;
|
||||||
|
Null hasDiscountsApplied;
|
||||||
|
bool published;
|
||||||
|
bool deleted;
|
||||||
|
int displayOrder;
|
||||||
|
String createdOnUtc;
|
||||||
|
String updatedOnUtc;
|
||||||
|
List<dynamic> roleIds;
|
||||||
|
List<dynamic> discountIds;
|
||||||
|
List<dynamic> storeIds;
|
||||||
|
Image image;
|
||||||
|
String seName;
|
||||||
|
bool isLeaf;
|
||||||
|
|
||||||
|
OffersModel(
|
||||||
|
{this.id,
|
||||||
|
this.name,
|
||||||
|
this.namen,
|
||||||
|
this.localizedNames,
|
||||||
|
this.description,
|
||||||
|
this.categoryTemplateId,
|
||||||
|
this.metaKeywords,
|
||||||
|
this.metaDescription,
|
||||||
|
this.metaTitle,
|
||||||
|
this.parentCategoryId,
|
||||||
|
this.pageSize,
|
||||||
|
this.pageSizeOptions,
|
||||||
|
this.priceRanges,
|
||||||
|
this.showOnHomePage,
|
||||||
|
this.includeInTopMenu,
|
||||||
|
this.hasDiscountsApplied,
|
||||||
|
this.published,
|
||||||
|
this.deleted,
|
||||||
|
this.displayOrder,
|
||||||
|
this.createdOnUtc,
|
||||||
|
this.updatedOnUtc,
|
||||||
|
this.roleIds,
|
||||||
|
this.discountIds,
|
||||||
|
this.storeIds,
|
||||||
|
this.image,
|
||||||
|
this.seName,
|
||||||
|
this.isLeaf});
|
||||||
|
|
||||||
|
OffersModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
name = json['name'];
|
||||||
|
namen = json['namen'];
|
||||||
|
if (json['localized_names'] != null) {
|
||||||
|
localizedNames = new List<LocalizedNames>();
|
||||||
|
json['localized_names'].forEach((v) {
|
||||||
|
localizedNames.add(new LocalizedNames.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
description = json['description'];
|
||||||
|
categoryTemplateId = json['category_template_id'];
|
||||||
|
metaKeywords = json['meta_keywords'];
|
||||||
|
metaDescription = json['meta_description'];
|
||||||
|
metaTitle = json['meta_title'];
|
||||||
|
parentCategoryId = json['parent_category_id'];
|
||||||
|
pageSize = json['page_size'];
|
||||||
|
pageSizeOptions = json['page_size_options'];
|
||||||
|
priceRanges = json['price_ranges'];
|
||||||
|
showOnHomePage = json['show_on_home_page'];
|
||||||
|
includeInTopMenu = json['include_in_top_menu'];
|
||||||
|
hasDiscountsApplied = json['has_discounts_applied'];
|
||||||
|
published = json['published'];
|
||||||
|
deleted = json['deleted'];
|
||||||
|
displayOrder = json['display_order'];
|
||||||
|
createdOnUtc = json['created_on_utc'];
|
||||||
|
updatedOnUtc = json['updated_on_utc'];
|
||||||
|
|
||||||
|
image = json['image'] != null ? new Image.fromJson(json['image']) : null;
|
||||||
|
seName = json['se_name'];
|
||||||
|
isLeaf = json['is_leaf'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['name'] = this.name;
|
||||||
|
data['namen'] = this.namen;
|
||||||
|
if (this.localizedNames != null) {
|
||||||
|
data['localized_names'] =
|
||||||
|
this.localizedNames.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['description'] = this.description;
|
||||||
|
data['category_template_id'] = this.categoryTemplateId;
|
||||||
|
data['meta_keywords'] = this.metaKeywords;
|
||||||
|
data['meta_description'] = this.metaDescription;
|
||||||
|
data['meta_title'] = this.metaTitle;
|
||||||
|
data['parent_category_id'] = this.parentCategoryId;
|
||||||
|
data['page_size'] = this.pageSize;
|
||||||
|
data['page_size_options'] = this.pageSizeOptions;
|
||||||
|
data['price_ranges'] = this.priceRanges;
|
||||||
|
data['show_on_home_page'] = this.showOnHomePage;
|
||||||
|
data['include_in_top_menu'] = this.includeInTopMenu;
|
||||||
|
data['has_discounts_applied'] = this.hasDiscountsApplied;
|
||||||
|
data['published'] = this.published;
|
||||||
|
data['deleted'] = this.deleted;
|
||||||
|
data['display_order'] = this.displayOrder;
|
||||||
|
data['created_on_utc'] = this.createdOnUtc;
|
||||||
|
data['updated_on_utc'] = this.updatedOnUtc;
|
||||||
|
if (this.roleIds != null) {
|
||||||
|
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();
|
||||||
|
}
|
||||||
|
if (this.image != null) {
|
||||||
|
data['image'] = this.image.toJson();
|
||||||
|
}
|
||||||
|
data['se_name'] = this.seName;
|
||||||
|
data['is_leaf'] = this.isLeaf;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Image {
|
||||||
|
String src;
|
||||||
|
Null thumb;
|
||||||
|
Null attachment;
|
||||||
|
|
||||||
|
Image({this.src, this.thumb, this.attachment});
|
||||||
|
|
||||||
|
Image.fromJson(Map<String, dynamic> json) {
|
||||||
|
src = json['src'];
|
||||||
|
thumb = json['thumb'];
|
||||||
|
attachment = json['attachment'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['src'] = this.src;
|
||||||
|
data['thumb'] = this.thumb;
|
||||||
|
data['attachment'] = this.attachment;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,566 @@
|
|||||||
|
class ParentProductsModel {
|
||||||
|
dynamic id;
|
||||||
|
dynamic visibleIndividually;
|
||||||
|
dynamic name;
|
||||||
|
dynamic namen;
|
||||||
|
List<LocalizedNames> localizedNames;
|
||||||
|
dynamic shortDescription;
|
||||||
|
dynamic shortDescriptionn;
|
||||||
|
dynamic fullDescription;
|
||||||
|
dynamic fullDescriptionn;
|
||||||
|
dynamic markasNew;
|
||||||
|
dynamic showOnHomePage;
|
||||||
|
dynamic metaKeywords;
|
||||||
|
dynamic metaDescription;
|
||||||
|
dynamic metaTitle;
|
||||||
|
dynamic allowCustomerReviews;
|
||||||
|
dynamic approvedRatingSum;
|
||||||
|
dynamic notApprovedRatingSum;
|
||||||
|
dynamic approvedTotalReviews;
|
||||||
|
dynamic notApprovedTotalReviews;
|
||||||
|
dynamic sku;
|
||||||
|
dynamic isRx;
|
||||||
|
dynamic prescriptionRequired;
|
||||||
|
dynamic rxMessage;
|
||||||
|
dynamic rxMessagen;
|
||||||
|
dynamic manufacturerPartNumber;
|
||||||
|
dynamic gtin;
|
||||||
|
dynamic isGiftCard;
|
||||||
|
dynamic requireOtherProducts;
|
||||||
|
dynamic automaticallyAddRequiredProducts;
|
||||||
|
dynamic isDownload;
|
||||||
|
dynamic unlimitedDownloads;
|
||||||
|
dynamic maxNumberOfDownloads;
|
||||||
|
dynamic downloadExpirationDays;
|
||||||
|
dynamic hasSampleDownload;
|
||||||
|
dynamic hasUserAgreement;
|
||||||
|
dynamic isRecurring;
|
||||||
|
dynamic recurringCycleLength;
|
||||||
|
dynamic recurringTotalCycles;
|
||||||
|
dynamic isRental;
|
||||||
|
dynamic rentalPriceLength;
|
||||||
|
dynamic isShipEnabled;
|
||||||
|
dynamic isFreeShipping;
|
||||||
|
dynamic shipSeparately;
|
||||||
|
dynamic additionalShippingCharge;
|
||||||
|
dynamic isTaxExempt;
|
||||||
|
dynamic isTelecommunicationsOrBroadcastingOrElectronicServices;
|
||||||
|
dynamic useMultipleWarehouses;
|
||||||
|
dynamic manageInventoryMethodId;
|
||||||
|
dynamic stockQuantity;
|
||||||
|
dynamic stockAvailability;
|
||||||
|
dynamic stockAvailabilityn;
|
||||||
|
dynamic displayStockAvailability;
|
||||||
|
dynamic displayStockQuantity;
|
||||||
|
dynamic minStockQuantity;
|
||||||
|
dynamic notifyAdminForQuantityBelow;
|
||||||
|
dynamic allowBackInStockSubscriptions;
|
||||||
|
dynamic orderMinimumQuantity;
|
||||||
|
dynamic orderMaximumQuantity;
|
||||||
|
dynamic allowedQuantities;
|
||||||
|
dynamic allowAddingOnlyExistingAttributeCombinations;
|
||||||
|
dynamic disableBuyButton;
|
||||||
|
dynamic disableWishlistButton;
|
||||||
|
dynamic availableForPreOrder;
|
||||||
|
dynamic preOrderAvailabilityStartDateTimeUtc;
|
||||||
|
dynamic callForPrice;
|
||||||
|
dynamic price;
|
||||||
|
dynamic oldPrice;
|
||||||
|
dynamic productCost;
|
||||||
|
dynamic specialPrice;
|
||||||
|
dynamic specialPriceStartDateTimeUtc;
|
||||||
|
dynamic specialPriceEndDateTimeUtc;
|
||||||
|
dynamic customerEntersPrice;
|
||||||
|
dynamic minimumCustomerEnteredPrice;
|
||||||
|
dynamic maximumCustomerEnteredPrice;
|
||||||
|
dynamic basepriceEnabled;
|
||||||
|
dynamic basepriceAmount;
|
||||||
|
dynamic basepriceBaseAmount;
|
||||||
|
dynamic hasTierPrices;
|
||||||
|
dynamic hasDiscountsApplied;
|
||||||
|
dynamic discountName;
|
||||||
|
dynamic discountNamen;
|
||||||
|
dynamic discountDescription;
|
||||||
|
dynamic discountDescriptionn;
|
||||||
|
dynamic discountPercentage;
|
||||||
|
dynamic currency;
|
||||||
|
dynamic currencyn;
|
||||||
|
dynamic weight;
|
||||||
|
dynamic length;
|
||||||
|
dynamic width;
|
||||||
|
dynamic height;
|
||||||
|
dynamic availableStartDateTimeUtc;
|
||||||
|
dynamic availableEndDateTimeUtc;
|
||||||
|
dynamic displayOrder;
|
||||||
|
dynamic published;
|
||||||
|
dynamic deleted;
|
||||||
|
dynamic createdOnUtc;
|
||||||
|
dynamic updatedOnUtc;
|
||||||
|
dynamic productType;
|
||||||
|
dynamic parentGroupedProductId;
|
||||||
|
List<dynamic> roleIds;
|
||||||
|
List<dynamic> discountIds;
|
||||||
|
List<dynamic> storeIds;
|
||||||
|
List<dynamic> manufacturerIds;
|
||||||
|
List<dynamic> reviews;
|
||||||
|
List<Images> images;
|
||||||
|
List<dynamic> attributes;
|
||||||
|
List<Specifications> specifications;
|
||||||
|
List<dynamic> associatedProductIds;
|
||||||
|
List<dynamic> tags;
|
||||||
|
dynamic vendorId;
|
||||||
|
String seName;
|
||||||
|
|
||||||
|
ParentProductsModel(
|
||||||
|
{this.id,
|
||||||
|
this.visibleIndividually,
|
||||||
|
this.name,
|
||||||
|
this.namen,
|
||||||
|
this.localizedNames,
|
||||||
|
this.shortDescription,
|
||||||
|
this.shortDescriptionn,
|
||||||
|
this.fullDescription,
|
||||||
|
this.fullDescriptionn,
|
||||||
|
this.markasNew,
|
||||||
|
this.showOnHomePage,
|
||||||
|
this.metaKeywords,
|
||||||
|
this.metaDescription,
|
||||||
|
this.metaTitle,
|
||||||
|
this.allowCustomerReviews,
|
||||||
|
this.approvedRatingSum,
|
||||||
|
this.notApprovedRatingSum,
|
||||||
|
this.approvedTotalReviews,
|
||||||
|
this.notApprovedTotalReviews,
|
||||||
|
this.sku,
|
||||||
|
this.isRx,
|
||||||
|
this.prescriptionRequired,
|
||||||
|
this.rxMessage,
|
||||||
|
this.rxMessagen,
|
||||||
|
this.manufacturerPartNumber,
|
||||||
|
this.gtin,
|
||||||
|
this.isGiftCard,
|
||||||
|
this.requireOtherProducts,
|
||||||
|
this.automaticallyAddRequiredProducts,
|
||||||
|
this.isDownload,
|
||||||
|
this.unlimitedDownloads,
|
||||||
|
this.maxNumberOfDownloads,
|
||||||
|
this.downloadExpirationDays,
|
||||||
|
this.hasSampleDownload,
|
||||||
|
this.hasUserAgreement,
|
||||||
|
this.isRecurring,
|
||||||
|
this.recurringCycleLength,
|
||||||
|
this.recurringTotalCycles,
|
||||||
|
this.isRental,
|
||||||
|
this.rentalPriceLength,
|
||||||
|
this.isShipEnabled,
|
||||||
|
this.isFreeShipping,
|
||||||
|
this.shipSeparately,
|
||||||
|
this.additionalShippingCharge,
|
||||||
|
this.isTaxExempt,
|
||||||
|
this.isTelecommunicationsOrBroadcastingOrElectronicServices,
|
||||||
|
this.useMultipleWarehouses,
|
||||||
|
this.manageInventoryMethodId,
|
||||||
|
this.stockQuantity,
|
||||||
|
this.stockAvailability,
|
||||||
|
this.stockAvailabilityn,
|
||||||
|
this.displayStockAvailability,
|
||||||
|
this.displayStockQuantity,
|
||||||
|
this.minStockQuantity,
|
||||||
|
this.notifyAdminForQuantityBelow,
|
||||||
|
this.allowBackInStockSubscriptions,
|
||||||
|
this.orderMinimumQuantity,
|
||||||
|
this.orderMaximumQuantity,
|
||||||
|
this.allowedQuantities,
|
||||||
|
this.allowAddingOnlyExistingAttributeCombinations,
|
||||||
|
this.disableBuyButton,
|
||||||
|
this.disableWishlistButton,
|
||||||
|
this.availableForPreOrder,
|
||||||
|
this.preOrderAvailabilityStartDateTimeUtc,
|
||||||
|
this.callForPrice,
|
||||||
|
this.price,
|
||||||
|
this.oldPrice,
|
||||||
|
this.productCost,
|
||||||
|
this.specialPrice,
|
||||||
|
this.specialPriceStartDateTimeUtc,
|
||||||
|
this.specialPriceEndDateTimeUtc,
|
||||||
|
this.customerEntersPrice,
|
||||||
|
this.minimumCustomerEnteredPrice,
|
||||||
|
this.maximumCustomerEnteredPrice,
|
||||||
|
this.basepriceEnabled,
|
||||||
|
this.basepriceAmount,
|
||||||
|
this.basepriceBaseAmount,
|
||||||
|
this.hasTierPrices,
|
||||||
|
this.hasDiscountsApplied,
|
||||||
|
this.discountName,
|
||||||
|
this.discountNamen,
|
||||||
|
this.discountDescription,
|
||||||
|
this.discountDescriptionn,
|
||||||
|
this.discountPercentage,
|
||||||
|
this.currency,
|
||||||
|
this.currencyn,
|
||||||
|
this.weight,
|
||||||
|
this.length,
|
||||||
|
this.width,
|
||||||
|
this.height,
|
||||||
|
this.availableStartDateTimeUtc,
|
||||||
|
this.availableEndDateTimeUtc,
|
||||||
|
this.displayOrder,
|
||||||
|
this.published,
|
||||||
|
this.deleted,
|
||||||
|
this.createdOnUtc,
|
||||||
|
this.updatedOnUtc,
|
||||||
|
this.productType,
|
||||||
|
this.parentGroupedProductId,
|
||||||
|
this.roleIds,
|
||||||
|
this.discountIds,
|
||||||
|
this.storeIds,
|
||||||
|
this.manufacturerIds,
|
||||||
|
this.reviews,
|
||||||
|
this.images,
|
||||||
|
this.attributes,
|
||||||
|
this.specifications,
|
||||||
|
this.associatedProductIds,
|
||||||
|
this.tags,
|
||||||
|
this.vendorId,
|
||||||
|
this.seName});
|
||||||
|
|
||||||
|
ParentProductsModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
visibleIndividually = json['visible_individually'];
|
||||||
|
name = json['name'];
|
||||||
|
if (json['images'] != null) {
|
||||||
|
images = new List<Images>();
|
||||||
|
json['images'].forEach((v) {
|
||||||
|
images.add(new Images.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
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'];
|
||||||
|
shortDescriptionn = json['short_descriptionn'];
|
||||||
|
fullDescription = json['full_description'];
|
||||||
|
fullDescriptionn = json['full_descriptionn'];
|
||||||
|
markasNew = json['markas_new'];
|
||||||
|
showOnHomePage = json['show_on_home_page'];
|
||||||
|
metaKeywords = json['meta_keywords'];
|
||||||
|
metaDescription = json['meta_description'];
|
||||||
|
metaTitle = json['meta_title'];
|
||||||
|
allowCustomerReviews = json['allow_customer_reviews'];
|
||||||
|
approvedRatingSum = json['approved_rating_sum'];
|
||||||
|
notApprovedRatingSum = json['not_approved_rating_sum'];
|
||||||
|
approvedTotalReviews = json['approved_total_reviews'];
|
||||||
|
notApprovedTotalReviews = json['not_approved_total_reviews'];
|
||||||
|
sku = json['sku'];
|
||||||
|
isRx = json['is_rx'];
|
||||||
|
prescriptionRequired = json['prescription_required'];
|
||||||
|
rxMessage = json['rx_message'];
|
||||||
|
rxMessagen = json['rx_messagen'];
|
||||||
|
manufacturerPartNumber = json['manufacturer_part_number'];
|
||||||
|
gtin = json['gtin'];
|
||||||
|
isGiftCard = json['is_gift_card'];
|
||||||
|
requireOtherProducts = json['require_other_products'];
|
||||||
|
automaticallyAddRequiredProducts =
|
||||||
|
json['automatically_add_required_products'];
|
||||||
|
isDownload = json['is_download'];
|
||||||
|
unlimitedDownloads = json['unlimited_downloads'];
|
||||||
|
maxNumberOfDownloads = json['max_number_of_downloads'];
|
||||||
|
downloadExpirationDays = json['download_expiration_days'];
|
||||||
|
hasSampleDownload = json['has_sample_download'];
|
||||||
|
hasUserAgreement = json['has_user_agreement'];
|
||||||
|
isRecurring = json['is_recurring'];
|
||||||
|
recurringCycleLength = json['recurring_cycle_length'];
|
||||||
|
recurringTotalCycles = json['recurring_total_cycles'];
|
||||||
|
isRental = json['is_rental'];
|
||||||
|
rentalPriceLength = json['rental_price_length'];
|
||||||
|
isShipEnabled = json['is_ship_enabled'];
|
||||||
|
isFreeShipping = json['is_free_shipping'];
|
||||||
|
shipSeparately = json['ship_separately'];
|
||||||
|
additionalShippingCharge = json['additional_shipping_charge'];
|
||||||
|
isTaxExempt = json['is_tax_exempt'];
|
||||||
|
isTelecommunicationsOrBroadcastingOrElectronicServices =
|
||||||
|
json['is_telecommunications_or_broadcasting_or_electronic_services'];
|
||||||
|
useMultipleWarehouses = json['use_multiple_warehouses'];
|
||||||
|
manageInventoryMethodId = json['manage_inventory_method_id'];
|
||||||
|
stockQuantity = json['stock_quantity'];
|
||||||
|
stockAvailability = json['stock_availability'];
|
||||||
|
stockAvailabilityn = json['stock_availabilityn'];
|
||||||
|
displayStockAvailability = json['display_stock_availability'];
|
||||||
|
displayStockQuantity = json['display_stock_quantity'];
|
||||||
|
minStockQuantity = json['min_stock_quantity'];
|
||||||
|
notifyAdminForQuantityBelow = json['notify_admin_for_quantity_below'];
|
||||||
|
allowBackInStockSubscriptions = json['allow_back_in_stock_subscriptions'];
|
||||||
|
orderMinimumQuantity = json['order_minimum_quantity'];
|
||||||
|
orderMaximumQuantity = json['order_maximum_quantity'];
|
||||||
|
allowedQuantities = json['allowed_quantities'];
|
||||||
|
allowAddingOnlyExistingAttributeCombinations =
|
||||||
|
json['allow_adding_only_existing_attribute_combinations'];
|
||||||
|
disableBuyButton = json['disable_buy_button'];
|
||||||
|
disableWishlistButton = json['disable_wishlist_button'];
|
||||||
|
availableForPreOrder = json['available_for_pre_order'];
|
||||||
|
preOrderAvailabilityStartDateTimeUtc =
|
||||||
|
json['pre_order_availability_start_date_time_utc'];
|
||||||
|
callForPrice = json['call_for_price'];
|
||||||
|
price = json['price'];
|
||||||
|
oldPrice = json['old_price'];
|
||||||
|
productCost = json['product_cost'];
|
||||||
|
specialPrice = json['special_price'];
|
||||||
|
specialPriceStartDateTimeUtc = json['special_price_start_date_time_utc'];
|
||||||
|
specialPriceEndDateTimeUtc = json['special_price_end_date_time_utc'];
|
||||||
|
customerEntersPrice = json['customer_enters_price'];
|
||||||
|
minimumCustomerEnteredPrice = json['minimum_customer_entered_price'];
|
||||||
|
maximumCustomerEnteredPrice = json['maximum_customer_entered_price'];
|
||||||
|
basepriceEnabled = json['baseprice_enabled'];
|
||||||
|
basepriceAmount = json['baseprice_amount'];
|
||||||
|
basepriceBaseAmount = json['baseprice_base_amount'];
|
||||||
|
hasTierPrices = json['has_tier_prices'];
|
||||||
|
hasDiscountsApplied = json['has_discounts_applied'];
|
||||||
|
discountName = json['discount_name'];
|
||||||
|
discountNamen = json['discount_namen'];
|
||||||
|
discountDescription = json['discount_description'];
|
||||||
|
discountDescriptionn = json['discount_Descriptionn'];
|
||||||
|
discountPercentage = json['discount_percentage'];
|
||||||
|
currency = json['currency'];
|
||||||
|
currencyn = json['currencyn'];
|
||||||
|
weight = json['weight'];
|
||||||
|
length = json['length'];
|
||||||
|
width = json['width'];
|
||||||
|
height = json['height'];
|
||||||
|
availableStartDateTimeUtc = json['available_start_date_time_utc'];
|
||||||
|
availableEndDateTimeUtc = json['available_end_date_time_utc'];
|
||||||
|
displayOrder = json['display_order'];
|
||||||
|
published = json['published'];
|
||||||
|
deleted = json['deleted'];
|
||||||
|
createdOnUtc = json['created_on_utc'];
|
||||||
|
updatedOnUtc = json['updated_on_utc'];
|
||||||
|
productType = json['product_type'];
|
||||||
|
parentGroupedProductId = json['parent_grouped_product_id'];
|
||||||
|
|
||||||
|
manufacturerIds = json['manufacturer_ids'].cast<int>();
|
||||||
|
|
||||||
|
if (json['specifications'] != null) {
|
||||||
|
specifications = new List<Specifications>();
|
||||||
|
json['specifications'].forEach((v) {
|
||||||
|
specifications.add(new Specifications.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
vendorId = json['vendor_id'];
|
||||||
|
seName = json['se_name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['visible_individually'] = this.visibleIndividually;
|
||||||
|
data['name'] = this.name;
|
||||||
|
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_descriptionn'] = this.shortDescriptionn;
|
||||||
|
data['full_description'] = this.fullDescription;
|
||||||
|
data['full_descriptionn'] = this.fullDescriptionn;
|
||||||
|
data['markas_new'] = this.markasNew;
|
||||||
|
data['show_on_home_page'] = this.showOnHomePage;
|
||||||
|
data['meta_keywords'] = this.metaKeywords;
|
||||||
|
data['meta_description'] = this.metaDescription;
|
||||||
|
data['meta_title'] = this.metaTitle;
|
||||||
|
data['allow_customer_reviews'] = this.allowCustomerReviews;
|
||||||
|
data['approved_rating_sum'] = this.approvedRatingSum;
|
||||||
|
data['not_approved_rating_sum'] = this.notApprovedRatingSum;
|
||||||
|
data['approved_total_reviews'] = this.approvedTotalReviews;
|
||||||
|
data['not_approved_total_reviews'] = this.notApprovedTotalReviews;
|
||||||
|
data['sku'] = this.sku;
|
||||||
|
data['is_rx'] = this.isRx;
|
||||||
|
data['prescription_required'] = this.prescriptionRequired;
|
||||||
|
data['rx_message'] = this.rxMessage;
|
||||||
|
data['rx_messagen'] = this.rxMessagen;
|
||||||
|
data['manufacturer_part_number'] = this.manufacturerPartNumber;
|
||||||
|
data['gtin'] = this.gtin;
|
||||||
|
data['is_gift_card'] = this.isGiftCard;
|
||||||
|
data['require_other_products'] = this.requireOtherProducts;
|
||||||
|
data['automatically_add_required_products'] =
|
||||||
|
this.automaticallyAddRequiredProducts;
|
||||||
|
data['is_download'] = this.isDownload;
|
||||||
|
data['unlimited_downloads'] = this.unlimitedDownloads;
|
||||||
|
data['max_number_of_downloads'] = this.maxNumberOfDownloads;
|
||||||
|
data['download_expiration_days'] = this.downloadExpirationDays;
|
||||||
|
data['has_sample_download'] = this.hasSampleDownload;
|
||||||
|
data['has_user_agreement'] = this.hasUserAgreement;
|
||||||
|
data['is_recurring'] = this.isRecurring;
|
||||||
|
data['recurring_cycle_length'] = this.recurringCycleLength;
|
||||||
|
data['recurring_total_cycles'] = this.recurringTotalCycles;
|
||||||
|
data['is_rental'] = this.isRental;
|
||||||
|
data['rental_price_length'] = this.rentalPriceLength;
|
||||||
|
data['is_ship_enabled'] = this.isShipEnabled;
|
||||||
|
data['is_free_shipping'] = this.isFreeShipping;
|
||||||
|
data['ship_separately'] = this.shipSeparately;
|
||||||
|
data['additional_shipping_charge'] = this.additionalShippingCharge;
|
||||||
|
data['is_tax_exempt'] = this.isTaxExempt;
|
||||||
|
data['is_telecommunications_or_broadcasting_or_electronic_services'] =
|
||||||
|
this.isTelecommunicationsOrBroadcastingOrElectronicServices;
|
||||||
|
data['use_multiple_warehouses'] = this.useMultipleWarehouses;
|
||||||
|
data['manage_inventory_method_id'] = this.manageInventoryMethodId;
|
||||||
|
data['stock_quantity'] = this.stockQuantity;
|
||||||
|
data['stock_availability'] = this.stockAvailability;
|
||||||
|
data['stock_availabilityn'] = this.stockAvailabilityn;
|
||||||
|
data['display_stock_availability'] = this.displayStockAvailability;
|
||||||
|
data['display_stock_quantity'] = this.displayStockQuantity;
|
||||||
|
data['min_stock_quantity'] = this.minStockQuantity;
|
||||||
|
data['notify_admin_for_quantity_below'] = this.notifyAdminForQuantityBelow;
|
||||||
|
data['allow_back_in_stock_subscriptions'] =
|
||||||
|
this.allowBackInStockSubscriptions;
|
||||||
|
data['order_minimum_quantity'] = this.orderMinimumQuantity;
|
||||||
|
data['order_maximum_quantity'] = this.orderMaximumQuantity;
|
||||||
|
data['allowed_quantities'] = this.allowedQuantities;
|
||||||
|
data['allow_adding_only_existing_attribute_combinations'] =
|
||||||
|
this.allowAddingOnlyExistingAttributeCombinations;
|
||||||
|
data['disable_buy_button'] = this.disableBuyButton;
|
||||||
|
data['disable_wishlist_button'] = this.disableWishlistButton;
|
||||||
|
data['available_for_pre_order'] = this.availableForPreOrder;
|
||||||
|
data['pre_order_availability_start_date_time_utc'] =
|
||||||
|
this.preOrderAvailabilityStartDateTimeUtc;
|
||||||
|
data['call_for_price'] = this.callForPrice;
|
||||||
|
data['price'] = this.price;
|
||||||
|
data['old_price'] = this.oldPrice;
|
||||||
|
data['product_cost'] = this.productCost;
|
||||||
|
data['special_price'] = this.specialPrice;
|
||||||
|
data['special_price_start_date_time_utc'] =
|
||||||
|
this.specialPriceStartDateTimeUtc;
|
||||||
|
data['special_price_end_date_time_utc'] = this.specialPriceEndDateTimeUtc;
|
||||||
|
data['customer_enters_price'] = this.customerEntersPrice;
|
||||||
|
data['minimum_customer_entered_price'] = this.minimumCustomerEnteredPrice;
|
||||||
|
data['maximum_customer_entered_price'] = this.maximumCustomerEnteredPrice;
|
||||||
|
data['baseprice_enabled'] = this.basepriceEnabled;
|
||||||
|
data['baseprice_amount'] = this.basepriceAmount;
|
||||||
|
data['baseprice_base_amount'] = this.basepriceBaseAmount;
|
||||||
|
data['has_tier_prices'] = this.hasTierPrices;
|
||||||
|
data['has_discounts_applied'] = this.hasDiscountsApplied;
|
||||||
|
data['discount_name'] = this.discountName;
|
||||||
|
data['discount_namen'] = this.discountNamen;
|
||||||
|
data['discount_description'] = this.discountDescription;
|
||||||
|
data['discount_Descriptionn'] = this.discountDescriptionn;
|
||||||
|
data['discount_percentage'] = this.discountPercentage;
|
||||||
|
data['currency'] = this.currency;
|
||||||
|
data['currencyn'] = this.currencyn;
|
||||||
|
data['weight'] = this.weight;
|
||||||
|
data['length'] = this.length;
|
||||||
|
data['width'] = this.width;
|
||||||
|
data['height'] = this.height;
|
||||||
|
data['available_start_date_time_utc'] = this.availableStartDateTimeUtc;
|
||||||
|
data['available_end_date_time_utc'] = this.availableEndDateTimeUtc;
|
||||||
|
data['display_order'] = this.displayOrder;
|
||||||
|
data['published'] = this.published;
|
||||||
|
data['deleted'] = this.deleted;
|
||||||
|
data['created_on_utc'] = this.createdOnUtc;
|
||||||
|
data['updated_on_utc'] = this.updatedOnUtc;
|
||||||
|
data['product_type'] = this.productType;
|
||||||
|
data['parent_grouped_product_id'] = this.parentGroupedProductId;
|
||||||
|
|
||||||
|
data['manufacturer_ids'] = this.manufacturerIds;
|
||||||
|
|
||||||
|
if (this.images != null) {
|
||||||
|
data['images'] = this.images.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.specifications != null) {
|
||||||
|
data['specifications'] =
|
||||||
|
this.specifications.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
data['vendor_id'] = this.vendorId;
|
||||||
|
data['se_name'] = this.seName;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Images {
|
||||||
|
int id;
|
||||||
|
int position;
|
||||||
|
String src;
|
||||||
|
String thumb;
|
||||||
|
String attachment;
|
||||||
|
|
||||||
|
Images({this.id, this.position, this.src, this.thumb, this.attachment});
|
||||||
|
|
||||||
|
Images.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
position = json['position'];
|
||||||
|
src = json['src'];
|
||||||
|
thumb = json['thumb'];
|
||||||
|
attachment = json['attachment'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['position'] = this.position;
|
||||||
|
data['src'] = this.src;
|
||||||
|
data['thumb'] = this.thumb;
|
||||||
|
data['attachment'] = this.attachment;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,103 @@
|
|||||||
|
class PharmacyCategorise {
|
||||||
|
dynamic id;
|
||||||
|
String name;
|
||||||
|
dynamic namen;
|
||||||
|
List<LocalizedNames> localizedNames;
|
||||||
|
dynamic description;
|
||||||
|
dynamic parentCategoryId;
|
||||||
|
dynamic displayOrder;
|
||||||
|
dynamic image;
|
||||||
|
dynamic isLeaf;
|
||||||
|
|
||||||
|
PharmacyCategorise(
|
||||||
|
{this.id,
|
||||||
|
this.name,
|
||||||
|
this.namen,
|
||||||
|
this.localizedNames,
|
||||||
|
this.description,
|
||||||
|
this.parentCategoryId,
|
||||||
|
this.displayOrder,
|
||||||
|
this.image,
|
||||||
|
this.isLeaf});
|
||||||
|
|
||||||
|
PharmacyCategorise.fromJson(Map<String, dynamic> json) {
|
||||||
|
try {
|
||||||
|
id = json['id'];
|
||||||
|
name = json['name'];
|
||||||
|
namen = json['namen'];
|
||||||
|
if (json['localized_names'] != null) {
|
||||||
|
localizedNames = new List<LocalizedNames>();
|
||||||
|
json['localized_names'].forEach((v) {
|
||||||
|
localizedNames.add(new LocalizedNames.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
description = json['description'];
|
||||||
|
parentCategoryId = json['parent_category_id'];
|
||||||
|
displayOrder = json['display_order'];
|
||||||
|
image = json['image'] != null ? new Image.fromJson(json['image']) : null;
|
||||||
|
isLeaf = json['is_leaf'];
|
||||||
|
} catch (e) {
|
||||||
|
print(e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['name'] = this.name;
|
||||||
|
data['namen'] = this.namen;
|
||||||
|
if (this.localizedNames != null) {
|
||||||
|
data['localized_names'] =
|
||||||
|
this.localizedNames.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['description'] = this.description;
|
||||||
|
data['parent_category_id'] = this.parentCategoryId;
|
||||||
|
data['display_order'] = this.displayOrder;
|
||||||
|
if (this.image != null) {
|
||||||
|
data['image'] = this.image.toJson();
|
||||||
|
}
|
||||||
|
data['is_leaf'] = this.isLeaf;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Image {
|
||||||
|
String src;
|
||||||
|
Null thumb;
|
||||||
|
Null attachment;
|
||||||
|
|
||||||
|
Image({this.src, this.thumb, this.attachment});
|
||||||
|
|
||||||
|
Image.fromJson(Map<String, dynamic> json) {
|
||||||
|
src = json['src'];
|
||||||
|
thumb = json['thumb'];
|
||||||
|
attachment = json['attachment'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['src'] = this.src;
|
||||||
|
data['thumb'] = this.thumb;
|
||||||
|
data['attachment'] = this.attachment;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,584 @@
|
|||||||
|
class ScanQrModel {
|
||||||
|
String id;
|
||||||
|
bool visibleIndividually;
|
||||||
|
String name;
|
||||||
|
String namen;
|
||||||
|
List<LocalizedNames> localizedNames;
|
||||||
|
String shortDescription;
|
||||||
|
String shortDescriptionn;
|
||||||
|
String fullDescription;
|
||||||
|
String fullDescriptionn;
|
||||||
|
bool markasNew;
|
||||||
|
bool showOnHomePage;
|
||||||
|
dynamic metaKeywords;
|
||||||
|
dynamic metaDescription;
|
||||||
|
dynamic metaTitle;
|
||||||
|
bool allowCustomerReviews;
|
||||||
|
dynamic approvedRatingSum;
|
||||||
|
dynamic notApprovedRatingSum;
|
||||||
|
dynamic approvedTotalReviews;
|
||||||
|
dynamic notApprovedTotalReviews;
|
||||||
|
String sku;
|
||||||
|
bool isRx;
|
||||||
|
bool prescriptionRequired;
|
||||||
|
dynamic rxMessage;
|
||||||
|
dynamic rxMessagen;
|
||||||
|
dynamic manufacturerPartNumber;
|
||||||
|
dynamic gtin;
|
||||||
|
bool isGiftCard;
|
||||||
|
bool requireOtherProducts;
|
||||||
|
bool automaticallyAddRequiredProducts;
|
||||||
|
bool isDownload;
|
||||||
|
bool unlimitedDownloads;
|
||||||
|
dynamic maxNumberOfDownloads;
|
||||||
|
dynamic downloadExpirationDays;
|
||||||
|
bool hasSampleDownload;
|
||||||
|
bool hasUserAgreement;
|
||||||
|
bool isRecurring;
|
||||||
|
dynamic recurringCycleLength;
|
||||||
|
dynamic recurringTotalCycles;
|
||||||
|
bool isRental;
|
||||||
|
dynamic rentalPriceLength;
|
||||||
|
bool isShipEnabled;
|
||||||
|
bool isFreeShipping;
|
||||||
|
bool shipSeparately;
|
||||||
|
dynamic additionalShippingCharge;
|
||||||
|
bool isTaxExempt;
|
||||||
|
bool isTelecommunicationsOrBroadcastingOrElectronicServices;
|
||||||
|
bool useMultipleWarehouses;
|
||||||
|
dynamic manageInventoryMethodId;
|
||||||
|
dynamic stockQuantity;
|
||||||
|
String stockAvailability;
|
||||||
|
String stockAvailabilityn;
|
||||||
|
bool displayStockAvailability;
|
||||||
|
bool displayStockQuantity;
|
||||||
|
dynamic minStockQuantity;
|
||||||
|
dynamic notifyAdminForQuantityBelow;
|
||||||
|
bool allowBackInStockSubscriptions;
|
||||||
|
dynamic orderMinimumQuantity;
|
||||||
|
dynamic orderMaximumQuantity;
|
||||||
|
dynamic allowedQuantities;
|
||||||
|
bool allowAddingOnlyExistingAttributeCombinations;
|
||||||
|
bool disableBuyButton;
|
||||||
|
bool disableWishlistButton;
|
||||||
|
bool availableForPreOrder;
|
||||||
|
dynamic preOrderAvailabilityStartDateTimeUtc;
|
||||||
|
bool callForPrice;
|
||||||
|
dynamic price;
|
||||||
|
dynamic oldPrice;
|
||||||
|
dynamic productCost;
|
||||||
|
dynamic specialPrice;
|
||||||
|
dynamic specialPriceStartDateTimeUtc;
|
||||||
|
dynamic specialPriceEndDateTimeUtc;
|
||||||
|
bool customerEntersPrice;
|
||||||
|
dynamic minimumCustomerEnteredPrice;
|
||||||
|
dynamic maximumCustomerEnteredPrice;
|
||||||
|
bool basepriceEnabled;
|
||||||
|
dynamic basepriceAmount;
|
||||||
|
dynamic basepriceBaseAmount;
|
||||||
|
bool hasTierPrices;
|
||||||
|
bool hasDiscountsApplied;
|
||||||
|
dynamic discountName;
|
||||||
|
dynamic discountNamen;
|
||||||
|
dynamic discountDescription;
|
||||||
|
dynamic discountDescriptionn;
|
||||||
|
dynamic discountPercentage;
|
||||||
|
String currency;
|
||||||
|
String currencyn;
|
||||||
|
double weight;
|
||||||
|
dynamic length;
|
||||||
|
dynamic width;
|
||||||
|
dynamic height;
|
||||||
|
dynamic availableStartDateTimeUtc;
|
||||||
|
dynamic availableEndDateTimeUtc;
|
||||||
|
dynamic displayOrder;
|
||||||
|
bool published;
|
||||||
|
bool deleted;
|
||||||
|
String createdOnUtc;
|
||||||
|
String updatedOnUtc;
|
||||||
|
String productType;
|
||||||
|
dynamic parentGroupedProductId;
|
||||||
|
List<dynamic> roleIds;
|
||||||
|
List<dynamic> discountIds;
|
||||||
|
List<dynamic> storeIds;
|
||||||
|
List<dynamic> manufacturerIds;
|
||||||
|
List<dynamic> reviews;
|
||||||
|
List<Images> images;
|
||||||
|
List<dynamic> attributes;
|
||||||
|
List<Specifications> specifications;
|
||||||
|
List<dynamic> associatedProductIds;
|
||||||
|
List<dynamic> tags;
|
||||||
|
dynamic vendorId;
|
||||||
|
String seName;
|
||||||
|
|
||||||
|
ScanQrModel(
|
||||||
|
{this.id,
|
||||||
|
this.visibleIndividually,
|
||||||
|
this.name,
|
||||||
|
this.namen,
|
||||||
|
this.localizedNames,
|
||||||
|
this.shortDescription,
|
||||||
|
this.shortDescriptionn,
|
||||||
|
this.fullDescription,
|
||||||
|
this.fullDescriptionn,
|
||||||
|
this.markasNew,
|
||||||
|
this.showOnHomePage,
|
||||||
|
this.metaKeywords,
|
||||||
|
this.metaDescription,
|
||||||
|
this.metaTitle,
|
||||||
|
this.allowCustomerReviews,
|
||||||
|
this.approvedRatingSum,
|
||||||
|
this.notApprovedRatingSum,
|
||||||
|
this.approvedTotalReviews,
|
||||||
|
this.notApprovedTotalReviews,
|
||||||
|
this.sku,
|
||||||
|
this.isRx,
|
||||||
|
this.prescriptionRequired,
|
||||||
|
this.rxMessage,
|
||||||
|
this.rxMessagen,
|
||||||
|
this.manufacturerPartNumber,
|
||||||
|
this.gtin,
|
||||||
|
this.isGiftCard,
|
||||||
|
this.requireOtherProducts,
|
||||||
|
this.automaticallyAddRequiredProducts,
|
||||||
|
this.isDownload,
|
||||||
|
this.unlimitedDownloads,
|
||||||
|
this.maxNumberOfDownloads,
|
||||||
|
this.downloadExpirationDays,
|
||||||
|
this.hasSampleDownload,
|
||||||
|
this.hasUserAgreement,
|
||||||
|
this.isRecurring,
|
||||||
|
this.recurringCycleLength,
|
||||||
|
this.recurringTotalCycles,
|
||||||
|
this.isRental,
|
||||||
|
this.rentalPriceLength,
|
||||||
|
this.isShipEnabled,
|
||||||
|
this.isFreeShipping,
|
||||||
|
this.shipSeparately,
|
||||||
|
this.additionalShippingCharge,
|
||||||
|
this.isTaxExempt,
|
||||||
|
this.isTelecommunicationsOrBroadcastingOrElectronicServices,
|
||||||
|
this.useMultipleWarehouses,
|
||||||
|
this.manageInventoryMethodId,
|
||||||
|
this.stockQuantity,
|
||||||
|
this.stockAvailability,
|
||||||
|
this.stockAvailabilityn,
|
||||||
|
this.displayStockAvailability,
|
||||||
|
this.displayStockQuantity,
|
||||||
|
this.minStockQuantity,
|
||||||
|
this.notifyAdminForQuantityBelow,
|
||||||
|
this.allowBackInStockSubscriptions,
|
||||||
|
this.orderMinimumQuantity,
|
||||||
|
this.orderMaximumQuantity,
|
||||||
|
this.allowedQuantities,
|
||||||
|
this.allowAddingOnlyExistingAttributeCombinations,
|
||||||
|
this.disableBuyButton,
|
||||||
|
this.disableWishlistButton,
|
||||||
|
this.availableForPreOrder,
|
||||||
|
this.preOrderAvailabilityStartDateTimeUtc,
|
||||||
|
this.callForPrice,
|
||||||
|
this.price,
|
||||||
|
this.oldPrice,
|
||||||
|
this.productCost,
|
||||||
|
this.specialPrice,
|
||||||
|
this.specialPriceStartDateTimeUtc,
|
||||||
|
this.specialPriceEndDateTimeUtc,
|
||||||
|
this.customerEntersPrice,
|
||||||
|
this.minimumCustomerEnteredPrice,
|
||||||
|
this.maximumCustomerEnteredPrice,
|
||||||
|
this.basepriceEnabled,
|
||||||
|
this.basepriceAmount,
|
||||||
|
this.basepriceBaseAmount,
|
||||||
|
this.hasTierPrices,
|
||||||
|
this.hasDiscountsApplied,
|
||||||
|
this.discountName,
|
||||||
|
this.discountNamen,
|
||||||
|
this.discountDescription,
|
||||||
|
this.discountDescriptionn,
|
||||||
|
this.discountPercentage,
|
||||||
|
this.currency,
|
||||||
|
this.currencyn,
|
||||||
|
this.weight,
|
||||||
|
this.length,
|
||||||
|
this.width,
|
||||||
|
this.height,
|
||||||
|
this.availableStartDateTimeUtc,
|
||||||
|
this.availableEndDateTimeUtc,
|
||||||
|
this.displayOrder,
|
||||||
|
this.published,
|
||||||
|
this.deleted,
|
||||||
|
this.createdOnUtc,
|
||||||
|
this.updatedOnUtc,
|
||||||
|
this.productType,
|
||||||
|
this.parentGroupedProductId,
|
||||||
|
this.roleIds,
|
||||||
|
this.discountIds,
|
||||||
|
this.storeIds,
|
||||||
|
this.manufacturerIds,
|
||||||
|
this.reviews,
|
||||||
|
this.images,
|
||||||
|
this.attributes,
|
||||||
|
this.specifications,
|
||||||
|
this.associatedProductIds,
|
||||||
|
this.tags,
|
||||||
|
this.vendorId,
|
||||||
|
this.seName});
|
||||||
|
|
||||||
|
ScanQrModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
visibleIndividually = json['visible_individually'];
|
||||||
|
name = json['name'];
|
||||||
|
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'];
|
||||||
|
shortDescriptionn = json['short_descriptionn'];
|
||||||
|
fullDescription = json['full_description'];
|
||||||
|
fullDescriptionn = json['full_descriptionn'];
|
||||||
|
markasNew = json['markas_new'];
|
||||||
|
showOnHomePage = json['show_on_home_page'];
|
||||||
|
metaKeywords = json['meta_keywords'];
|
||||||
|
metaDescription = json['meta_description'];
|
||||||
|
metaTitle = json['meta_title'];
|
||||||
|
allowCustomerReviews = json['allow_customer_reviews'];
|
||||||
|
approvedRatingSum = json['approved_rating_sum'];
|
||||||
|
notApprovedRatingSum = json['not_approved_rating_sum'];
|
||||||
|
approvedTotalReviews = json['approved_total_reviews'];
|
||||||
|
notApprovedTotalReviews = json['not_approved_total_reviews'];
|
||||||
|
sku = json['sku'];
|
||||||
|
isRx = json['is_rx'];
|
||||||
|
prescriptionRequired = json['prescription_required'];
|
||||||
|
rxMessage = json['rx_message'];
|
||||||
|
rxMessagen = json['rx_messagen'];
|
||||||
|
manufacturerPartNumber = json['manufacturer_part_number'];
|
||||||
|
gtin = json['gtin'];
|
||||||
|
isGiftCard = json['is_gift_card'];
|
||||||
|
requireOtherProducts = json['require_other_products'];
|
||||||
|
automaticallyAddRequiredProducts =
|
||||||
|
json['automatically_add_required_products'];
|
||||||
|
isDownload = json['is_download'];
|
||||||
|
unlimitedDownloads = json['unlimited_downloads'];
|
||||||
|
maxNumberOfDownloads = json['max_number_of_downloads'];
|
||||||
|
downloadExpirationDays = json['download_expiration_days'];
|
||||||
|
hasSampleDownload = json['has_sample_download'];
|
||||||
|
hasUserAgreement = json['has_user_agreement'];
|
||||||
|
isRecurring = json['is_recurring'];
|
||||||
|
recurringCycleLength = json['recurring_cycle_length'];
|
||||||
|
recurringTotalCycles = json['recurring_total_cycles'];
|
||||||
|
isRental = json['is_rental'];
|
||||||
|
rentalPriceLength = json['rental_price_length'];
|
||||||
|
isShipEnabled = json['is_ship_enabled'];
|
||||||
|
isFreeShipping = json['is_free_shipping'];
|
||||||
|
shipSeparately = json['ship_separately'];
|
||||||
|
additionalShippingCharge = json['additional_shipping_charge'];
|
||||||
|
isTaxExempt = json['is_tax_exempt'];
|
||||||
|
isTelecommunicationsOrBroadcastingOrElectronicServices =
|
||||||
|
json['is_telecommunications_or_broadcasting_or_electronic_services'];
|
||||||
|
useMultipleWarehouses = json['use_multiple_warehouses'];
|
||||||
|
manageInventoryMethodId = json['manage_inventory_method_id'];
|
||||||
|
stockQuantity = json['stock_quantity'];
|
||||||
|
stockAvailability = json['stock_availability'];
|
||||||
|
stockAvailabilityn = json['stock_availabilityn'];
|
||||||
|
displayStockAvailability = json['display_stock_availability'];
|
||||||
|
displayStockQuantity = json['display_stock_quantity'];
|
||||||
|
minStockQuantity = json['min_stock_quantity'];
|
||||||
|
notifyAdminForQuantityBelow = json['notify_admin_for_quantity_below'];
|
||||||
|
allowBackInStockSubscriptions = json['allow_back_in_stock_subscriptions'];
|
||||||
|
orderMinimumQuantity = json['order_minimum_quantity'];
|
||||||
|
orderMaximumQuantity = json['order_maximum_quantity'];
|
||||||
|
allowedQuantities = json['allowed_quantities'];
|
||||||
|
allowAddingOnlyExistingAttributeCombinations =
|
||||||
|
json['allow_adding_only_existing_attribute_combinations'];
|
||||||
|
disableBuyButton = json['disable_buy_button'];
|
||||||
|
disableWishlistButton = json['disable_wishlist_button'];
|
||||||
|
availableForPreOrder = json['available_for_pre_order'];
|
||||||
|
preOrderAvailabilityStartDateTimeUtc =
|
||||||
|
json['pre_order_availability_start_date_time_utc'];
|
||||||
|
callForPrice = json['call_for_price'];
|
||||||
|
price = json['price'];
|
||||||
|
oldPrice = json['old_price'];
|
||||||
|
productCost = json['product_cost'];
|
||||||
|
specialPrice = json['special_price'];
|
||||||
|
specialPriceStartDateTimeUtc = json['special_price_start_date_time_utc'];
|
||||||
|
specialPriceEndDateTimeUtc = json['special_price_end_date_time_utc'];
|
||||||
|
customerEntersPrice = json['customer_enters_price'];
|
||||||
|
minimumCustomerEnteredPrice = json['minimum_customer_entered_price'];
|
||||||
|
maximumCustomerEnteredPrice = json['maximum_customer_entered_price'];
|
||||||
|
basepriceEnabled = json['baseprice_enabled'];
|
||||||
|
basepriceAmount = json['baseprice_amount'];
|
||||||
|
basepriceBaseAmount = json['baseprice_base_amount'];
|
||||||
|
hasTierPrices = json['has_tier_prices'];
|
||||||
|
hasDiscountsApplied = json['has_discounts_applied'];
|
||||||
|
discountName = json['discount_name'];
|
||||||
|
discountNamen = json['discount_namen'];
|
||||||
|
discountDescription = json['discount_description'];
|
||||||
|
discountDescriptionn = json['discount_Descriptionn'];
|
||||||
|
discountPercentage = json['discount_percentage'];
|
||||||
|
currency = json['currency'];
|
||||||
|
currencyn = json['currencyn'];
|
||||||
|
weight = json['weight'];
|
||||||
|
length = json['length'];
|
||||||
|
width = json['width'];
|
||||||
|
height = json['height'];
|
||||||
|
availableStartDateTimeUtc = json['available_start_date_time_utc'];
|
||||||
|
availableEndDateTimeUtc = json['available_end_date_time_utc'];
|
||||||
|
displayOrder = json['display_order'];
|
||||||
|
published = json['published'];
|
||||||
|
deleted = json['deleted'];
|
||||||
|
createdOnUtc = json['created_on_utc'];
|
||||||
|
updatedOnUtc = json['updated_on_utc'];
|
||||||
|
productType = json['product_type'];
|
||||||
|
parentGroupedProductId = json['parent_grouped_product_id'];
|
||||||
|
if (json['role_ids'] != null) {
|
||||||
|
roleIds = new List<Null>();
|
||||||
|
}
|
||||||
|
if (json['discount_ids'] != null) {
|
||||||
|
discountIds = new List<Null>();
|
||||||
|
}
|
||||||
|
if (json['store_ids'] != null) {
|
||||||
|
storeIds = new List<Null>();
|
||||||
|
}
|
||||||
|
manufacturerIds = json['manufacturer_ids'].cast<int>();
|
||||||
|
if (json['reviews'] != null) {
|
||||||
|
reviews = new List<Null>();
|
||||||
|
}
|
||||||
|
if (json['images'] != null) {
|
||||||
|
images = new List<Images>();
|
||||||
|
json['images'].forEach((v) {
|
||||||
|
images.add(new Images.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
if (json['attributes'] != null) {
|
||||||
|
attributes = new List<Null>();
|
||||||
|
}
|
||||||
|
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>();
|
||||||
|
}
|
||||||
|
if (json['tags'] != null) {
|
||||||
|
tags = new List<Null>();
|
||||||
|
}
|
||||||
|
vendorId = json['vendor_id'];
|
||||||
|
seName = json['se_name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['visible_individually'] = this.visibleIndividually;
|
||||||
|
data['name'] = this.name;
|
||||||
|
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_descriptionn'] = this.shortDescriptionn;
|
||||||
|
data['full_description'] = this.fullDescription;
|
||||||
|
data['full_descriptionn'] = this.fullDescriptionn;
|
||||||
|
data['markas_new'] = this.markasNew;
|
||||||
|
data['show_on_home_page'] = this.showOnHomePage;
|
||||||
|
data['meta_keywords'] = this.metaKeywords;
|
||||||
|
data['meta_description'] = this.metaDescription;
|
||||||
|
data['meta_title'] = this.metaTitle;
|
||||||
|
data['allow_customer_reviews'] = this.allowCustomerReviews;
|
||||||
|
data['approved_rating_sum'] = this.approvedRatingSum;
|
||||||
|
data['not_approved_rating_sum'] = this.notApprovedRatingSum;
|
||||||
|
data['approved_total_reviews'] = this.approvedTotalReviews;
|
||||||
|
data['not_approved_total_reviews'] = this.notApprovedTotalReviews;
|
||||||
|
data['sku'] = this.sku;
|
||||||
|
data['is_rx'] = this.isRx;
|
||||||
|
data['prescription_required'] = this.prescriptionRequired;
|
||||||
|
data['rx_message'] = this.rxMessage;
|
||||||
|
data['rx_messagen'] = this.rxMessagen;
|
||||||
|
data['manufacturer_part_number'] = this.manufacturerPartNumber;
|
||||||
|
data['gtin'] = this.gtin;
|
||||||
|
data['is_gift_card'] = this.isGiftCard;
|
||||||
|
data['require_other_products'] = this.requireOtherProducts;
|
||||||
|
data['automatically_add_required_products'] =
|
||||||
|
this.automaticallyAddRequiredProducts;
|
||||||
|
data['is_download'] = this.isDownload;
|
||||||
|
data['unlimited_downloads'] = this.unlimitedDownloads;
|
||||||
|
data['max_number_of_downloads'] = this.maxNumberOfDownloads;
|
||||||
|
data['download_expiration_days'] = this.downloadExpirationDays;
|
||||||
|
data['has_sample_download'] = this.hasSampleDownload;
|
||||||
|
data['has_user_agreement'] = this.hasUserAgreement;
|
||||||
|
data['is_recurring'] = this.isRecurring;
|
||||||
|
data['recurring_cycle_length'] = this.recurringCycleLength;
|
||||||
|
data['recurring_total_cycles'] = this.recurringTotalCycles;
|
||||||
|
data['is_rental'] = this.isRental;
|
||||||
|
data['rental_price_length'] = this.rentalPriceLength;
|
||||||
|
data['is_ship_enabled'] = this.isShipEnabled;
|
||||||
|
data['is_free_shipping'] = this.isFreeShipping;
|
||||||
|
data['ship_separately'] = this.shipSeparately;
|
||||||
|
data['additional_shipping_charge'] = this.additionalShippingCharge;
|
||||||
|
data['is_tax_exempt'] = this.isTaxExempt;
|
||||||
|
data['is_telecommunications_or_broadcasting_or_electronic_services'] =
|
||||||
|
this.isTelecommunicationsOrBroadcastingOrElectronicServices;
|
||||||
|
data['use_multiple_warehouses'] = this.useMultipleWarehouses;
|
||||||
|
data['manage_inventory_method_id'] = this.manageInventoryMethodId;
|
||||||
|
data['stock_quantity'] = this.stockQuantity;
|
||||||
|
data['stock_availability'] = this.stockAvailability;
|
||||||
|
data['stock_availabilityn'] = this.stockAvailabilityn;
|
||||||
|
data['display_stock_availability'] = this.displayStockAvailability;
|
||||||
|
data['display_stock_quantity'] = this.displayStockQuantity;
|
||||||
|
data['min_stock_quantity'] = this.minStockQuantity;
|
||||||
|
data['notify_admin_for_quantity_below'] = this.notifyAdminForQuantityBelow;
|
||||||
|
data['allow_back_in_stock_subscriptions'] =
|
||||||
|
this.allowBackInStockSubscriptions;
|
||||||
|
data['order_minimum_quantity'] = this.orderMinimumQuantity;
|
||||||
|
data['order_maximum_quantity'] = this.orderMaximumQuantity;
|
||||||
|
data['allowed_quantities'] = this.allowedQuantities;
|
||||||
|
data['allow_adding_only_existing_attribute_combinations'] =
|
||||||
|
this.allowAddingOnlyExistingAttributeCombinations;
|
||||||
|
data['disable_buy_button'] = this.disableBuyButton;
|
||||||
|
data['disable_wishlist_button'] = this.disableWishlistButton;
|
||||||
|
data['available_for_pre_order'] = this.availableForPreOrder;
|
||||||
|
data['pre_order_availability_start_date_time_utc'] =
|
||||||
|
this.preOrderAvailabilityStartDateTimeUtc;
|
||||||
|
data['call_for_price'] = this.callForPrice;
|
||||||
|
data['price'] = this.price;
|
||||||
|
data['old_price'] = this.oldPrice;
|
||||||
|
data['product_cost'] = this.productCost;
|
||||||
|
data['special_price'] = this.specialPrice;
|
||||||
|
data['special_price_start_date_time_utc'] =
|
||||||
|
this.specialPriceStartDateTimeUtc;
|
||||||
|
data['special_price_end_date_time_utc'] = this.specialPriceEndDateTimeUtc;
|
||||||
|
data['customer_enters_price'] = this.customerEntersPrice;
|
||||||
|
data['minimum_customer_entered_price'] = this.minimumCustomerEnteredPrice;
|
||||||
|
data['maximum_customer_entered_price'] = this.maximumCustomerEnteredPrice;
|
||||||
|
data['baseprice_enabled'] = this.basepriceEnabled;
|
||||||
|
data['baseprice_amount'] = this.basepriceAmount;
|
||||||
|
data['baseprice_base_amount'] = this.basepriceBaseAmount;
|
||||||
|
data['has_tier_prices'] = this.hasTierPrices;
|
||||||
|
data['has_discounts_applied'] = this.hasDiscountsApplied;
|
||||||
|
data['discount_name'] = this.discountName;
|
||||||
|
data['discount_namen'] = this.discountNamen;
|
||||||
|
data['discount_description'] = this.discountDescription;
|
||||||
|
data['discount_Descriptionn'] = this.discountDescriptionn;
|
||||||
|
data['discount_percentage'] = this.discountPercentage;
|
||||||
|
data['currency'] = this.currency;
|
||||||
|
data['currencyn'] = this.currencyn;
|
||||||
|
data['weight'] = this.weight;
|
||||||
|
data['length'] = this.length;
|
||||||
|
data['width'] = this.width;
|
||||||
|
data['height'] = this.height;
|
||||||
|
data['available_start_date_time_utc'] = this.availableStartDateTimeUtc;
|
||||||
|
data['available_end_date_time_utc'] = this.availableEndDateTimeUtc;
|
||||||
|
data['display_order'] = this.displayOrder;
|
||||||
|
data['published'] = this.published;
|
||||||
|
data['deleted'] = this.deleted;
|
||||||
|
data['created_on_utc'] = this.createdOnUtc;
|
||||||
|
data['updated_on_utc'] = this.updatedOnUtc;
|
||||||
|
data['product_type'] = this.productType;
|
||||||
|
data['parent_grouped_product_id'] = this.parentGroupedProductId;
|
||||||
|
|
||||||
|
data['manufacturer_ids'] = this.manufacturerIds;
|
||||||
|
|
||||||
|
if (this.images != null) {
|
||||||
|
data['images'] = this.images.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.specifications != null) {
|
||||||
|
data['specifications'] =
|
||||||
|
this.specifications.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
data['vendor_id'] = this.vendorId;
|
||||||
|
data['se_name'] = this.seName;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Images {
|
||||||
|
int id;
|
||||||
|
int position;
|
||||||
|
String src;
|
||||||
|
String thumb;
|
||||||
|
String attachment;
|
||||||
|
|
||||||
|
Images({this.id, this.position, this.src, this.thumb, this.attachment});
|
||||||
|
|
||||||
|
Images.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
position = json['position'];
|
||||||
|
src = json['src'];
|
||||||
|
thumb = json['thumb'];
|
||||||
|
attachment = json['attachment'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['position'] = this.position;
|
||||||
|
data['src'] = this.src;
|
||||||
|
data['thumb'] = this.thumb;
|
||||||
|
data['attachment'] = this.attachment;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,75 @@
|
|||||||
|
class SubCategoriesModel {
|
||||||
|
String id;
|
||||||
|
String name;
|
||||||
|
String namen;
|
||||||
|
List<LocalizedNames> localizedNames;
|
||||||
|
String description;
|
||||||
|
int parentCategoryId;
|
||||||
|
int displayOrder;
|
||||||
|
dynamic image;
|
||||||
|
bool isLeaf;
|
||||||
|
|
||||||
|
SubCategoriesModel(
|
||||||
|
{this.id,
|
||||||
|
this.name,
|
||||||
|
this.namen,
|
||||||
|
this.localizedNames,
|
||||||
|
this.description,
|
||||||
|
this.parentCategoryId,
|
||||||
|
this.displayOrder,
|
||||||
|
this.image,
|
||||||
|
this.isLeaf});
|
||||||
|
|
||||||
|
SubCategoriesModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
name = json['name'];
|
||||||
|
namen = json['namen'];
|
||||||
|
if (json['localized_names'] != null) {
|
||||||
|
localizedNames = new List<LocalizedNames>();
|
||||||
|
json['localized_names'].forEach((v) {
|
||||||
|
localizedNames.add(new LocalizedNames.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
description = json['description'];
|
||||||
|
parentCategoryId = json['parent_category_id'];
|
||||||
|
displayOrder = json['display_order'];
|
||||||
|
image = json['image'];
|
||||||
|
isLeaf = json['is_leaf'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['name'] = this.name;
|
||||||
|
data['namen'] = this.namen;
|
||||||
|
if (this.localizedNames != null) {
|
||||||
|
data['localized_names'] =
|
||||||
|
this.localizedNames.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['description'] = this.description;
|
||||||
|
data['parent_category_id'] = this.parentCategoryId;
|
||||||
|
data['display_order'] = this.displayOrder;
|
||||||
|
data['image'] = this.image;
|
||||||
|
data['is_leaf'] = this.isLeaf;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,562 @@
|
|||||||
|
class SubProductsModel {
|
||||||
|
String id;
|
||||||
|
bool visibleIndividually;
|
||||||
|
String name;
|
||||||
|
String namen;
|
||||||
|
List<LocalizedNames> localizedNames;
|
||||||
|
String shortDescription;
|
||||||
|
String shortDescriptionn;
|
||||||
|
String fullDescription;
|
||||||
|
String fullDescriptionn;
|
||||||
|
bool markasNew;
|
||||||
|
bool showOnHomePage;
|
||||||
|
dynamic metaKeywords;
|
||||||
|
dynamic metaDescription;
|
||||||
|
dynamic metaTitle;
|
||||||
|
bool allowCustomerReviews;
|
||||||
|
dynamic approvedRatingSum;
|
||||||
|
dynamic notApprovedRatingSum;
|
||||||
|
dynamic approvedTotalReviews;
|
||||||
|
dynamic notApprovedTotalReviews;
|
||||||
|
String sku;
|
||||||
|
bool isRx;
|
||||||
|
bool prescriptionRequired;
|
||||||
|
dynamic rxMessage;
|
||||||
|
dynamic rxMessagen;
|
||||||
|
dynamic manufacturerPartNumber;
|
||||||
|
dynamic gtin;
|
||||||
|
bool isGiftCard;
|
||||||
|
bool requireOtherProducts;
|
||||||
|
bool automaticallyAddRequiredProducts;
|
||||||
|
bool isDownload;
|
||||||
|
bool unlimitedDownloads;
|
||||||
|
dynamic maxNumberOfDownloads;
|
||||||
|
dynamic downloadExpirationDays;
|
||||||
|
bool hasSampleDownload;
|
||||||
|
bool hasUserAgreement;
|
||||||
|
bool isRecurring;
|
||||||
|
dynamic recurringCycleLength;
|
||||||
|
dynamic recurringTotalCycles;
|
||||||
|
bool isRental;
|
||||||
|
dynamic rentalPriceLength;
|
||||||
|
bool isShipEnabled;
|
||||||
|
bool isFreeShipping;
|
||||||
|
bool shipSeparately;
|
||||||
|
dynamic additionalShippingCharge;
|
||||||
|
bool isTaxExempt;
|
||||||
|
bool isTelecommunicationsOrBroadcastingOrElectronicServices;
|
||||||
|
bool useMultipleWarehouses;
|
||||||
|
dynamic manageInventoryMethodId;
|
||||||
|
dynamic stockQuantity;
|
||||||
|
String stockAvailability;
|
||||||
|
String stockAvailabilityn;
|
||||||
|
bool displayStockAvailability;
|
||||||
|
bool displayStockQuantity;
|
||||||
|
dynamic minStockQuantity;
|
||||||
|
dynamic notifyAdminForQuantityBelow;
|
||||||
|
bool allowBackInStockSubscriptions;
|
||||||
|
dynamic orderMinimumQuantity;
|
||||||
|
dynamic orderMaximumQuantity;
|
||||||
|
dynamic allowedQuantities;
|
||||||
|
bool allowAddingOnlyExistingAttributeCombinations;
|
||||||
|
bool disableBuyButton;
|
||||||
|
bool disableWishlistButton;
|
||||||
|
bool availableForPreOrder;
|
||||||
|
dynamic preOrderAvailabilityStartDateTimeUtc;
|
||||||
|
bool callForPrice;
|
||||||
|
dynamic price;
|
||||||
|
dynamic oldPrice;
|
||||||
|
dynamic productCost;
|
||||||
|
dynamic specialPrice;
|
||||||
|
dynamic specialPriceStartDateTimeUtc;
|
||||||
|
dynamic specialPriceEndDateTimeUtc;
|
||||||
|
bool customerEntersPrice;
|
||||||
|
dynamic minimumCustomerEnteredPrice;
|
||||||
|
dynamic maximumCustomerEnteredPrice;
|
||||||
|
bool basepriceEnabled;
|
||||||
|
dynamic basepriceAmount;
|
||||||
|
dynamic basepriceBaseAmount;
|
||||||
|
bool hasTierPrices;
|
||||||
|
bool hasDiscountsApplied;
|
||||||
|
dynamic discountName;
|
||||||
|
dynamic discountNamen;
|
||||||
|
dynamic discountDescription;
|
||||||
|
dynamic discountDescriptionn;
|
||||||
|
dynamic discountPercentage;
|
||||||
|
String currency;
|
||||||
|
String currencyn;
|
||||||
|
double weight;
|
||||||
|
dynamic length;
|
||||||
|
dynamic width;
|
||||||
|
dynamic height;
|
||||||
|
dynamic availableStartDateTimeUtc;
|
||||||
|
dynamic availableEndDateTimeUtc;
|
||||||
|
dynamic displayOrder;
|
||||||
|
bool published;
|
||||||
|
bool deleted;
|
||||||
|
String createdOnUtc;
|
||||||
|
String updatedOnUtc;
|
||||||
|
String productType;
|
||||||
|
dynamic parentGroupedProductId;
|
||||||
|
List<dynamic> roleIds;
|
||||||
|
List<dynamic> discountIds;
|
||||||
|
List<dynamic> storeIds;
|
||||||
|
List<int> manufacturerIds;
|
||||||
|
List<dynamic> reviews;
|
||||||
|
List<Images> images;
|
||||||
|
List<dynamic> attributes;
|
||||||
|
List<Specifications> specifications;
|
||||||
|
List<dynamic> associatedProductIds;
|
||||||
|
List<dynamic> tags;
|
||||||
|
dynamic vendorId;
|
||||||
|
String seName;
|
||||||
|
|
||||||
|
SubProductsModel(
|
||||||
|
{this.id,
|
||||||
|
this.visibleIndividually,
|
||||||
|
this.name,
|
||||||
|
this.namen,
|
||||||
|
this.localizedNames,
|
||||||
|
this.shortDescription,
|
||||||
|
this.shortDescriptionn,
|
||||||
|
this.fullDescription,
|
||||||
|
this.fullDescriptionn,
|
||||||
|
this.markasNew,
|
||||||
|
this.showOnHomePage,
|
||||||
|
this.metaKeywords,
|
||||||
|
this.metaDescription,
|
||||||
|
this.metaTitle,
|
||||||
|
this.allowCustomerReviews,
|
||||||
|
this.approvedRatingSum,
|
||||||
|
this.notApprovedRatingSum,
|
||||||
|
this.approvedTotalReviews,
|
||||||
|
this.notApprovedTotalReviews,
|
||||||
|
this.sku,
|
||||||
|
this.isRx,
|
||||||
|
this.prescriptionRequired,
|
||||||
|
this.rxMessage,
|
||||||
|
this.rxMessagen,
|
||||||
|
this.manufacturerPartNumber,
|
||||||
|
this.gtin,
|
||||||
|
this.isGiftCard,
|
||||||
|
this.requireOtherProducts,
|
||||||
|
this.automaticallyAddRequiredProducts,
|
||||||
|
this.isDownload,
|
||||||
|
this.unlimitedDownloads,
|
||||||
|
this.maxNumberOfDownloads,
|
||||||
|
this.downloadExpirationDays,
|
||||||
|
this.hasSampleDownload,
|
||||||
|
this.hasUserAgreement,
|
||||||
|
this.isRecurring,
|
||||||
|
this.recurringCycleLength,
|
||||||
|
this.recurringTotalCycles,
|
||||||
|
this.isRental,
|
||||||
|
this.rentalPriceLength,
|
||||||
|
this.isShipEnabled,
|
||||||
|
this.isFreeShipping,
|
||||||
|
this.shipSeparately,
|
||||||
|
this.additionalShippingCharge,
|
||||||
|
this.isTaxExempt,
|
||||||
|
this.isTelecommunicationsOrBroadcastingOrElectronicServices,
|
||||||
|
this.useMultipleWarehouses,
|
||||||
|
this.manageInventoryMethodId,
|
||||||
|
this.stockQuantity,
|
||||||
|
this.stockAvailability,
|
||||||
|
this.stockAvailabilityn,
|
||||||
|
this.displayStockAvailability,
|
||||||
|
this.displayStockQuantity,
|
||||||
|
this.minStockQuantity,
|
||||||
|
this.notifyAdminForQuantityBelow,
|
||||||
|
this.allowBackInStockSubscriptions,
|
||||||
|
this.orderMinimumQuantity,
|
||||||
|
this.orderMaximumQuantity,
|
||||||
|
this.allowedQuantities,
|
||||||
|
this.allowAddingOnlyExistingAttributeCombinations,
|
||||||
|
this.disableBuyButton,
|
||||||
|
this.disableWishlistButton,
|
||||||
|
this.availableForPreOrder,
|
||||||
|
this.preOrderAvailabilityStartDateTimeUtc,
|
||||||
|
this.callForPrice,
|
||||||
|
this.price,
|
||||||
|
this.oldPrice,
|
||||||
|
this.productCost,
|
||||||
|
this.specialPrice,
|
||||||
|
this.specialPriceStartDateTimeUtc,
|
||||||
|
this.specialPriceEndDateTimeUtc,
|
||||||
|
this.customerEntersPrice,
|
||||||
|
this.minimumCustomerEnteredPrice,
|
||||||
|
this.maximumCustomerEnteredPrice,
|
||||||
|
this.basepriceEnabled,
|
||||||
|
this.basepriceAmount,
|
||||||
|
this.basepriceBaseAmount,
|
||||||
|
this.hasTierPrices,
|
||||||
|
this.hasDiscountsApplied,
|
||||||
|
this.discountName,
|
||||||
|
this.discountNamen,
|
||||||
|
this.discountDescription,
|
||||||
|
this.discountDescriptionn,
|
||||||
|
this.discountPercentage,
|
||||||
|
this.currency,
|
||||||
|
this.currencyn,
|
||||||
|
this.weight,
|
||||||
|
this.length,
|
||||||
|
this.width,
|
||||||
|
this.height,
|
||||||
|
this.availableStartDateTimeUtc,
|
||||||
|
this.availableEndDateTimeUtc,
|
||||||
|
this.displayOrder,
|
||||||
|
this.published,
|
||||||
|
this.deleted,
|
||||||
|
this.createdOnUtc,
|
||||||
|
this.updatedOnUtc,
|
||||||
|
this.productType,
|
||||||
|
this.parentGroupedProductId,
|
||||||
|
this.roleIds,
|
||||||
|
this.discountIds,
|
||||||
|
this.storeIds,
|
||||||
|
this.manufacturerIds,
|
||||||
|
this.reviews,
|
||||||
|
this.images,
|
||||||
|
this.attributes,
|
||||||
|
this.specifications,
|
||||||
|
this.associatedProductIds,
|
||||||
|
this.tags,
|
||||||
|
this.vendorId,
|
||||||
|
this.seName});
|
||||||
|
|
||||||
|
SubProductsModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
visibleIndividually = json['visible_individually'];
|
||||||
|
name = json['name'];
|
||||||
|
if (json['images'] != null) {
|
||||||
|
images = new List<Images>();
|
||||||
|
json['images'].forEach((v) {
|
||||||
|
images.add(new Images.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
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'];
|
||||||
|
shortDescriptionn = json['short_descriptionn'];
|
||||||
|
fullDescription = json['full_description'];
|
||||||
|
fullDescriptionn = json['full_descriptionn'];
|
||||||
|
markasNew = json['markas_new'];
|
||||||
|
showOnHomePage = json['show_on_home_page'];
|
||||||
|
metaKeywords = json['meta_keywords'];
|
||||||
|
metaDescription = json['meta_description'];
|
||||||
|
metaTitle = json['meta_title'];
|
||||||
|
allowCustomerReviews = json['allow_customer_reviews'];
|
||||||
|
approvedRatingSum = json['approved_rating_sum'];
|
||||||
|
notApprovedRatingSum = json['not_approved_rating_sum'];
|
||||||
|
approvedTotalReviews = json['approved_total_reviews'];
|
||||||
|
notApprovedTotalReviews = json['not_approved_total_reviews'];
|
||||||
|
sku = json['sku'];
|
||||||
|
isRx = json['is_rx'];
|
||||||
|
prescriptionRequired = json['prescription_required'];
|
||||||
|
rxMessage = json['rx_message'];
|
||||||
|
rxMessagen = json['rx_messagen'];
|
||||||
|
manufacturerPartNumber = json['manufacturer_part_number'];
|
||||||
|
gtin = json['gtin'];
|
||||||
|
isGiftCard = json['is_gift_card'];
|
||||||
|
requireOtherProducts = json['require_other_products'];
|
||||||
|
automaticallyAddRequiredProducts =
|
||||||
|
json['automatically_add_required_products'];
|
||||||
|
isDownload = json['is_download'];
|
||||||
|
unlimitedDownloads = json['unlimited_downloads'];
|
||||||
|
maxNumberOfDownloads = json['max_number_of_downloads'];
|
||||||
|
downloadExpirationDays = json['download_expiration_days'];
|
||||||
|
hasSampleDownload = json['has_sample_download'];
|
||||||
|
hasUserAgreement = json['has_user_agreement'];
|
||||||
|
isRecurring = json['is_recurring'];
|
||||||
|
recurringCycleLength = json['recurring_cycle_length'];
|
||||||
|
recurringTotalCycles = json['recurring_total_cycles'];
|
||||||
|
isRental = json['is_rental'];
|
||||||
|
rentalPriceLength = json['rental_price_length'];
|
||||||
|
isShipEnabled = json['is_ship_enabled'];
|
||||||
|
isFreeShipping = json['is_free_shipping'];
|
||||||
|
shipSeparately = json['ship_separately'];
|
||||||
|
additionalShippingCharge = json['additional_shipping_charge'];
|
||||||
|
isTaxExempt = json['is_tax_exempt'];
|
||||||
|
isTelecommunicationsOrBroadcastingOrElectronicServices =
|
||||||
|
json['is_telecommunications_or_broadcasting_or_electronic_services'];
|
||||||
|
useMultipleWarehouses = json['use_multiple_warehouses'];
|
||||||
|
manageInventoryMethodId = json['manage_inventory_method_id'];
|
||||||
|
stockQuantity = json['stock_quantity'];
|
||||||
|
stockAvailability = json['stock_availability'];
|
||||||
|
stockAvailabilityn = json['stock_availabilityn'];
|
||||||
|
displayStockAvailability = json['display_stock_availability'];
|
||||||
|
displayStockQuantity = json['display_stock_quantity'];
|
||||||
|
minStockQuantity = json['min_stock_quantity'];
|
||||||
|
notifyAdminForQuantityBelow = json['notify_admin_for_quantity_below'];
|
||||||
|
allowBackInStockSubscriptions = json['allow_back_in_stock_subscriptions'];
|
||||||
|
orderMinimumQuantity = json['order_minimum_quantity'];
|
||||||
|
orderMaximumQuantity = json['order_maximum_quantity'];
|
||||||
|
allowedQuantities = json['allowed_quantities'];
|
||||||
|
allowAddingOnlyExistingAttributeCombinations =
|
||||||
|
json['allow_adding_only_existing_attribute_combinations'];
|
||||||
|
disableBuyButton = json['disable_buy_button'];
|
||||||
|
disableWishlistButton = json['disable_wishlist_button'];
|
||||||
|
availableForPreOrder = json['available_for_pre_order'];
|
||||||
|
preOrderAvailabilityStartDateTimeUtc =
|
||||||
|
json['pre_order_availability_start_date_time_utc'];
|
||||||
|
callForPrice = json['call_for_price'];
|
||||||
|
price = json['price'];
|
||||||
|
oldPrice = json['old_price'];
|
||||||
|
productCost = json['product_cost'];
|
||||||
|
specialPrice = json['special_price'];
|
||||||
|
specialPriceStartDateTimeUtc = json['special_price_start_date_time_utc'];
|
||||||
|
specialPriceEndDateTimeUtc = json['special_price_end_date_time_utc'];
|
||||||
|
customerEntersPrice = json['customer_enters_price'];
|
||||||
|
minimumCustomerEnteredPrice = json['minimum_customer_entered_price'];
|
||||||
|
maximumCustomerEnteredPrice = json['maximum_customer_entered_price'];
|
||||||
|
basepriceEnabled = json['baseprice_enabled'];
|
||||||
|
basepriceAmount = json['baseprice_amount'];
|
||||||
|
basepriceBaseAmount = json['baseprice_base_amount'];
|
||||||
|
hasTierPrices = json['has_tier_prices'];
|
||||||
|
hasDiscountsApplied = json['has_discounts_applied'];
|
||||||
|
discountName = json['discount_name'];
|
||||||
|
discountNamen = json['discount_namen'];
|
||||||
|
discountDescription = json['discount_description'];
|
||||||
|
discountDescriptionn = json['discount_Descriptionn'];
|
||||||
|
discountPercentage = json['discount_percentage'];
|
||||||
|
currency = json['currency'];
|
||||||
|
currencyn = json['currencyn'];
|
||||||
|
weight = json['weight'];
|
||||||
|
length = json['length'];
|
||||||
|
width = json['width'];
|
||||||
|
height = json['height'];
|
||||||
|
availableStartDateTimeUtc = json['available_start_date_time_utc'];
|
||||||
|
availableEndDateTimeUtc = json['available_end_date_time_utc'];
|
||||||
|
displayOrder = json['display_order'];
|
||||||
|
published = json['published'];
|
||||||
|
deleted = json['deleted'];
|
||||||
|
createdOnUtc = json['created_on_utc'];
|
||||||
|
updatedOnUtc = json['updated_on_utc'];
|
||||||
|
productType = json['product_type'];
|
||||||
|
parentGroupedProductId = json['parent_grouped_product_id'];
|
||||||
|
|
||||||
|
manufacturerIds = json['manufacturer_ids'].cast<int>();
|
||||||
|
|
||||||
|
if (json['specifications'] != null) {
|
||||||
|
specifications = new List<Specifications>();
|
||||||
|
json['specifications'].forEach((v) {
|
||||||
|
specifications.add(new Specifications.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
vendorId = json['vendor_id'];
|
||||||
|
seName = json['se_name'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['visible_individually'] = this.visibleIndividually;
|
||||||
|
data['name'] = this.name;
|
||||||
|
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_descriptionn'] = this.shortDescriptionn;
|
||||||
|
data['full_description'] = this.fullDescription;
|
||||||
|
data['full_descriptionn'] = this.fullDescriptionn;
|
||||||
|
data['markas_new'] = this.markasNew;
|
||||||
|
data['show_on_home_page'] = this.showOnHomePage;
|
||||||
|
data['meta_keywords'] = this.metaKeywords;
|
||||||
|
data['meta_description'] = this.metaDescription;
|
||||||
|
data['meta_title'] = this.metaTitle;
|
||||||
|
data['allow_customer_reviews'] = this.allowCustomerReviews;
|
||||||
|
data['approved_rating_sum'] = this.approvedRatingSum;
|
||||||
|
data['not_approved_rating_sum'] = this.notApprovedRatingSum;
|
||||||
|
data['approved_total_reviews'] = this.approvedTotalReviews;
|
||||||
|
data['not_approved_total_reviews'] = this.notApprovedTotalReviews;
|
||||||
|
data['sku'] = this.sku;
|
||||||
|
data['is_rx'] = this.isRx;
|
||||||
|
data['prescription_required'] = this.prescriptionRequired;
|
||||||
|
data['rx_message'] = this.rxMessage;
|
||||||
|
data['rx_messagen'] = this.rxMessagen;
|
||||||
|
data['manufacturer_part_number'] = this.manufacturerPartNumber;
|
||||||
|
data['gtin'] = this.gtin;
|
||||||
|
data['is_gift_card'] = this.isGiftCard;
|
||||||
|
data['require_other_products'] = this.requireOtherProducts;
|
||||||
|
data['automatically_add_required_products'] =
|
||||||
|
this.automaticallyAddRequiredProducts;
|
||||||
|
data['is_download'] = this.isDownload;
|
||||||
|
data['unlimited_downloads'] = this.unlimitedDownloads;
|
||||||
|
data['max_number_of_downloads'] = this.maxNumberOfDownloads;
|
||||||
|
data['download_expiration_days'] = this.downloadExpirationDays;
|
||||||
|
data['has_sample_download'] = this.hasSampleDownload;
|
||||||
|
data['has_user_agreement'] = this.hasUserAgreement;
|
||||||
|
data['is_recurring'] = this.isRecurring;
|
||||||
|
data['recurring_cycle_length'] = this.recurringCycleLength;
|
||||||
|
data['recurring_total_cycles'] = this.recurringTotalCycles;
|
||||||
|
data['is_rental'] = this.isRental;
|
||||||
|
data['rental_price_length'] = this.rentalPriceLength;
|
||||||
|
data['is_ship_enabled'] = this.isShipEnabled;
|
||||||
|
data['is_free_shipping'] = this.isFreeShipping;
|
||||||
|
data['ship_separately'] = this.shipSeparately;
|
||||||
|
data['additional_shipping_charge'] = this.additionalShippingCharge;
|
||||||
|
data['is_tax_exempt'] = this.isTaxExempt;
|
||||||
|
data['is_telecommunications_or_broadcasting_or_electronic_services'] =
|
||||||
|
this.isTelecommunicationsOrBroadcastingOrElectronicServices;
|
||||||
|
data['use_multiple_warehouses'] = this.useMultipleWarehouses;
|
||||||
|
data['manage_inventory_method_id'] = this.manageInventoryMethodId;
|
||||||
|
data['stock_quantity'] = this.stockQuantity;
|
||||||
|
data['stock_availability'] = this.stockAvailability;
|
||||||
|
data['stock_availabilityn'] = this.stockAvailabilityn;
|
||||||
|
data['display_stock_availability'] = this.displayStockAvailability;
|
||||||
|
data['display_stock_quantity'] = this.displayStockQuantity;
|
||||||
|
data['min_stock_quantity'] = this.minStockQuantity;
|
||||||
|
data['notify_admin_for_quantity_below'] = this.notifyAdminForQuantityBelow;
|
||||||
|
data['allow_back_in_stock_subscriptions'] =
|
||||||
|
this.allowBackInStockSubscriptions;
|
||||||
|
data['order_minimum_quantity'] = this.orderMinimumQuantity;
|
||||||
|
data['order_maximum_quantity'] = this.orderMaximumQuantity;
|
||||||
|
data['allowed_quantities'] = this.allowedQuantities;
|
||||||
|
data['allow_adding_only_existing_attribute_combinations'] =
|
||||||
|
this.allowAddingOnlyExistingAttributeCombinations;
|
||||||
|
data['disable_buy_button'] = this.disableBuyButton;
|
||||||
|
data['disable_wishlist_button'] = this.disableWishlistButton;
|
||||||
|
data['available_for_pre_order'] = this.availableForPreOrder;
|
||||||
|
data['pre_order_availability_start_date_time_utc'] =
|
||||||
|
this.preOrderAvailabilityStartDateTimeUtc;
|
||||||
|
data['call_for_price'] = this.callForPrice;
|
||||||
|
data['price'] = this.price;
|
||||||
|
data['old_price'] = this.oldPrice;
|
||||||
|
data['product_cost'] = this.productCost;
|
||||||
|
data['special_price'] = this.specialPrice;
|
||||||
|
data['special_price_start_date_time_utc'] =
|
||||||
|
this.specialPriceStartDateTimeUtc;
|
||||||
|
data['special_price_end_date_time_utc'] = this.specialPriceEndDateTimeUtc;
|
||||||
|
data['customer_enters_price'] = this.customerEntersPrice;
|
||||||
|
data['minimum_customer_entered_price'] = this.minimumCustomerEnteredPrice;
|
||||||
|
data['maximum_customer_entered_price'] = this.maximumCustomerEnteredPrice;
|
||||||
|
data['baseprice_enabled'] = this.basepriceEnabled;
|
||||||
|
data['baseprice_amount'] = this.basepriceAmount;
|
||||||
|
data['baseprice_base_amount'] = this.basepriceBaseAmount;
|
||||||
|
data['has_tier_prices'] = this.hasTierPrices;
|
||||||
|
data['has_discounts_applied'] = this.hasDiscountsApplied;
|
||||||
|
data['discount_name'] = this.discountName;
|
||||||
|
data['discount_namen'] = this.discountNamen;
|
||||||
|
data['discount_description'] = this.discountDescription;
|
||||||
|
data['discount_Descriptionn'] = this.discountDescriptionn;
|
||||||
|
data['discount_percentage'] = this.discountPercentage;
|
||||||
|
data['currency'] = this.currency;
|
||||||
|
data['currencyn'] = this.currencyn;
|
||||||
|
data['weight'] = this.weight;
|
||||||
|
data['length'] = this.length;
|
||||||
|
data['width'] = this.width;
|
||||||
|
data['height'] = this.height;
|
||||||
|
data['available_start_date_time_utc'] = this.availableStartDateTimeUtc;
|
||||||
|
data['available_end_date_time_utc'] = this.availableEndDateTimeUtc;
|
||||||
|
data['display_order'] = this.displayOrder;
|
||||||
|
data['published'] = this.published;
|
||||||
|
data['deleted'] = this.deleted;
|
||||||
|
data['created_on_utc'] = this.createdOnUtc;
|
||||||
|
data['updated_on_utc'] = this.updatedOnUtc;
|
||||||
|
data['product_type'] = this.productType;
|
||||||
|
data['parent_grouped_product_id'] = this.parentGroupedProductId;
|
||||||
|
|
||||||
|
data['manufacturer_ids'] = this.manufacturerIds;
|
||||||
|
|
||||||
|
if (this.specifications != null) {
|
||||||
|
data['specifications'] =
|
||||||
|
this.specifications.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
|
||||||
|
data['vendor_id'] = this.vendorId;
|
||||||
|
data['se_name'] = this.seName;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Images {
|
||||||
|
int id;
|
||||||
|
int position;
|
||||||
|
String src;
|
||||||
|
String thumb;
|
||||||
|
String attachment;
|
||||||
|
|
||||||
|
Images({this.id, this.position, this.src, this.thumb, this.attachment});
|
||||||
|
|
||||||
|
Images.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
position = json['position'];
|
||||||
|
src = json['src'];
|
||||||
|
thumb = json['thumb'];
|
||||||
|
attachment = json['attachment'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['position'] = this.position;
|
||||||
|
data['src'] = this.src;
|
||||||
|
data['thumb'] = this.thumb;
|
||||||
|
data['attachment'] = this.attachment;
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,185 @@
|
|||||||
|
class SearchProductsModel {
|
||||||
|
String id;
|
||||||
|
String name;
|
||||||
|
String namen;
|
||||||
|
List<LocalizedNames> localizedNames;
|
||||||
|
String shortDescription;
|
||||||
|
String fullDescription;
|
||||||
|
String fullDescriptionn;
|
||||||
|
dynamic approvedRatingSum;
|
||||||
|
dynamic approvedTotalReviews;
|
||||||
|
String sku;
|
||||||
|
bool isRx;
|
||||||
|
dynamic rxMessage;
|
||||||
|
dynamic rxMessagen;
|
||||||
|
dynamic stockQuantity;
|
||||||
|
String stockAvailability;
|
||||||
|
String stockAvailabilityn;
|
||||||
|
bool allowBackInStockSubscriptions;
|
||||||
|
dynamic orderMinimumQuantity;
|
||||||
|
dynamic orderMaximumQuantity;
|
||||||
|
double price;
|
||||||
|
dynamic oldPrice;
|
||||||
|
dynamic discountName;
|
||||||
|
dynamic discountNamen;
|
||||||
|
dynamic discountPercentage;
|
||||||
|
dynamic displayOrder;
|
||||||
|
List<dynamic> discountIds;
|
||||||
|
List<dynamic> reviews;
|
||||||
|
List<Images> images;
|
||||||
|
|
||||||
|
SearchProductsModel(
|
||||||
|
{this.id,
|
||||||
|
this.name,
|
||||||
|
this.namen,
|
||||||
|
this.localizedNames,
|
||||||
|
this.shortDescription,
|
||||||
|
this.fullDescription,
|
||||||
|
this.fullDescriptionn,
|
||||||
|
this.approvedRatingSum,
|
||||||
|
this.approvedTotalReviews,
|
||||||
|
this.sku,
|
||||||
|
this.isRx,
|
||||||
|
this.rxMessage,
|
||||||
|
this.rxMessagen,
|
||||||
|
this.stockQuantity,
|
||||||
|
this.stockAvailability,
|
||||||
|
this.stockAvailabilityn,
|
||||||
|
this.allowBackInStockSubscriptions,
|
||||||
|
this.orderMinimumQuantity,
|
||||||
|
this.orderMaximumQuantity,
|
||||||
|
this.price,
|
||||||
|
this.oldPrice,
|
||||||
|
this.discountName,
|
||||||
|
this.discountNamen,
|
||||||
|
this.discountPercentage,
|
||||||
|
this.displayOrder,
|
||||||
|
this.discountIds,
|
||||||
|
this.reviews,
|
||||||
|
this.images});
|
||||||
|
|
||||||
|
SearchProductsModel.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
name = json['name'];
|
||||||
|
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'];
|
||||||
|
fullDescription = json['full_description'];
|
||||||
|
fullDescriptionn = json['full_descriptionn'];
|
||||||
|
approvedRatingSum = json['approved_rating_sum'];
|
||||||
|
approvedTotalReviews = json['approved_total_reviews'];
|
||||||
|
sku = json['sku'];
|
||||||
|
isRx = json['is_rx'];
|
||||||
|
rxMessage = json['rx_message'];
|
||||||
|
rxMessagen = json['rx_messagen'];
|
||||||
|
stockQuantity = json['stock_quantity'];
|
||||||
|
stockAvailability = json['stock_availability'];
|
||||||
|
stockAvailabilityn = json['stock_availabilityn'];
|
||||||
|
allowBackInStockSubscriptions = json['allow_back_in_stock_subscriptions'];
|
||||||
|
orderMinimumQuantity = json['order_minimum_quantity'];
|
||||||
|
orderMaximumQuantity = json['order_maximum_quantity'];
|
||||||
|
price = json['price'];
|
||||||
|
oldPrice = json['old_price'];
|
||||||
|
discountName = json['discount_name'];
|
||||||
|
discountNamen = json['discount_namen'];
|
||||||
|
discountPercentage = json['discount_percentage'];
|
||||||
|
displayOrder = json['display_order'];
|
||||||
|
|
||||||
|
if (json['images'] != null) {
|
||||||
|
images = new List<Images>();
|
||||||
|
json['images'].forEach((v) {
|
||||||
|
images.add(new Images.fromJson(v));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['name'] = this.name;
|
||||||
|
data['namen'] = this.namen;
|
||||||
|
if (this.localizedNames != null) {
|
||||||
|
data['localized_names'] =
|
||||||
|
this.localizedNames.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
data['short_description'] = this.shortDescription;
|
||||||
|
data['full_description'] = this.fullDescription;
|
||||||
|
data['full_descriptionn'] = this.fullDescriptionn;
|
||||||
|
data['approved_rating_sum'] = this.approvedRatingSum;
|
||||||
|
data['approved_total_reviews'] = this.approvedTotalReviews;
|
||||||
|
data['sku'] = this.sku;
|
||||||
|
data['is_rx'] = this.isRx;
|
||||||
|
data['rx_message'] = this.rxMessage;
|
||||||
|
data['rx_messagen'] = this.rxMessagen;
|
||||||
|
data['stock_quantity'] = this.stockQuantity;
|
||||||
|
data['stock_availability'] = this.stockAvailability;
|
||||||
|
data['stock_availabilityn'] = this.stockAvailabilityn;
|
||||||
|
data['allow_back_in_stock_subscriptions'] =
|
||||||
|
this.allowBackInStockSubscriptions;
|
||||||
|
data['order_minimum_quantity'] = this.orderMinimumQuantity;
|
||||||
|
data['order_maximum_quantity'] = this.orderMaximumQuantity;
|
||||||
|
data['price'] = this.price;
|
||||||
|
data['old_price'] = this.oldPrice;
|
||||||
|
data['discount_name'] = this.discountName;
|
||||||
|
data['discount_namen'] = this.discountNamen;
|
||||||
|
data['discount_percentage'] = this.discountPercentage;
|
||||||
|
data['display_order'] = this.displayOrder;
|
||||||
|
|
||||||
|
if (this.images != null) {
|
||||||
|
data['images'] = this.images.map((v) => v.toJson()).toList();
|
||||||
|
}
|
||||||
|
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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class Images {
|
||||||
|
int id;
|
||||||
|
int position;
|
||||||
|
String src;
|
||||||
|
String thumb;
|
||||||
|
String attachment;
|
||||||
|
|
||||||
|
Images({this.id, this.position, this.src, this.thumb, this.attachment});
|
||||||
|
|
||||||
|
Images.fromJson(Map<String, dynamic> json) {
|
||||||
|
id = json['id'];
|
||||||
|
position = json['position'];
|
||||||
|
src = json['src'];
|
||||||
|
thumb = json['thumb'];
|
||||||
|
attachment = json['attachment'];
|
||||||
|
}
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() {
|
||||||
|
final Map<String, dynamic> data = new Map<String, dynamic>();
|
||||||
|
data['id'] = this.id;
|
||||||
|
data['position'] = this.position;
|
||||||
|
data['src'] = this.src;
|
||||||
|
data['thumb'] = this.thumb;
|
||||||
|
data['attachment'] = this.attachment;
|
||||||
|
return data;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,56 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/pharmacy/offer_products_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/pharmacy/offers_model.dart';
|
||||||
|
|
||||||
|
import 'base_service.dart';
|
||||||
|
|
||||||
|
class OffersCategoriseService extends BaseService {
|
||||||
|
List<OffersModel> _offersList = List();
|
||||||
|
List<OffersModel> get offersList => _offersList;
|
||||||
|
List<OfferProductsModel> _offerProducts = List();
|
||||||
|
List<OfferProductsModel> get offersProducts => _offerProducts;
|
||||||
|
|
||||||
|
clearCategorise() {
|
||||||
|
_offerProducts.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
// clearCategorise2() {
|
||||||
|
// _offersList.clear();
|
||||||
|
// }
|
||||||
|
|
||||||
|
Future getOffersCategorise() async {
|
||||||
|
hasError = false;
|
||||||
|
_offersList.clear();
|
||||||
|
await baseAppClient.get(
|
||||||
|
GET_OFFERS_CATEGORISE,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
response['categories'].forEach((item) {
|
||||||
|
_offersList.add(OffersModel.fromJson(item));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getOffersProducts({String id}) async {
|
||||||
|
hasError = false;
|
||||||
|
_offerProducts.clear();
|
||||||
|
String endPoint =
|
||||||
|
id != null ? GET_OFFERS_PRODUCTS + "$id" : GET_OFFERS_PRODUCTS + "1";
|
||||||
|
await baseAppClient.get(
|
||||||
|
endPoint,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
response['products'].forEach((item) {
|
||||||
|
_offerProducts.add(OfferProductsModel.fromJson(item));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,225 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/pharmacy/brands_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/pharmacy/categorise_parent_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/pharmacy/final_products_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/pharmacy/parent_products_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/pharmacy/pharmacy_categorise.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/pharmacy/scan_qr_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/pharmacy/sub_categories_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/pharmacy/sub_products_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/search_products_model.dart';
|
||||||
|
|
||||||
|
import 'base_service.dart';
|
||||||
|
|
||||||
|
class PharmacyCategoriseService extends BaseService {
|
||||||
|
//service one
|
||||||
|
List<PharmacyCategorise> _categoriseList = List();
|
||||||
|
List<PharmacyCategorise> get categoriseList => _categoriseList;
|
||||||
|
|
||||||
|
//service two
|
||||||
|
List<CategoriseParentModel> _parentCategoriseList = List();
|
||||||
|
List<CategoriseParentModel> get parentCategoriseList => _parentCategoriseList;
|
||||||
|
|
||||||
|
//service three
|
||||||
|
List<ParentProductsModel> _parentProductsList = List();
|
||||||
|
List<ParentProductsModel> get parentProductsList => _parentProductsList;
|
||||||
|
|
||||||
|
//service four
|
||||||
|
List<SubCategoriesModel> _subCategoriseList = List();
|
||||||
|
List<SubCategoriesModel> get subCategoriseList => _subCategoriseList;
|
||||||
|
|
||||||
|
//service five
|
||||||
|
List<SubProductsModel> _subProductsList = List();
|
||||||
|
List<SubProductsModel> get subProductsList => _subProductsList;
|
||||||
|
|
||||||
|
//service six
|
||||||
|
List<FinalProductsModel> _finalProducts = List();
|
||||||
|
List<FinalProductsModel> get finalProducts => _finalProducts;
|
||||||
|
|
||||||
|
//service 7
|
||||||
|
|
||||||
|
List<BrandsModel> _brandsList = List();
|
||||||
|
List<BrandsModel> get brandsList => _brandsList;
|
||||||
|
|
||||||
|
// service 8
|
||||||
|
|
||||||
|
List<SearchProductsModel> _searchList = List();
|
||||||
|
List<SearchProductsModel> get searchList => _searchList;
|
||||||
|
|
||||||
|
List<ScanQrModel> _scanList = List();
|
||||||
|
List<ScanQrModel> get scanList => _scanList;
|
||||||
|
|
||||||
|
clearSearchList() {
|
||||||
|
_searchList.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getCategorise() async {
|
||||||
|
hasError = false;
|
||||||
|
_categoriseList.clear();
|
||||||
|
await baseAppClient.get(
|
||||||
|
GET_PHARMACY_CATEGORISE,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
response['categories'].forEach((item) {
|
||||||
|
_categoriseList.add(PharmacyCategorise.fromJson(item));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future scanQr({String id}) async {
|
||||||
|
hasError = false;
|
||||||
|
_scanList.clear();
|
||||||
|
String endPoint = id != null ? SCAN_QR_CODE + "$id" : SCAN_QR_CODE + "";
|
||||||
|
await baseAppClient.get(
|
||||||
|
endPoint,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
response['products'].forEach((item) {
|
||||||
|
_scanList.add(ScanQrModel.fromJson(item));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future searchProducts({String productName}) async {
|
||||||
|
hasError = false;
|
||||||
|
_searchList.clear();
|
||||||
|
String endPoint = productName != null
|
||||||
|
? GET_SEARCH_PRODUCTS + "$productName" + '&language_id=1'
|
||||||
|
: GET_SEARCH_PRODUCTS + "";
|
||||||
|
await baseAppClient.get(
|
||||||
|
endPoint,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
response['products'].forEach((item) {
|
||||||
|
_searchList.add(SearchProductsModel.fromJson(item));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getBrands() async {
|
||||||
|
hasError = false;
|
||||||
|
_brandsList.clear();
|
||||||
|
await baseAppClient.get(
|
||||||
|
GET_BRANDS_LIST,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
response['manufacturer'].forEach((item) {
|
||||||
|
_brandsList.add(BrandsModel.fromJson(item));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getCategoriseParent({String id}) async {
|
||||||
|
hasError = false;
|
||||||
|
_parentCategoriseList.clear();
|
||||||
|
String endPoint =
|
||||||
|
id != null ? GET_CATEGORISE_PARENT + "$id" : GET_CATEGORISE_PARENT + "";
|
||||||
|
await baseAppClient.get(
|
||||||
|
endPoint,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
response['categories'].forEach((item) {
|
||||||
|
_parentCategoriseList.add(CategoriseParentModel.fromJson(item));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getParentProducts({String id}) async {
|
||||||
|
hasError = false;
|
||||||
|
_parentProductsList.clear();
|
||||||
|
String endPoint = id != null
|
||||||
|
? GET_PARENT_PRODUCTS + "$id" + '&page=1&limit=50'
|
||||||
|
: GET_PARENT_PRODUCTS + "";
|
||||||
|
await baseAppClient.get(
|
||||||
|
endPoint,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
response['products'].forEach((item) {
|
||||||
|
_parentProductsList.add(ParentProductsModel.fromJson(item));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getSubCategorise({String id}) async {
|
||||||
|
hasError = false;
|
||||||
|
_subCategoriseList.clear();
|
||||||
|
|
||||||
|
String endPoint =
|
||||||
|
id != null ? GET_SUB_CATEGORISE + "$id" : GET_SUB_CATEGORISE + "";
|
||||||
|
await baseAppClient.get(
|
||||||
|
endPoint,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
response['categories'].forEach((item) {
|
||||||
|
_subCategoriseList.add(SubCategoriesModel.fromJson(item));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getSubProducts({String id}) async {
|
||||||
|
hasError = false;
|
||||||
|
_subProductsList.clear();
|
||||||
|
String endPoint = id != null
|
||||||
|
? GET_SUB_PRODUCTS + "$id" + '&page=1&limit=50'
|
||||||
|
: GET_SUB_PRODUCTS + "";
|
||||||
|
await baseAppClient.get(
|
||||||
|
endPoint,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
response['products'].forEach((item) {
|
||||||
|
_subProductsList.add(SubProductsModel.fromJson(item));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getFinalProducts({String id}) async {
|
||||||
|
hasError = false;
|
||||||
|
_finalProducts.clear();
|
||||||
|
String endPoint =
|
||||||
|
id != null ? GET_FINAL_PRODUCTS + "$id" : GET_FINAL_PRODUCTS + "";
|
||||||
|
await baseAppClient.get(
|
||||||
|
endPoint,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
response['products'].forEach((item) {
|
||||||
|
_finalProducts.add(FinalProductsModel.fromJson(item));
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,48 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/pharmacy/offer_products_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/pharmacy/offers_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/service/offers_service.dart';
|
||||||
|
import 'package:diplomaticquarterapp/locator.dart';
|
||||||
|
|
||||||
|
import 'base_view_model.dart';
|
||||||
|
|
||||||
|
class OffersCategoriseViewModel extends BaseViewModel {
|
||||||
|
bool hasError = false;
|
||||||
|
|
||||||
|
OffersCategoriseService _offersCategoriseService =
|
||||||
|
locator<OffersCategoriseService>();
|
||||||
|
List<OffersModel> get categorise => _offersCategoriseService.offersList;
|
||||||
|
|
||||||
|
List<OfferProductsModel> get products =>
|
||||||
|
_offersCategoriseService.offersProducts;
|
||||||
|
|
||||||
|
Future getOffersCategorise() async {
|
||||||
|
hasError = false;
|
||||||
|
_offersCategoriseService.clearCategorise();
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _offersCategoriseService.getOffersCategorise();
|
||||||
|
if (_offersCategoriseService.hasError) {
|
||||||
|
error = _offersCategoriseService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else
|
||||||
|
await getOffersProducts();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getOffersProducts({String i}) async {
|
||||||
|
hasError = false;
|
||||||
|
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _offersCategoriseService.getOffersProducts(id: i);
|
||||||
|
if (_offersCategoriseService.hasError) {
|
||||||
|
error = _offersCategoriseService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// await _offersCategoriseService.getOffersProducts();
|
||||||
|
// if (_offersCategoriseService.hasError) {
|
||||||
|
// error = _offersCategoriseService.error;
|
||||||
|
// setState(ViewState.ErrorLocal);
|
||||||
|
// } else
|
||||||
|
// setState(ViewState.Idle);
|
||||||
@ -0,0 +1,57 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/pharmacy/brandModel.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/pharmacy/topBrandsModel.dart';
|
||||||
|
import 'package:diplomaticquarterapp/services/pharmacy_services/brands_service.dart';
|
||||||
|
|
||||||
|
|
||||||
|
import '../../../locator.dart';
|
||||||
|
|
||||||
|
class BrandsViewModel extends BaseViewModel{
|
||||||
|
BrandsService _brandsService = locator<BrandsService>();
|
||||||
|
List<Brand> get brandsListList => _brandsService.brandsList;
|
||||||
|
|
||||||
|
BrandsService _topBrandsService = locator<BrandsService>();
|
||||||
|
List<TopBrand> get topBrandsListList => _topBrandsService.topBrandsList;
|
||||||
|
|
||||||
|
List<Brand> get searchList =>
|
||||||
|
_brandsService.searchList;
|
||||||
|
|
||||||
|
bool hasError = false;
|
||||||
|
|
||||||
|
|
||||||
|
Future getBrandsData() async {
|
||||||
|
hasError = false;
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _brandsService.getBrands();
|
||||||
|
if (_brandsService.hasError) {
|
||||||
|
error = _brandsService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getTopBrandsData() async {
|
||||||
|
hasError = false;
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _topBrandsService.getTopBrands();
|
||||||
|
if (_topBrandsService.hasError) {
|
||||||
|
error = _topBrandsService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Future searchProducts({String productName}) async {
|
||||||
|
hasError = false;
|
||||||
|
_brandsService.clearSearchList();
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _brandsService.searchProducts(productName: productName);
|
||||||
|
if (_brandsService.hasError) {
|
||||||
|
error = _brandsService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,110 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/pharmacy/Wishlist.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/pharmacy/locationModel.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/pharmacy/productDetailModel.dart';
|
||||||
|
import 'package:diplomaticquarterapp/services/pharmacy_services/product_detail_service.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/pharmacy/specification.dart';
|
||||||
|
|
||||||
|
|
||||||
|
import '../../../locator.dart';
|
||||||
|
|
||||||
|
class ProductDetailViewModel extends BaseViewModel{
|
||||||
|
ProductDetailService _productDetailService = locator<ProductDetailService>();
|
||||||
|
ProductDetailService _productLocationService = locator<ProductDetailService>();
|
||||||
|
ProductDetailService _productWishlistService = locator<ProductDetailService>();
|
||||||
|
ProductDetailService _productSpecification = locator<ProductDetailService>();
|
||||||
|
|
||||||
|
List<ProductDetail> get productDetailService => _productDetailService.productDetailList;
|
||||||
|
|
||||||
|
List<LocationModel> get productLocationService => _productLocationService.productLocationList;
|
||||||
|
|
||||||
|
List<Wishlist> get wishListItems => _productWishlistService.wishListProducts;
|
||||||
|
|
||||||
|
List<SpecificationModel> get productSpecification => _productSpecification.productSpecification;
|
||||||
|
|
||||||
|
bool hasError = false;
|
||||||
|
|
||||||
|
|
||||||
|
Future getProductReviewsData(productID) async {
|
||||||
|
print('ENAD REview');
|
||||||
|
hasError = false;
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _productDetailService.getProductReviews(productID);
|
||||||
|
if (_productDetailService.hasError) {
|
||||||
|
error = _productDetailService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getProductLocationData() async {
|
||||||
|
print('ENAD in model view');
|
||||||
|
hasError = false;
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _productLocationService.getProductAvailabiltyDetail();
|
||||||
|
if (_productLocationService.hasError) {
|
||||||
|
error = _productLocationService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future addToCartData(quantity, itemID) async {
|
||||||
|
hasError = false;
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _productLocationService.addToCart(quantity, itemID);
|
||||||
|
if (_productLocationService.hasError) {
|
||||||
|
error = _productLocationService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future addToWishlistData(itemID) async {
|
||||||
|
hasError = false;
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _productLocationService.addToWishlist(itemID);
|
||||||
|
if (_productLocationService.hasError) {
|
||||||
|
error = _productLocationService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future checkWishlistData() async {
|
||||||
|
hasError = false;
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _productWishlistService.getWishlistItems();
|
||||||
|
if (_productWishlistService.hasError) {
|
||||||
|
error = _productWishlistService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Future deletWishlistData(itemID) async {
|
||||||
|
hasError = false;
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _productWishlistService.delteItemFromWishlist(itemID);
|
||||||
|
if (_productWishlistService.hasError) {
|
||||||
|
error = _productWishlistService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Future productSpecificationData(itemID) async {
|
||||||
|
hasError = false;
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _productWishlistService.productSpecificationData(itemID);
|
||||||
|
if (_productWishlistService.hasError) {
|
||||||
|
error = _productWishlistService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,26 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/pharmacy/reviewModel.dart';
|
||||||
|
import 'package:diplomaticquarterapp/services/pharmacy_services/review_service.dart';
|
||||||
|
|
||||||
|
import '../../../locator.dart';
|
||||||
|
|
||||||
|
class ReviewViewModel extends BaseViewModel{
|
||||||
|
ReviewService _reviewService = locator<ReviewService>();
|
||||||
|
|
||||||
|
List<Review> get reviewListList => _reviewService.reviewList;
|
||||||
|
|
||||||
|
bool hasError = false;
|
||||||
|
|
||||||
|
|
||||||
|
Future getReviewData() async {
|
||||||
|
hasError = false;
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _reviewService.getReview();
|
||||||
|
if (_reviewService.hasError) {
|
||||||
|
error = _reviewService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/pharmacy/Wishlist.dart';
|
||||||
|
import 'package:diplomaticquarterapp/services/pharmacy_services/wishList_service.dart';
|
||||||
|
|
||||||
|
import '../../../locator.dart';
|
||||||
|
|
||||||
|
class WishListViewModel extends BaseViewModel{
|
||||||
|
WishListService _wishlistService = locator<WishListService>();
|
||||||
|
|
||||||
|
List<Wishlist> get wishListList => _wishlistService.wishListProducts;
|
||||||
|
bool hasError = false;
|
||||||
|
|
||||||
|
|
||||||
|
// Future getWishlistData() async {
|
||||||
|
// setState(ViewState.Busy);
|
||||||
|
// await _wishlistService.getWishlist();
|
||||||
|
// if (_wishlistService.hasError) {
|
||||||
|
// error = _wishlistService.error;
|
||||||
|
// setState(ViewState.Error);
|
||||||
|
// } else {
|
||||||
|
// setState(ViewState.Idle);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
Future getWishlistData() async {
|
||||||
|
hasError = false;
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _wishlistService.getWishlist();
|
||||||
|
if (_wishlistService.hasError) {
|
||||||
|
error = _wishlistService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,158 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/pharmacy/brands_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/pharmacy/categorise_parent_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/pharmacy/final_products_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/pharmacy/parent_products_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/pharmacy/pharmacy_categorise.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/pharmacy/scan_qr_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/pharmacy/sub_categories_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/pharmacy/sub_products_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/search_products_model.dart';
|
||||||
|
|
||||||
|
import 'package:diplomaticquarterapp/core/service/pharmacy_categorise_service.dart';
|
||||||
|
import 'package:diplomaticquarterapp/locator.dart';
|
||||||
|
|
||||||
|
import 'base_view_model.dart';
|
||||||
|
|
||||||
|
class PharmacyCategoriseViewModel extends BaseViewModel {
|
||||||
|
bool hasError = false;
|
||||||
|
PharmacyCategoriseService _pharmacyCategoriseService =
|
||||||
|
locator<PharmacyCategoriseService>();
|
||||||
|
|
||||||
|
List<PharmacyCategorise> get categorise =>
|
||||||
|
_pharmacyCategoriseService.categoriseList;
|
||||||
|
|
||||||
|
List<CategoriseParentModel> get categoriseParent =>
|
||||||
|
_pharmacyCategoriseService.parentCategoriseList;
|
||||||
|
|
||||||
|
List<ParentProductsModel> get parentProducts =>
|
||||||
|
_pharmacyCategoriseService.parentProductsList;
|
||||||
|
|
||||||
|
List<SubCategoriesModel> get subCategorise =>
|
||||||
|
_pharmacyCategoriseService.subCategoriseList;
|
||||||
|
|
||||||
|
List<SubProductsModel> get subProducts =>
|
||||||
|
_pharmacyCategoriseService.subProductsList;
|
||||||
|
|
||||||
|
List<FinalProductsModel> get finalProducts =>
|
||||||
|
_pharmacyCategoriseService.finalProducts;
|
||||||
|
List<BrandsModel> get brandsList => _pharmacyCategoriseService.brandsList;
|
||||||
|
|
||||||
|
List<SearchProductsModel> get searchList =>
|
||||||
|
_pharmacyCategoriseService.searchList;
|
||||||
|
|
||||||
|
List<ScanQrModel> get scanList => _pharmacyCategoriseService.scanList;
|
||||||
|
|
||||||
|
Future getCategorise() async {
|
||||||
|
hasError = false;
|
||||||
|
// _insuranceCardService.clearInsuranceCard();
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _pharmacyCategoriseService.getCategorise();
|
||||||
|
if (_pharmacyCategoriseService.hasError) {
|
||||||
|
error = _pharmacyCategoriseService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getBrands() async {
|
||||||
|
hasError = false;
|
||||||
|
// _insuranceCardService.clearInsuranceCard();
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _pharmacyCategoriseService.getBrands();
|
||||||
|
if (_pharmacyCategoriseService.hasError) {
|
||||||
|
error = _pharmacyCategoriseService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future scanQr({String id}) async {
|
||||||
|
hasError = false;
|
||||||
|
// _insuranceCardService.clearInsuranceCard();
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _pharmacyCategoriseService.scanQr(id: id);
|
||||||
|
if (_pharmacyCategoriseService.hasError) {
|
||||||
|
error = _pharmacyCategoriseService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
clearSearchList() {
|
||||||
|
_pharmacyCategoriseService.clearSearchList();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future searchProducts({String productName}) async {
|
||||||
|
hasError = false;
|
||||||
|
_pharmacyCategoriseService.clearSearchList();
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _pharmacyCategoriseService.searchProducts(productName: productName);
|
||||||
|
if (_pharmacyCategoriseService.hasError) {
|
||||||
|
error = _pharmacyCategoriseService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getCategoriseParent({String i}) async {
|
||||||
|
hasError = false;
|
||||||
|
// _insuranceCardService.clearInsuranceCard();
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _pharmacyCategoriseService.getCategoriseParent(id: i);
|
||||||
|
if (_pharmacyCategoriseService.hasError) {
|
||||||
|
error = _pharmacyCategoriseService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else
|
||||||
|
await getParentProducts(i: i);
|
||||||
|
await getBrands();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getParentProducts({String i}) async {
|
||||||
|
hasError = false;
|
||||||
|
// _insuranceCardService.clearInsuranceCard();
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _pharmacyCategoriseService.getParentProducts(id: i);
|
||||||
|
if (_pharmacyCategoriseService.hasError) {
|
||||||
|
error = _pharmacyCategoriseService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getSubCategorise({String i}) async {
|
||||||
|
hasError = false;
|
||||||
|
// _insuranceCardService.clearInsuranceCard();
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _pharmacyCategoriseService.getSubCategorise(id: i);
|
||||||
|
if (_pharmacyCategoriseService.hasError) {
|
||||||
|
error = _pharmacyCategoriseService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else
|
||||||
|
getSubProducts(i: i);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getSubProducts({String i}) async {
|
||||||
|
hasError = false;
|
||||||
|
// _insuranceCardService.clearInsuranceCard();
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _pharmacyCategoriseService.getSubProducts(id: i);
|
||||||
|
if (_pharmacyCategoriseService.hasError) {
|
||||||
|
error = _pharmacyCategoriseService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getFinalProducts({String i}) async {
|
||||||
|
hasError = false;
|
||||||
|
// _insuranceCardService.clearInsuranceCard();
|
||||||
|
setState(ViewState.Busy);
|
||||||
|
await _pharmacyCategoriseService.getFinalProducts(id: i);
|
||||||
|
if (_pharmacyCategoriseService.hasError) {
|
||||||
|
error = _pharmacyCategoriseService.error;
|
||||||
|
setState(ViewState.ErrorLocal);
|
||||||
|
} else
|
||||||
|
setState(ViewState.Idle);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,881 @@
|
|||||||
|
// To parse this JSON data, do
|
||||||
|
//
|
||||||
|
// final wishlist = wishlistFromJson(jsonString);
|
||||||
|
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
List<Wishlist> wishlistFromJson(String str) => List<Wishlist>.from(json.decode(str).map((x) => Wishlist.fromJson(x)));
|
||||||
|
|
||||||
|
String wishlistToJson(List<Wishlist> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
|
||||||
|
|
||||||
|
class Wishlist {
|
||||||
|
Wishlist({
|
||||||
|
this.languageId,
|
||||||
|
this.id,
|
||||||
|
this.productAttributes,
|
||||||
|
this.customerEnteredPrice,
|
||||||
|
this.quantity,
|
||||||
|
this.discountAmountInclTax,
|
||||||
|
this.subtotal,
|
||||||
|
this.subtotalWithVat,
|
||||||
|
this.subtotalVatAmount,
|
||||||
|
this.subtotalVatRate,
|
||||||
|
this.currency,
|
||||||
|
this.currencyn,
|
||||||
|
this.rentalStartDateUtc,
|
||||||
|
this.rentalEndDateUtc,
|
||||||
|
this.createdOnUtc,
|
||||||
|
this.updatedOnUtc,
|
||||||
|
this.shoppingCartType,
|
||||||
|
this.productId,
|
||||||
|
this.product,
|
||||||
|
this.customerId,
|
||||||
|
this.customer,
|
||||||
|
});
|
||||||
|
|
||||||
|
dynamic languageId;
|
||||||
|
dynamic id;
|
||||||
|
List<dynamic> productAttributes;
|
||||||
|
dynamic customerEnteredPrice;
|
||||||
|
dynamic quantity;
|
||||||
|
dynamic discountAmountInclTax;
|
||||||
|
dynamic subtotal;
|
||||||
|
dynamic subtotalWithVat;
|
||||||
|
dynamic subtotalVatAmount;
|
||||||
|
dynamic subtotalVatRate;
|
||||||
|
dynamic currency;
|
||||||
|
dynamic currencyn;
|
||||||
|
dynamic rentalStartDateUtc;
|
||||||
|
dynamic rentalEndDateUtc;
|
||||||
|
dynamic createdOnUtc;
|
||||||
|
dynamic updatedOnUtc;
|
||||||
|
dynamic shoppingCartType;
|
||||||
|
dynamic productId;
|
||||||
|
dynamic product;
|
||||||
|
dynamic customerId;
|
||||||
|
Customer customer;
|
||||||
|
|
||||||
|
factory Wishlist.fromJson(Map<String, dynamic> json) => Wishlist(
|
||||||
|
languageId: json["language_id"],
|
||||||
|
id: json["id"],
|
||||||
|
productAttributes: List<dynamic>.from(json["product_attributes"].map((x) => x)),
|
||||||
|
customerEnteredPrice: json["customer_entered_price"],
|
||||||
|
quantity: json["quantity"],
|
||||||
|
discountAmountInclTax: json["discount_amount_incl_tax"],
|
||||||
|
subtotal: json["subtotal"],
|
||||||
|
subtotalWithVat: json["subtotal_with_vat"],
|
||||||
|
subtotalVatAmount: json["subtotal_vat_amount"],
|
||||||
|
subtotalVatRate: json["subtotal_vat_rate"],
|
||||||
|
currency: json["currency"],
|
||||||
|
currencyn: json["currencyn"],
|
||||||
|
rentalStartDateUtc: json["rental_start_date_utc"],
|
||||||
|
rentalEndDateUtc: json["rental_end_date_utc"],
|
||||||
|
createdOnUtc: DateTime.parse(json["created_on_utc"]),
|
||||||
|
updatedOnUtc: DateTime.parse(json["updated_on_utc"]),
|
||||||
|
shoppingCartType: json["shopping_cart_type"],
|
||||||
|
productId: json["product_id"],
|
||||||
|
product: Product.fromJson(json["product"]),
|
||||||
|
customerId: json["customer_id"],
|
||||||
|
customer: Customer.fromJson(json["customer"]),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"language_id": languageId,
|
||||||
|
"id": id,
|
||||||
|
"product_attributes": List<dynamic>.from(productAttributes.map((x) => x)),
|
||||||
|
"customer_entered_price": customerEnteredPrice,
|
||||||
|
"quantity": quantity,
|
||||||
|
"discount_amount_incl_tax": discountAmountInclTax,
|
||||||
|
"subtotal": subtotal,
|
||||||
|
"subtotal_with_vat": subtotalWithVat,
|
||||||
|
"subtotal_vat_amount": subtotalVatAmount,
|
||||||
|
"subtotal_vat_rate": subtotalVatRate,
|
||||||
|
"currency": currency,
|
||||||
|
"currencyn": currencyn,
|
||||||
|
"rental_start_date_utc": rentalStartDateUtc,
|
||||||
|
"rental_end_date_utc": rentalEndDateUtc,
|
||||||
|
"created_on_utc": createdOnUtc.toIso8601String(),
|
||||||
|
"updated_on_utc": updatedOnUtc.toIso8601String(),
|
||||||
|
"shopping_cart_type": shoppingCartType,
|
||||||
|
"product_id": productId,
|
||||||
|
"product": product.toJson(),
|
||||||
|
"customer_id": customerId,
|
||||||
|
"customer": customer.toJson(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class Customer {
|
||||||
|
Customer({
|
||||||
|
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,
|
||||||
|
});
|
||||||
|
|
||||||
|
Address billingAddress;
|
||||||
|
Address shippingAddress;
|
||||||
|
List<Address> addresses;
|
||||||
|
String id;
|
||||||
|
String username;
|
||||||
|
String email;
|
||||||
|
dynamic firstName;
|
||||||
|
dynamic lastName;
|
||||||
|
dynamic languageId;
|
||||||
|
dynamic adminComment;
|
||||||
|
bool isTaxExempt;
|
||||||
|
bool hasShoppingCartItems;
|
||||||
|
bool active;
|
||||||
|
bool deleted;
|
||||||
|
bool isSystemAccount;
|
||||||
|
dynamic systemName;
|
||||||
|
String lastIpAddress;
|
||||||
|
DateTime createdOnUtc;
|
||||||
|
DateTime lastLoginDateUtc;
|
||||||
|
DateTime lastActivityDateUtc;
|
||||||
|
dynamic registeredInStoreId;
|
||||||
|
List<dynamic> roleIds;
|
||||||
|
|
||||||
|
factory Customer.fromJson(Map<String, dynamic> json) => Customer(
|
||||||
|
billingAddress: Address.fromJson(json["billing_address"]),
|
||||||
|
shippingAddress: Address.fromJson(json["shipping_address"]),
|
||||||
|
addresses: List<Address>.from(json["addresses"].map((x) => Address.fromJson(x))),
|
||||||
|
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: DateTime.parse(json["created_on_utc"]),
|
||||||
|
lastLoginDateUtc: DateTime.parse(json["last_login_date_utc"]),
|
||||||
|
lastActivityDateUtc: DateTime.parse(json["last_activity_date_utc"]),
|
||||||
|
registeredInStoreId: json["registered_in_store_id"],
|
||||||
|
roleIds: List<dynamic>.from(json["role_ids"].map((x) => x)),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"billing_address": billingAddress.toJson(),
|
||||||
|
"shipping_address": shippingAddress.toJson(),
|
||||||
|
"addresses": List<dynamic>.from(addresses.map((x) => x.toJson())),
|
||||||
|
"id": id,
|
||||||
|
"username": username,
|
||||||
|
"email": email,
|
||||||
|
"first_name": firstName,
|
||||||
|
"last_name": lastName,
|
||||||
|
"language_id": languageId,
|
||||||
|
"admin_comment": adminComment,
|
||||||
|
"is_tax_exempt": isTaxExempt,
|
||||||
|
"has_shopping_cart_items": hasShoppingCartItems,
|
||||||
|
"active": active,
|
||||||
|
"deleted": deleted,
|
||||||
|
"is_system_account": isSystemAccount,
|
||||||
|
"system_name": systemName,
|
||||||
|
"last_ip_address": lastIpAddress,
|
||||||
|
"created_on_utc": createdOnUtc.toIso8601String(),
|
||||||
|
"last_login_date_utc": lastLoginDateUtc.toIso8601String(),
|
||||||
|
"last_activity_date_utc": lastActivityDateUtc.toIso8601String(),
|
||||||
|
"registered_in_store_id": registeredInStoreId,
|
||||||
|
"role_ids": List<dynamic>.from(roleIds.map((x) => x)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class Address {
|
||||||
|
Address({
|
||||||
|
this.id,
|
||||||
|
this.firstName,
|
||||||
|
this.lastName,
|
||||||
|
this.email,
|
||||||
|
this.company,
|
||||||
|
this.countryId,
|
||||||
|
this.country,
|
||||||
|
this.stateProvinceId,
|
||||||
|
this.city,
|
||||||
|
this.address1,
|
||||||
|
this.address2,
|
||||||
|
this.zipPostalCode,
|
||||||
|
this.phoneNumber,
|
||||||
|
this.faxNumber,
|
||||||
|
this.customerAttributes,
|
||||||
|
this.createdOnUtc,
|
||||||
|
this.province,
|
||||||
|
this.latLong,
|
||||||
|
});
|
||||||
|
|
||||||
|
String id;
|
||||||
|
FirstName firstName;
|
||||||
|
LastName lastName;
|
||||||
|
Email email;
|
||||||
|
dynamic company;
|
||||||
|
dynamic countryId;
|
||||||
|
Country country;
|
||||||
|
dynamic stateProvinceId;
|
||||||
|
City city;
|
||||||
|
String address1;
|
||||||
|
String address2;
|
||||||
|
String zipPostalCode;
|
||||||
|
String phoneNumber;
|
||||||
|
dynamic faxNumber;
|
||||||
|
String customerAttributes;
|
||||||
|
DateTime createdOnUtc;
|
||||||
|
dynamic province;
|
||||||
|
String latLong;
|
||||||
|
|
||||||
|
factory Address.fromJson(Map<String, dynamic> json) => Address(
|
||||||
|
id: json["id"],
|
||||||
|
firstName: firstNameValues.map[json["first_name"]],
|
||||||
|
lastName: lastNameValues.map[json["last_name"]],
|
||||||
|
email: emailValues.map[json["email"]],
|
||||||
|
company: json["company"],
|
||||||
|
countryId: json["country_id"],
|
||||||
|
country: countryValues.map[json["country"]],
|
||||||
|
stateProvinceId: json["state_province_id"],
|
||||||
|
city: cityValues.map[json["city"]],
|
||||||
|
address1: json["address1"],
|
||||||
|
address2: json["address2"],
|
||||||
|
zipPostalCode: json["zip_postal_code"],
|
||||||
|
phoneNumber: json["phone_number"],
|
||||||
|
faxNumber: json["fax_number"],
|
||||||
|
customerAttributes: json["customer_attributes"],
|
||||||
|
createdOnUtc: DateTime.parse(json["created_on_utc"]),
|
||||||
|
province: json["province"],
|
||||||
|
latLong: json["lat_long"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"id": id,
|
||||||
|
"first_name": firstNameValues.reverse[firstName],
|
||||||
|
"last_name": lastNameValues.reverse[lastName],
|
||||||
|
"email": emailValues.reverse[email],
|
||||||
|
"company": company,
|
||||||
|
"country_id": countryId,
|
||||||
|
"country": countryValues.reverse[country],
|
||||||
|
"state_province_id": stateProvinceId,
|
||||||
|
"city": cityValues.reverse[city],
|
||||||
|
"address1": address1,
|
||||||
|
"address2": address2,
|
||||||
|
"zip_postal_code": zipPostalCode,
|
||||||
|
"phone_number": phoneNumber,
|
||||||
|
"fax_number": faxNumber,
|
||||||
|
"customer_attributes": customerAttributes,
|
||||||
|
"created_on_utc": createdOnUtc.toIso8601String(),
|
||||||
|
"province": province,
|
||||||
|
"lat_long": latLong,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
enum City { RIYADH, AL_OYUN }
|
||||||
|
|
||||||
|
final cityValues = EnumValues({
|
||||||
|
"Al Oyun": City.AL_OYUN,
|
||||||
|
"Riyadh": City.RIYADH
|
||||||
|
});
|
||||||
|
|
||||||
|
enum Country { SAUDI_ARABIA }
|
||||||
|
|
||||||
|
final countryValues = EnumValues({
|
||||||
|
"Saudi Arabia": Country.SAUDI_ARABIA
|
||||||
|
});
|
||||||
|
|
||||||
|
enum Email { TAMER_FANASHEH_GMAIL_COM, TAMER_DASDASDAS_GMAIL_COM }
|
||||||
|
|
||||||
|
final emailValues = EnumValues({
|
||||||
|
"Tamer.dasdasdas@gmail.com": Email.TAMER_DASDASDAS_GMAIL_COM,
|
||||||
|
"Tamer.fanasheh@gmail.com": Email.TAMER_FANASHEH_GMAIL_COM
|
||||||
|
});
|
||||||
|
|
||||||
|
enum FirstName { TAMER, TAMER_FANASHEH }
|
||||||
|
|
||||||
|
final firstNameValues = EnumValues({
|
||||||
|
"TAMER": FirstName.TAMER,
|
||||||
|
"TAMER FANASHEH": FirstName.TAMER_FANASHEH
|
||||||
|
});
|
||||||
|
|
||||||
|
enum LastName { FANASHEH, MUSA }
|
||||||
|
|
||||||
|
final lastNameValues = EnumValues({
|
||||||
|
"FANASHEH": LastName.FANASHEH,
|
||||||
|
"MUSA": LastName.MUSA
|
||||||
|
});
|
||||||
|
|
||||||
|
class Product {
|
||||||
|
Product({
|
||||||
|
this.id,
|
||||||
|
this.visibleIndividually,
|
||||||
|
this.name,
|
||||||
|
this.namen,
|
||||||
|
this.localizedNames,
|
||||||
|
this.shortDescription,
|
||||||
|
this.shortDescriptionn,
|
||||||
|
this.fullDescription,
|
||||||
|
this.fullDescriptionn,
|
||||||
|
this.markasNew,
|
||||||
|
this.showOnHomePage,
|
||||||
|
this.metaKeywords,
|
||||||
|
this.metaDescription,
|
||||||
|
this.metaTitle,
|
||||||
|
this.allowCustomerReviews,
|
||||||
|
this.approvedRatingSum,
|
||||||
|
this.notApprovedRatingSum,
|
||||||
|
this.approvedTotalReviews,
|
||||||
|
this.notApprovedTotalReviews,
|
||||||
|
this.sku,
|
||||||
|
this.isRx,
|
||||||
|
this.prescriptionRequired,
|
||||||
|
this.rxMessage,
|
||||||
|
this.rxMessagen,
|
||||||
|
this.manufacturerPartNumber,
|
||||||
|
this.gtin,
|
||||||
|
this.isGiftCard,
|
||||||
|
this.requireOtherProducts,
|
||||||
|
this.automaticallyAddRequiredProducts,
|
||||||
|
this.isDownload,
|
||||||
|
this.unlimitedDownloads,
|
||||||
|
this.maxNumberOfDownloads,
|
||||||
|
this.downloadExpirationDays,
|
||||||
|
this.hasSampleDownload,
|
||||||
|
this.hasUserAgreement,
|
||||||
|
this.isRecurring,
|
||||||
|
this.recurringCycleLength,
|
||||||
|
this.recurringTotalCycles,
|
||||||
|
this.isRental,
|
||||||
|
this.rentalPriceLength,
|
||||||
|
this.isShipEnabled,
|
||||||
|
this.isFreeShipping,
|
||||||
|
this.shipSeparately,
|
||||||
|
this.additionalShippingCharge,
|
||||||
|
this.isTaxExempt,
|
||||||
|
this.isTelecommunicationsOrBroadcastingOrElectronicServices,
|
||||||
|
this.useMultipleWarehouses,
|
||||||
|
this.manageInventoryMethodId,
|
||||||
|
this.stockQuantity,
|
||||||
|
this.stockAvailability,
|
||||||
|
this.stockAvailabilityn,
|
||||||
|
this.displayStockAvailability,
|
||||||
|
this.displayStockQuantity,
|
||||||
|
this.minStockQuantity,
|
||||||
|
this.notifyAdminForQuantityBelow,
|
||||||
|
this.allowBackInStockSubscriptions,
|
||||||
|
this.orderMinimumQuantity,
|
||||||
|
this.orderMaximumQuantity,
|
||||||
|
this.allowedQuantities,
|
||||||
|
this.allowAddingOnlyExistingAttributeCombinations,
|
||||||
|
this.disableBuyButton,
|
||||||
|
this.disableWishlistButton,
|
||||||
|
this.availableForPreOrder,
|
||||||
|
this.preOrderAvailabilityStartDateTimeUtc,
|
||||||
|
this.callForPrice,
|
||||||
|
this.price,
|
||||||
|
this.oldPrice,
|
||||||
|
this.productCost,
|
||||||
|
this.specialPrice,
|
||||||
|
this.specialPriceStartDateTimeUtc,
|
||||||
|
this.specialPriceEndDateTimeUtc,
|
||||||
|
this.customerEntersPrice,
|
||||||
|
this.minimumCustomerEnteredPrice,
|
||||||
|
this.maximumCustomerEnteredPrice,
|
||||||
|
this.basepriceEnabled,
|
||||||
|
this.basepriceAmount,
|
||||||
|
this.basepriceBaseAmount,
|
||||||
|
this.hasTierPrices,
|
||||||
|
this.hasDiscountsApplied,
|
||||||
|
this.discountName,
|
||||||
|
this.discountNamen,
|
||||||
|
this.discountDescription,
|
||||||
|
this.discountDescriptionn,
|
||||||
|
this.discountPercentage,
|
||||||
|
this.currency,
|
||||||
|
this.currencyn,
|
||||||
|
this.weight,
|
||||||
|
this.length,
|
||||||
|
this.width,
|
||||||
|
this.height,
|
||||||
|
this.availableStartDateTimeUtc,
|
||||||
|
this.availableEndDateTimeUtc,
|
||||||
|
this.displayOrder,
|
||||||
|
this.published,
|
||||||
|
this.deleted,
|
||||||
|
this.createdOnUtc,
|
||||||
|
this.updatedOnUtc,
|
||||||
|
this.productType,
|
||||||
|
this.parentGroupedProductId,
|
||||||
|
this.roleIds,
|
||||||
|
this.discountIds,
|
||||||
|
this.storeIds,
|
||||||
|
this.manufacturerIds,
|
||||||
|
this.reviews,
|
||||||
|
this.images,
|
||||||
|
this.attributes,
|
||||||
|
this.specifications,
|
||||||
|
this.associatedProductIds,
|
||||||
|
this.tags,
|
||||||
|
this.vendorId,
|
||||||
|
this.seName,
|
||||||
|
});
|
||||||
|
|
||||||
|
String id;
|
||||||
|
bool visibleIndividually;
|
||||||
|
String name;
|
||||||
|
String namen;
|
||||||
|
List<LocalizedName> localizedNames;
|
||||||
|
String shortDescription;
|
||||||
|
String shortDescriptionn;
|
||||||
|
String fullDescription;
|
||||||
|
String fullDescriptionn;
|
||||||
|
bool markasNew;
|
||||||
|
bool showOnHomePage;
|
||||||
|
dynamic metaKeywords;
|
||||||
|
dynamic metaDescription;
|
||||||
|
dynamic metaTitle;
|
||||||
|
bool allowCustomerReviews;
|
||||||
|
dynamic approvedRatingSum;
|
||||||
|
dynamic notApprovedRatingSum;
|
||||||
|
dynamic approvedTotalReviews;
|
||||||
|
dynamic notApprovedTotalReviews;
|
||||||
|
String sku;
|
||||||
|
bool isRx;
|
||||||
|
bool prescriptionRequired;
|
||||||
|
dynamic rxMessage;
|
||||||
|
dynamic rxMessagen;
|
||||||
|
dynamic manufacturerPartNumber;
|
||||||
|
dynamic gtin;
|
||||||
|
bool isGiftCard;
|
||||||
|
bool requireOtherProducts;
|
||||||
|
bool automaticallyAddRequiredProducts;
|
||||||
|
bool isDownload;
|
||||||
|
bool unlimitedDownloads;
|
||||||
|
dynamic maxNumberOfDownloads;
|
||||||
|
dynamic downloadExpirationDays;
|
||||||
|
bool hasSampleDownload;
|
||||||
|
bool hasUserAgreement;
|
||||||
|
bool isRecurring;
|
||||||
|
dynamic recurringCycleLength;
|
||||||
|
dynamic recurringTotalCycles;
|
||||||
|
bool isRental;
|
||||||
|
dynamic rentalPriceLength;
|
||||||
|
bool isShipEnabled;
|
||||||
|
bool isFreeShipping;
|
||||||
|
bool shipSeparately;
|
||||||
|
dynamic additionalShippingCharge;
|
||||||
|
bool isTaxExempt;
|
||||||
|
bool isTelecommunicationsOrBroadcastingOrElectronicServices;
|
||||||
|
bool useMultipleWarehouses;
|
||||||
|
dynamic manageInventoryMethodId;
|
||||||
|
dynamic stockQuantity;
|
||||||
|
String stockAvailability;
|
||||||
|
String stockAvailabilityn;
|
||||||
|
bool displayStockAvailability;
|
||||||
|
bool displayStockQuantity;
|
||||||
|
dynamic minStockQuantity;
|
||||||
|
dynamic notifyAdminForQuantityBelow;
|
||||||
|
bool allowBackInStockSubscriptions;
|
||||||
|
dynamic orderMinimumQuantity;
|
||||||
|
dynamic orderMaximumQuantity;
|
||||||
|
dynamic allowedQuantities;
|
||||||
|
bool allowAddingOnlyExistingAttributeCombinations;
|
||||||
|
bool disableBuyButton;
|
||||||
|
bool disableWishlistButton;
|
||||||
|
bool availableForPreOrder;
|
||||||
|
dynamic preOrderAvailabilityStartDateTimeUtc;
|
||||||
|
bool callForPrice;
|
||||||
|
double price;
|
||||||
|
dynamic oldPrice;
|
||||||
|
double productCost;
|
||||||
|
dynamic specialPrice;
|
||||||
|
dynamic specialPriceStartDateTimeUtc;
|
||||||
|
dynamic specialPriceEndDateTimeUtc;
|
||||||
|
bool customerEntersPrice;
|
||||||
|
dynamic minimumCustomerEnteredPrice;
|
||||||
|
dynamic maximumCustomerEnteredPrice;
|
||||||
|
bool basepriceEnabled;
|
||||||
|
dynamic basepriceAmount;
|
||||||
|
dynamic basepriceBaseAmount;
|
||||||
|
bool hasTierPrices;
|
||||||
|
bool hasDiscountsApplied;
|
||||||
|
dynamic discountName;
|
||||||
|
dynamic discountNamen;
|
||||||
|
dynamic discountDescription;
|
||||||
|
dynamic discountDescriptionn;
|
||||||
|
dynamic discountPercentage;
|
||||||
|
String currency;
|
||||||
|
String currencyn;
|
||||||
|
double weight;
|
||||||
|
dynamic length;
|
||||||
|
dynamic width;
|
||||||
|
dynamic height;
|
||||||
|
dynamic availableStartDateTimeUtc;
|
||||||
|
dynamic availableEndDateTimeUtc;
|
||||||
|
dynamic displayOrder;
|
||||||
|
bool published;
|
||||||
|
bool deleted;
|
||||||
|
DateTime createdOnUtc;
|
||||||
|
DateTime updatedOnUtc;
|
||||||
|
String productType;
|
||||||
|
dynamic parentGroupedProductId;
|
||||||
|
List<dynamic> roleIds;
|
||||||
|
List<dynamic> discountIds;
|
||||||
|
List<dynamic> storeIds;
|
||||||
|
List<dynamic> manufacturerIds;
|
||||||
|
List<dynamic> reviews;
|
||||||
|
List<Image> images;
|
||||||
|
List<dynamic> attributes;
|
||||||
|
List<Specification> specifications;
|
||||||
|
List<dynamic> associatedProductIds;
|
||||||
|
List<dynamic> tags;
|
||||||
|
dynamic vendorId;
|
||||||
|
String seName;
|
||||||
|
|
||||||
|
factory Product.fromJson(Map<String, dynamic> json) => Product(
|
||||||
|
id: json["id"],
|
||||||
|
visibleIndividually: json["visible_individually"],
|
||||||
|
name: json["name"],
|
||||||
|
namen: json["namen"],
|
||||||
|
localizedNames: List<LocalizedName>.from(json["localized_names"].map((x) => LocalizedName.fromJson(x))),
|
||||||
|
shortDescription: json["short_description"],
|
||||||
|
shortDescriptionn: json["short_descriptionn"],
|
||||||
|
fullDescription: json["full_description"],
|
||||||
|
fullDescriptionn: json["full_descriptionn"],
|
||||||
|
markasNew: json["markas_new"],
|
||||||
|
showOnHomePage: json["show_on_home_page"],
|
||||||
|
metaKeywords: json["meta_keywords"],
|
||||||
|
metaDescription: json["meta_description"],
|
||||||
|
metaTitle: json["meta_title"],
|
||||||
|
allowCustomerReviews: json["allow_customer_reviews"],
|
||||||
|
approvedRatingSum: json["approved_rating_sum"],
|
||||||
|
notApprovedRatingSum: json["not_approved_rating_sum"],
|
||||||
|
approvedTotalReviews: json["approved_total_reviews"],
|
||||||
|
notApprovedTotalReviews: json["not_approved_total_reviews"],
|
||||||
|
sku: json["sku"],
|
||||||
|
isRx: json["is_rx"],
|
||||||
|
prescriptionRequired: json["prescription_required"],
|
||||||
|
rxMessage: json["rx_message"],
|
||||||
|
rxMessagen: json["rx_messagen"],
|
||||||
|
manufacturerPartNumber: json["manufacturer_part_number"],
|
||||||
|
gtin: json["gtin"],
|
||||||
|
isGiftCard: json["is_gift_card"],
|
||||||
|
requireOtherProducts: json["require_other_products"],
|
||||||
|
automaticallyAddRequiredProducts: json["automatically_add_required_products"],
|
||||||
|
isDownload: json["is_download"],
|
||||||
|
unlimitedDownloads: json["unlimited_downloads"],
|
||||||
|
maxNumberOfDownloads: json["max_number_of_downloads"],
|
||||||
|
downloadExpirationDays: json["download_expiration_days"],
|
||||||
|
hasSampleDownload: json["has_sample_download"],
|
||||||
|
hasUserAgreement: json["has_user_agreement"],
|
||||||
|
isRecurring: json["is_recurring"],
|
||||||
|
recurringCycleLength: json["recurring_cycle_length"],
|
||||||
|
recurringTotalCycles: json["recurring_total_cycles"],
|
||||||
|
isRental: json["is_rental"],
|
||||||
|
rentalPriceLength: json["rental_price_length"],
|
||||||
|
isShipEnabled: json["is_ship_enabled"],
|
||||||
|
isFreeShipping: json["is_free_shipping"],
|
||||||
|
shipSeparately: json["ship_separately"],
|
||||||
|
additionalShippingCharge: json["additional_shipping_charge"],
|
||||||
|
isTaxExempt: json["is_tax_exempt"],
|
||||||
|
isTelecommunicationsOrBroadcastingOrElectronicServices: json["is_telecommunications_or_broadcasting_or_electronic_services"],
|
||||||
|
useMultipleWarehouses: json["use_multiple_warehouses"],
|
||||||
|
manageInventoryMethodId: json["manage_inventory_method_id"],
|
||||||
|
stockQuantity: json["stock_quantity"],
|
||||||
|
stockAvailability: json["stock_availability"],
|
||||||
|
stockAvailabilityn: json["stock_availabilityn"],
|
||||||
|
displayStockAvailability: json["display_stock_availability"],
|
||||||
|
displayStockQuantity: json["display_stock_quantity"],
|
||||||
|
minStockQuantity: json["min_stock_quantity"],
|
||||||
|
notifyAdminForQuantityBelow: json["notify_admin_for_quantity_below"],
|
||||||
|
allowBackInStockSubscriptions: json["allow_back_in_stock_subscriptions"],
|
||||||
|
orderMinimumQuantity: json["order_minimum_quantity"],
|
||||||
|
orderMaximumQuantity: json["order_maximum_quantity"],
|
||||||
|
allowedQuantities: json["allowed_quantities"],
|
||||||
|
allowAddingOnlyExistingAttributeCombinations: json["allow_adding_only_existing_attribute_combinations"],
|
||||||
|
disableBuyButton: json["disable_buy_button"],
|
||||||
|
disableWishlistButton: json["disable_wishlist_button"],
|
||||||
|
availableForPreOrder: json["available_for_pre_order"],
|
||||||
|
preOrderAvailabilityStartDateTimeUtc: json["pre_order_availability_start_date_time_utc"],
|
||||||
|
callForPrice: json["call_for_price"],
|
||||||
|
price: json["price"].toDouble(),
|
||||||
|
oldPrice: json["old_price"],
|
||||||
|
productCost: json["product_cost"].toDouble(),
|
||||||
|
specialPrice: json["special_price"],
|
||||||
|
specialPriceStartDateTimeUtc: json["special_price_start_date_time_utc"],
|
||||||
|
specialPriceEndDateTimeUtc: json["special_price_end_date_time_utc"],
|
||||||
|
customerEntersPrice: json["customer_enters_price"],
|
||||||
|
minimumCustomerEnteredPrice: json["minimum_customer_entered_price"],
|
||||||
|
maximumCustomerEnteredPrice: json["maximum_customer_entered_price"],
|
||||||
|
basepriceEnabled: json["baseprice_enabled"],
|
||||||
|
basepriceAmount: json["baseprice_amount"],
|
||||||
|
basepriceBaseAmount: json["baseprice_base_amount"],
|
||||||
|
hasTierPrices: json["has_tier_prices"],
|
||||||
|
hasDiscountsApplied: json["has_discounts_applied"],
|
||||||
|
discountName: json["discount_name"],
|
||||||
|
discountNamen: json["discount_namen"],
|
||||||
|
discountDescription: json["discount_description"],
|
||||||
|
discountDescriptionn: json["discount_Descriptionn"],
|
||||||
|
discountPercentage: json["discount_percentage"],
|
||||||
|
currency: json["currency"],
|
||||||
|
currencyn: json["currencyn"],
|
||||||
|
weight: json["weight"].toDouble(),
|
||||||
|
length: json["length"],
|
||||||
|
width: json["width"],
|
||||||
|
height: json["height"],
|
||||||
|
availableStartDateTimeUtc: json["available_start_date_time_utc"],
|
||||||
|
availableEndDateTimeUtc: json["available_end_date_time_utc"],
|
||||||
|
displayOrder: json["display_order"],
|
||||||
|
published: json["published"],
|
||||||
|
deleted: json["deleted"],
|
||||||
|
createdOnUtc: DateTime.parse(json["created_on_utc"]),
|
||||||
|
updatedOnUtc: DateTime.parse(json["updated_on_utc"]),
|
||||||
|
productType: json["product_type"],
|
||||||
|
parentGroupedProductId: json["parent_grouped_product_id"],
|
||||||
|
roleIds: List<dynamic>.from(json["role_ids"].map((x) => x)),
|
||||||
|
discountIds: List<dynamic>.from(json["discount_ids"].map((x) => x)),
|
||||||
|
storeIds: List<dynamic>.from(json["store_ids"].map((x) => x)),
|
||||||
|
manufacturerIds: List<int>.from(json["manufacturer_ids"].map((x) => x)),
|
||||||
|
reviews: List<dynamic>.from(json["reviews"].map((x) => x)),
|
||||||
|
images: List<Image>.from(json["images"].map((x) => Image.fromJson(x))),
|
||||||
|
attributes: List<dynamic>.from(json["attributes"].map((x) => x)),
|
||||||
|
specifications: List<Specification>.from(json["specifications"].map((x) => Specification.fromJson(x))),
|
||||||
|
associatedProductIds: List<dynamic>.from(json["associated_product_ids"].map((x) => x)),
|
||||||
|
tags: List<dynamic>.from(json["tags"].map((x) => x)),
|
||||||
|
vendorId: json["vendor_id"],
|
||||||
|
seName: json["se_name"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"id": id,
|
||||||
|
"visible_individually": visibleIndividually,
|
||||||
|
"name": name,
|
||||||
|
"namen": namen,
|
||||||
|
"localized_names": List<dynamic>.from(localizedNames.map((x) => x.toJson())),
|
||||||
|
"short_description": shortDescription,
|
||||||
|
"short_descriptionn": shortDescriptionn,
|
||||||
|
"full_description": fullDescription,
|
||||||
|
"full_descriptionn": fullDescriptionn,
|
||||||
|
"markas_new": markasNew,
|
||||||
|
"show_on_home_page": showOnHomePage,
|
||||||
|
"meta_keywords": metaKeywords,
|
||||||
|
"meta_description": metaDescription,
|
||||||
|
"meta_title": metaTitle,
|
||||||
|
"allow_customer_reviews": allowCustomerReviews,
|
||||||
|
"approved_rating_sum": approvedRatingSum,
|
||||||
|
"not_approved_rating_sum": notApprovedRatingSum,
|
||||||
|
"approved_total_reviews": approvedTotalReviews,
|
||||||
|
"not_approved_total_reviews": notApprovedTotalReviews,
|
||||||
|
"sku": sku,
|
||||||
|
"is_rx": isRx,
|
||||||
|
"prescription_required": prescriptionRequired,
|
||||||
|
"rx_message": rxMessage,
|
||||||
|
"rx_messagen": rxMessagen,
|
||||||
|
"manufacturer_part_number": manufacturerPartNumber,
|
||||||
|
"gtin": gtin,
|
||||||
|
"is_gift_card": isGiftCard,
|
||||||
|
"require_other_products": requireOtherProducts,
|
||||||
|
"automatically_add_required_products": automaticallyAddRequiredProducts,
|
||||||
|
"is_download": isDownload,
|
||||||
|
"unlimited_downloads": unlimitedDownloads,
|
||||||
|
"max_number_of_downloads": maxNumberOfDownloads,
|
||||||
|
"download_expiration_days": downloadExpirationDays,
|
||||||
|
"has_sample_download": hasSampleDownload,
|
||||||
|
"has_user_agreement": hasUserAgreement,
|
||||||
|
"is_recurring": isRecurring,
|
||||||
|
"recurring_cycle_length": recurringCycleLength,
|
||||||
|
"recurring_total_cycles": recurringTotalCycles,
|
||||||
|
"is_rental": isRental,
|
||||||
|
"rental_price_length": rentalPriceLength,
|
||||||
|
"is_ship_enabled": isShipEnabled,
|
||||||
|
"is_free_shipping": isFreeShipping,
|
||||||
|
"ship_separately": shipSeparately,
|
||||||
|
"additional_shipping_charge": additionalShippingCharge,
|
||||||
|
"is_tax_exempt": isTaxExempt,
|
||||||
|
"is_telecommunications_or_broadcasting_or_electronic_services": isTelecommunicationsOrBroadcastingOrElectronicServices,
|
||||||
|
"use_multiple_warehouses": useMultipleWarehouses,
|
||||||
|
"manage_inventory_method_id": manageInventoryMethodId,
|
||||||
|
"stock_quantity": stockQuantity,
|
||||||
|
"stock_availability": stockAvailability,
|
||||||
|
"stock_availabilityn": stockAvailabilityn,
|
||||||
|
"display_stock_availability": displayStockAvailability,
|
||||||
|
"display_stock_quantity": displayStockQuantity,
|
||||||
|
"min_stock_quantity": minStockQuantity,
|
||||||
|
"notify_admin_for_quantity_below": notifyAdminForQuantityBelow,
|
||||||
|
"allow_back_in_stock_subscriptions": allowBackInStockSubscriptions,
|
||||||
|
"order_minimum_quantity": orderMinimumQuantity,
|
||||||
|
"order_maximum_quantity": orderMaximumQuantity,
|
||||||
|
"allowed_quantities": allowedQuantities,
|
||||||
|
"allow_adding_only_existing_attribute_combinations": allowAddingOnlyExistingAttributeCombinations,
|
||||||
|
"disable_buy_button": disableBuyButton,
|
||||||
|
"disable_wishlist_button": disableWishlistButton,
|
||||||
|
"available_for_pre_order": availableForPreOrder,
|
||||||
|
"pre_order_availability_start_date_time_utc": preOrderAvailabilityStartDateTimeUtc,
|
||||||
|
"call_for_price": callForPrice,
|
||||||
|
"price": price,
|
||||||
|
"old_price": oldPrice,
|
||||||
|
"product_cost": productCost,
|
||||||
|
"special_price": specialPrice,
|
||||||
|
"special_price_start_date_time_utc": specialPriceStartDateTimeUtc,
|
||||||
|
"special_price_end_date_time_utc": specialPriceEndDateTimeUtc,
|
||||||
|
"customer_enters_price": customerEntersPrice,
|
||||||
|
"minimum_customer_entered_price": minimumCustomerEnteredPrice,
|
||||||
|
"maximum_customer_entered_price": maximumCustomerEnteredPrice,
|
||||||
|
"baseprice_enabled": basepriceEnabled,
|
||||||
|
"baseprice_amount": basepriceAmount,
|
||||||
|
"baseprice_base_amount": basepriceBaseAmount,
|
||||||
|
"has_tier_prices": hasTierPrices,
|
||||||
|
"has_discounts_applied": hasDiscountsApplied,
|
||||||
|
"discount_name": discountName,
|
||||||
|
"discount_namen": discountNamen,
|
||||||
|
"discount_description": discountDescription,
|
||||||
|
"discount_Descriptionn": discountDescriptionn,
|
||||||
|
"discount_percentage": discountPercentage,
|
||||||
|
"currency": currency,
|
||||||
|
"currencyn": currencyn,
|
||||||
|
"weight": weight,
|
||||||
|
"length": length,
|
||||||
|
"width": width,
|
||||||
|
"height": height,
|
||||||
|
"available_start_date_time_utc": availableStartDateTimeUtc,
|
||||||
|
"available_end_date_time_utc": availableEndDateTimeUtc,
|
||||||
|
"display_order": displayOrder,
|
||||||
|
"published": published,
|
||||||
|
"deleted": deleted,
|
||||||
|
"created_on_utc": createdOnUtc.toIso8601String(),
|
||||||
|
"updated_on_utc": updatedOnUtc.toIso8601String(),
|
||||||
|
"product_type": productType,
|
||||||
|
"parent_grouped_product_id": parentGroupedProductId,
|
||||||
|
"role_ids": List<dynamic>.from(roleIds.map((x) => x)),
|
||||||
|
"discount_ids": List<dynamic>.from(discountIds.map((x) => x)),
|
||||||
|
"store_ids": List<dynamic>.from(storeIds.map((x) => x)),
|
||||||
|
"manufacturer_ids": List<dynamic>.from(manufacturerIds.map((x) => x)),
|
||||||
|
"reviews": List<dynamic>.from(reviews.map((x) => x)),
|
||||||
|
"images": List<dynamic>.from(images.map((x) => x.toJson())),
|
||||||
|
"attributes": List<dynamic>.from(attributes.map((x) => x)),
|
||||||
|
"specifications": List<dynamic>.from(specifications.map((x) => x.toJson())),
|
||||||
|
"associated_product_ids": List<dynamic>.from(associatedProductIds.map((x) => x)),
|
||||||
|
"tags": List<dynamic>.from(tags.map((x) => x)),
|
||||||
|
"vendor_id": vendorId,
|
||||||
|
"se_name": seName,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class Image {
|
||||||
|
Image({
|
||||||
|
this.id,
|
||||||
|
this.position,
|
||||||
|
this.src,
|
||||||
|
this.thumb,
|
||||||
|
this.attachment,
|
||||||
|
});
|
||||||
|
|
||||||
|
dynamic id;
|
||||||
|
dynamic position;
|
||||||
|
String src;
|
||||||
|
String thumb;
|
||||||
|
String attachment;
|
||||||
|
|
||||||
|
factory Image.fromJson(Map<String, dynamic> json) => Image(
|
||||||
|
id: json["id"],
|
||||||
|
position: json["position"],
|
||||||
|
src: json["src"],
|
||||||
|
thumb: json["thumb"],
|
||||||
|
attachment: json["attachment"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"id": id,
|
||||||
|
"position": position,
|
||||||
|
"src": src,
|
||||||
|
"thumb": thumb,
|
||||||
|
"attachment": attachment,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class LocalizedName {
|
||||||
|
LocalizedName({
|
||||||
|
this.languageId,
|
||||||
|
this.localizedName,
|
||||||
|
});
|
||||||
|
|
||||||
|
dynamic languageId;
|
||||||
|
String localizedName;
|
||||||
|
|
||||||
|
factory LocalizedName.fromJson(Map<String, dynamic> json) => LocalizedName(
|
||||||
|
languageId: json["language_id"],
|
||||||
|
localizedName: json["localized_name"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"language_id": languageId,
|
||||||
|
"localized_name": localizedName,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class Specification {
|
||||||
|
Specification({
|
||||||
|
this.id,
|
||||||
|
this.displayOrder,
|
||||||
|
this.defaultValue,
|
||||||
|
this.defaultValuen,
|
||||||
|
this.name,
|
||||||
|
this.nameN,
|
||||||
|
});
|
||||||
|
|
||||||
|
dynamic id;
|
||||||
|
dynamic displayOrder;
|
||||||
|
String defaultValue;
|
||||||
|
String defaultValuen;
|
||||||
|
String name;
|
||||||
|
String nameN;
|
||||||
|
|
||||||
|
factory Specification.fromJson(Map<String, dynamic> json) => Specification(
|
||||||
|
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() => {
|
||||||
|
"id": id,
|
||||||
|
"display_order": displayOrder,
|
||||||
|
"default_value": defaultValue,
|
||||||
|
"default_valuen": defaultValuen,
|
||||||
|
"name": name,
|
||||||
|
"nameN": nameN,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class EnumValues<T> {
|
||||||
|
Map<String, T> map;
|
||||||
|
Map<T, String> reverseMap;
|
||||||
|
|
||||||
|
EnumValues(this.map);
|
||||||
|
|
||||||
|
Map<T, String> get reverse {
|
||||||
|
if (reverseMap == null) {
|
||||||
|
reverseMap = map.map((k, v) => new MapEntry(v, k));
|
||||||
|
}
|
||||||
|
return reverseMap;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,924 @@
|
|||||||
|
// To parse this JSON data, do
|
||||||
|
//
|
||||||
|
// final shoppingCart = shoppingCartFromJson(jsonString);
|
||||||
|
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
ShoppingCart shoppingCartFromJson(String str) => ShoppingCart.fromJson(json.decode(str));
|
||||||
|
|
||||||
|
String shoppingCartToJson(ShoppingCart data) => json.encode(data.toJson());
|
||||||
|
|
||||||
|
class ShoppingCart {
|
||||||
|
ShoppingCart({
|
||||||
|
this.itemCount,
|
||||||
|
this.quantityCount,
|
||||||
|
this.subtotal,
|
||||||
|
this.subtotalWithVat,
|
||||||
|
this.subtotalVatAmount,
|
||||||
|
this.subtotalVatRate,
|
||||||
|
this.shoppingCarts,
|
||||||
|
});
|
||||||
|
|
||||||
|
int itemCount;
|
||||||
|
int quantityCount;
|
||||||
|
double subtotal;
|
||||||
|
double subtotalWithVat;
|
||||||
|
double subtotalVatAmount;
|
||||||
|
int subtotalVatRate;
|
||||||
|
List<ShoppingCartElement> shoppingCarts;
|
||||||
|
|
||||||
|
factory ShoppingCart.fromJson(Map<String, dynamic> json) => ShoppingCart(
|
||||||
|
itemCount: json["item_count"],
|
||||||
|
quantityCount: json["quantity_count"],
|
||||||
|
subtotal: json["subtotal"].toDouble(),
|
||||||
|
subtotalWithVat: json["subtotal_with_vat"].toDouble(),
|
||||||
|
subtotalVatAmount: json["subtotal_vat_amount"].toDouble(),
|
||||||
|
subtotalVatRate: json["subtotal_vat_rate"],
|
||||||
|
shoppingCarts: List<ShoppingCartElement>.from(json["shopping_carts"].map((x) => ShoppingCartElement.fromJson(x))),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"item_count": itemCount,
|
||||||
|
"quantity_count": quantityCount,
|
||||||
|
"subtotal": subtotal,
|
||||||
|
"subtotal_with_vat": subtotalWithVat,
|
||||||
|
"subtotal_vat_amount": subtotalVatAmount,
|
||||||
|
"subtotal_vat_rate": subtotalVatRate,
|
||||||
|
"shopping_carts": List<dynamic>.from(shoppingCarts.map((x) => x.toJson())),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class ShoppingCartElement {
|
||||||
|
ShoppingCartElement({
|
||||||
|
this.languageId,
|
||||||
|
this.id,
|
||||||
|
this.productAttributes,
|
||||||
|
this.customerEnteredPrice,
|
||||||
|
this.quantity,
|
||||||
|
this.discountAmountInclTax,
|
||||||
|
this.subtotal,
|
||||||
|
this.subtotalWithVat,
|
||||||
|
this.subtotalVatAmount,
|
||||||
|
this.subtotalVatRate,
|
||||||
|
this.currency,
|
||||||
|
this.currencyn,
|
||||||
|
this.rentalStartDateUtc,
|
||||||
|
this.rentalEndDateUtc,
|
||||||
|
this.createdOnUtc,
|
||||||
|
this.updatedOnUtc,
|
||||||
|
this.shoppingCartType,
|
||||||
|
this.productId,
|
||||||
|
this.product,
|
||||||
|
this.customerId,
|
||||||
|
this.customer,
|
||||||
|
});
|
||||||
|
|
||||||
|
int languageId;
|
||||||
|
String id;
|
||||||
|
List<dynamic> productAttributes;
|
||||||
|
int customerEnteredPrice;
|
||||||
|
int quantity;
|
||||||
|
dynamic discountAmountInclTax;
|
||||||
|
String subtotal;
|
||||||
|
String subtotalWithVat;
|
||||||
|
String subtotalVatAmount;
|
||||||
|
String subtotalVatRate;
|
||||||
|
String currency;
|
||||||
|
String currencyn;
|
||||||
|
dynamic rentalStartDateUtc;
|
||||||
|
dynamic rentalEndDateUtc;
|
||||||
|
DateTime createdOnUtc;
|
||||||
|
DateTime updatedOnUtc;
|
||||||
|
String shoppingCartType;
|
||||||
|
int productId;
|
||||||
|
Product product;
|
||||||
|
int customerId;
|
||||||
|
Customer customer;
|
||||||
|
|
||||||
|
factory ShoppingCartElement.fromJson(Map<String, dynamic> json) => ShoppingCartElement(
|
||||||
|
languageId: json["language_id"],
|
||||||
|
id: json["id"],
|
||||||
|
productAttributes: List<dynamic>.from(json["product_attributes"].map((x) => x)),
|
||||||
|
customerEnteredPrice: json["customer_entered_price"],
|
||||||
|
quantity: json["quantity"],
|
||||||
|
discountAmountInclTax: json["discount_amount_incl_tax"],
|
||||||
|
subtotal: json["subtotal"],
|
||||||
|
subtotalWithVat: json["subtotal_with_vat"],
|
||||||
|
subtotalVatAmount: json["subtotal_vat_amount"],
|
||||||
|
subtotalVatRate: json["subtotal_vat_rate"],
|
||||||
|
currency: json["currency"],
|
||||||
|
currencyn: json["currencyn"],
|
||||||
|
rentalStartDateUtc: json["rental_start_date_utc"],
|
||||||
|
rentalEndDateUtc: json["rental_end_date_utc"],
|
||||||
|
createdOnUtc: DateTime.parse(json["created_on_utc"]),
|
||||||
|
updatedOnUtc: DateTime.parse(json["updated_on_utc"]),
|
||||||
|
shoppingCartType: json["shopping_cart_type"],
|
||||||
|
productId: json["product_id"],
|
||||||
|
product: Product.fromJson(json["product"]),
|
||||||
|
customerId: json["customer_id"],
|
||||||
|
customer: Customer.fromJson(json["customer"]),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"language_id": languageId,
|
||||||
|
"id": id,
|
||||||
|
"product_attributes": List<dynamic>.from(productAttributes.map((x) => x)),
|
||||||
|
"customer_entered_price": customerEnteredPrice,
|
||||||
|
"quantity": quantity,
|
||||||
|
"discount_amount_incl_tax": discountAmountInclTax,
|
||||||
|
"subtotal": subtotal,
|
||||||
|
"subtotal_with_vat": subtotalWithVat,
|
||||||
|
"subtotal_vat_amount": subtotalVatAmount,
|
||||||
|
"subtotal_vat_rate": subtotalVatRate,
|
||||||
|
"currency": currency,
|
||||||
|
"currencyn": currencyn,
|
||||||
|
"rental_start_date_utc": rentalStartDateUtc,
|
||||||
|
"rental_end_date_utc": rentalEndDateUtc,
|
||||||
|
"created_on_utc": createdOnUtc.toIso8601String(),
|
||||||
|
"updated_on_utc": updatedOnUtc.toIso8601String(),
|
||||||
|
"shopping_cart_type": shoppingCartType,
|
||||||
|
"product_id": productId,
|
||||||
|
"product": product.toJson(),
|
||||||
|
"customer_id": customerId,
|
||||||
|
"customer": customer.toJson(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class Customer {
|
||||||
|
Customer({
|
||||||
|
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,
|
||||||
|
});
|
||||||
|
|
||||||
|
Address billingAddress;
|
||||||
|
Address shippingAddress;
|
||||||
|
List<Address> addresses;
|
||||||
|
String id;
|
||||||
|
String username;
|
||||||
|
String email;
|
||||||
|
dynamic firstName;
|
||||||
|
dynamic lastName;
|
||||||
|
dynamic languageId;
|
||||||
|
dynamic adminComment;
|
||||||
|
bool isTaxExempt;
|
||||||
|
bool hasShoppingCartItems;
|
||||||
|
bool active;
|
||||||
|
bool deleted;
|
||||||
|
bool isSystemAccount;
|
||||||
|
dynamic systemName;
|
||||||
|
String lastIpAddress;
|
||||||
|
DateTime createdOnUtc;
|
||||||
|
DateTime lastLoginDateUtc;
|
||||||
|
DateTime lastActivityDateUtc;
|
||||||
|
int registeredInStoreId;
|
||||||
|
List<dynamic> roleIds;
|
||||||
|
|
||||||
|
factory Customer.fromJson(Map<String, dynamic> json) => Customer(
|
||||||
|
billingAddress: Address.fromJson(json["billing_address"]),
|
||||||
|
shippingAddress: Address.fromJson(json["shipping_address"]),
|
||||||
|
addresses: List<Address>.from(json["addresses"].map((x) => Address.fromJson(x))),
|
||||||
|
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: DateTime.parse(json["created_on_utc"]),
|
||||||
|
lastLoginDateUtc: DateTime.parse(json["last_login_date_utc"]),
|
||||||
|
lastActivityDateUtc: DateTime.parse(json["last_activity_date_utc"]),
|
||||||
|
registeredInStoreId: json["registered_in_store_id"],
|
||||||
|
roleIds: List<dynamic>.from(json["role_ids"].map((x) => x)),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"billing_address": billingAddress.toJson(),
|
||||||
|
"shipping_address": shippingAddress.toJson(),
|
||||||
|
"addresses": List<dynamic>.from(addresses.map((x) => x.toJson())),
|
||||||
|
"id": id,
|
||||||
|
"username": username,
|
||||||
|
"email": email,
|
||||||
|
"first_name": firstName,
|
||||||
|
"last_name": lastName,
|
||||||
|
"language_id": languageId,
|
||||||
|
"admin_comment": adminComment,
|
||||||
|
"is_tax_exempt": isTaxExempt,
|
||||||
|
"has_shopping_cart_items": hasShoppingCartItems,
|
||||||
|
"active": active,
|
||||||
|
"deleted": deleted,
|
||||||
|
"is_system_account": isSystemAccount,
|
||||||
|
"system_name": systemName,
|
||||||
|
"last_ip_address": lastIpAddress,
|
||||||
|
"created_on_utc": createdOnUtc.toIso8601String(),
|
||||||
|
"last_login_date_utc": lastLoginDateUtc.toIso8601String(),
|
||||||
|
"last_activity_date_utc": lastActivityDateUtc.toIso8601String(),
|
||||||
|
"registered_in_store_id": registeredInStoreId,
|
||||||
|
"role_ids": List<dynamic>.from(roleIds.map((x) => x)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class Address {
|
||||||
|
Address({
|
||||||
|
this.id,
|
||||||
|
this.firstName,
|
||||||
|
this.lastName,
|
||||||
|
this.email,
|
||||||
|
this.company,
|
||||||
|
this.countryId,
|
||||||
|
this.country,
|
||||||
|
this.stateProvinceId,
|
||||||
|
this.city,
|
||||||
|
this.address1,
|
||||||
|
this.address2,
|
||||||
|
this.zipPostalCode,
|
||||||
|
this.phoneNumber,
|
||||||
|
this.faxNumber,
|
||||||
|
this.customerAttributes,
|
||||||
|
this.createdOnUtc,
|
||||||
|
this.province,
|
||||||
|
this.latLong,
|
||||||
|
});
|
||||||
|
|
||||||
|
String id;
|
||||||
|
FirstName firstName;
|
||||||
|
LastName lastName;
|
||||||
|
Email email;
|
||||||
|
dynamic company;
|
||||||
|
int countryId;
|
||||||
|
Country country;
|
||||||
|
dynamic stateProvinceId;
|
||||||
|
City city;
|
||||||
|
String address1;
|
||||||
|
String address2;
|
||||||
|
String zipPostalCode;
|
||||||
|
String phoneNumber;
|
||||||
|
dynamic faxNumber;
|
||||||
|
String customerAttributes;
|
||||||
|
DateTime createdOnUtc;
|
||||||
|
dynamic province;
|
||||||
|
String latLong;
|
||||||
|
|
||||||
|
factory Address.fromJson(Map<String, dynamic> json) => Address(
|
||||||
|
id: json["id"],
|
||||||
|
firstName: firstNameValues.map[json["first_name"]],
|
||||||
|
lastName: lastNameValues.map[json["last_name"]],
|
||||||
|
email: emailValues.map[json["email"]],
|
||||||
|
company: json["company"],
|
||||||
|
countryId: json["country_id"],
|
||||||
|
country: countryValues.map[json["country"]],
|
||||||
|
stateProvinceId: json["state_province_id"],
|
||||||
|
city: cityValues.map[json["city"]],
|
||||||
|
address1: json["address1"],
|
||||||
|
address2: json["address2"],
|
||||||
|
zipPostalCode: json["zip_postal_code"],
|
||||||
|
phoneNumber: json["phone_number"],
|
||||||
|
faxNumber: json["fax_number"],
|
||||||
|
customerAttributes: json["customer_attributes"],
|
||||||
|
createdOnUtc: DateTime.parse(json["created_on_utc"]),
|
||||||
|
province: json["province"],
|
||||||
|
latLong: json["lat_long"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"id": id,
|
||||||
|
"first_name": firstNameValues.reverse[firstName],
|
||||||
|
"last_name": lastNameValues.reverse[lastName],
|
||||||
|
"email": emailValues.reverse[email],
|
||||||
|
"company": company,
|
||||||
|
"country_id": countryId,
|
||||||
|
"country": countryValues.reverse[country],
|
||||||
|
"state_province_id": stateProvinceId,
|
||||||
|
"city": cityValues.reverse[city],
|
||||||
|
"address1": address1,
|
||||||
|
"address2": address2,
|
||||||
|
"zip_postal_code": zipPostalCode,
|
||||||
|
"phone_number": phoneNumber,
|
||||||
|
"fax_number": faxNumber,
|
||||||
|
"customer_attributes": customerAttributes,
|
||||||
|
"created_on_utc": createdOnUtc.toIso8601String(),
|
||||||
|
"province": province,
|
||||||
|
"lat_long": latLong,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
enum City { CALIFORNIA, RIYADH, AL_OYUN }
|
||||||
|
|
||||||
|
final cityValues = EnumValues({
|
||||||
|
"Al Oyun": City.AL_OYUN,
|
||||||
|
"California": City.CALIFORNIA,
|
||||||
|
"Riyadh": City.RIYADH
|
||||||
|
});
|
||||||
|
|
||||||
|
enum Country { UNITED_STATES, SAUDI_ARABIA }
|
||||||
|
|
||||||
|
final countryValues = EnumValues({
|
||||||
|
"Saudi Arabia": Country.SAUDI_ARABIA,
|
||||||
|
"United States": Country.UNITED_STATES
|
||||||
|
});
|
||||||
|
|
||||||
|
enum Email { TAMER_FANASHEH_GMAIL_COM, TAMER_DASDASDAS_GMAIL_COM, TAMER_F_CLOUDSOLUTION_SA_COM }
|
||||||
|
|
||||||
|
final emailValues = EnumValues({
|
||||||
|
"Tamer.dasdasdas@gmail.com": Email.TAMER_DASDASDAS_GMAIL_COM,
|
||||||
|
"Tamer.fanasheh@gmail.com": Email.TAMER_FANASHEH_GMAIL_COM,
|
||||||
|
"Tamer.F@cloudsolution-sa.com": Email.TAMER_F_CLOUDSOLUTION_SA_COM
|
||||||
|
});
|
||||||
|
|
||||||
|
enum FirstName { TAMER, TAMER_FANASHEH }
|
||||||
|
|
||||||
|
final firstNameValues = EnumValues({
|
||||||
|
"TAMER": FirstName.TAMER,
|
||||||
|
"TAMER FANASHEH": FirstName.TAMER_FANASHEH
|
||||||
|
});
|
||||||
|
|
||||||
|
enum LastName { FANASHEH, MUSA }
|
||||||
|
|
||||||
|
final lastNameValues = EnumValues({
|
||||||
|
"FANASHEH": LastName.FANASHEH,
|
||||||
|
"MUSA": LastName.MUSA
|
||||||
|
});
|
||||||
|
|
||||||
|
class Product {
|
||||||
|
Product({
|
||||||
|
this.id,
|
||||||
|
this.visibleIndividually,
|
||||||
|
this.name,
|
||||||
|
this.namen,
|
||||||
|
this.localizedNames,
|
||||||
|
this.shortDescription,
|
||||||
|
this.shortDescriptionn,
|
||||||
|
this.fullDescription,
|
||||||
|
this.fullDescriptionn,
|
||||||
|
this.markasNew,
|
||||||
|
this.showOnHomePage,
|
||||||
|
this.metaKeywords,
|
||||||
|
this.metaDescription,
|
||||||
|
this.metaTitle,
|
||||||
|
this.allowCustomerReviews,
|
||||||
|
this.approvedRatingSum,
|
||||||
|
this.notApprovedRatingSum,
|
||||||
|
this.approvedTotalReviews,
|
||||||
|
this.notApprovedTotalReviews,
|
||||||
|
this.sku,
|
||||||
|
this.isRx,
|
||||||
|
this.prescriptionRequired,
|
||||||
|
this.rxMessage,
|
||||||
|
this.rxMessagen,
|
||||||
|
this.manufacturerPartNumber,
|
||||||
|
this.gtin,
|
||||||
|
this.isGiftCard,
|
||||||
|
this.requireOtherProducts,
|
||||||
|
this.automaticallyAddRequiredProducts,
|
||||||
|
this.isDownload,
|
||||||
|
this.unlimitedDownloads,
|
||||||
|
this.maxNumberOfDownloads,
|
||||||
|
this.downloadExpirationDays,
|
||||||
|
this.hasSampleDownload,
|
||||||
|
this.hasUserAgreement,
|
||||||
|
this.isRecurring,
|
||||||
|
this.recurringCycleLength,
|
||||||
|
this.recurringTotalCycles,
|
||||||
|
this.isRental,
|
||||||
|
this.rentalPriceLength,
|
||||||
|
this.isShipEnabled,
|
||||||
|
this.isFreeShipping,
|
||||||
|
this.shipSeparately,
|
||||||
|
this.additionalShippingCharge,
|
||||||
|
this.isTaxExempt,
|
||||||
|
this.isTelecommunicationsOrBroadcastingOrElectronicServices,
|
||||||
|
this.useMultipleWarehouses,
|
||||||
|
this.manageInventoryMethodId,
|
||||||
|
this.stockQuantity,
|
||||||
|
this.stockAvailability,
|
||||||
|
this.stockAvailabilityn,
|
||||||
|
this.displayStockAvailability,
|
||||||
|
this.displayStockQuantity,
|
||||||
|
this.minStockQuantity,
|
||||||
|
this.notifyAdminForQuantityBelow,
|
||||||
|
this.allowBackInStockSubscriptions,
|
||||||
|
this.orderMinimumQuantity,
|
||||||
|
this.orderMaximumQuantity,
|
||||||
|
this.allowedQuantities,
|
||||||
|
this.allowAddingOnlyExistingAttributeCombinations,
|
||||||
|
this.disableBuyButton,
|
||||||
|
this.disableWishlistButton,
|
||||||
|
this.availableForPreOrder,
|
||||||
|
this.preOrderAvailabilityStartDateTimeUtc,
|
||||||
|
this.callForPrice,
|
||||||
|
this.price,
|
||||||
|
this.oldPrice,
|
||||||
|
this.productCost,
|
||||||
|
this.specialPrice,
|
||||||
|
this.specialPriceStartDateTimeUtc,
|
||||||
|
this.specialPriceEndDateTimeUtc,
|
||||||
|
this.customerEntersPrice,
|
||||||
|
this.minimumCustomerEnteredPrice,
|
||||||
|
this.maximumCustomerEnteredPrice,
|
||||||
|
this.basepriceEnabled,
|
||||||
|
this.basepriceAmount,
|
||||||
|
this.basepriceBaseAmount,
|
||||||
|
this.hasTierPrices,
|
||||||
|
this.hasDiscountsApplied,
|
||||||
|
this.discountName,
|
||||||
|
this.discountNamen,
|
||||||
|
this.discountDescription,
|
||||||
|
this.discountDescriptionn,
|
||||||
|
this.discountPercentage,
|
||||||
|
this.currency,
|
||||||
|
this.currencyn,
|
||||||
|
this.weight,
|
||||||
|
this.length,
|
||||||
|
this.width,
|
||||||
|
this.height,
|
||||||
|
this.availableStartDateTimeUtc,
|
||||||
|
this.availableEndDateTimeUtc,
|
||||||
|
this.displayOrder,
|
||||||
|
this.published,
|
||||||
|
this.deleted,
|
||||||
|
this.createdOnUtc,
|
||||||
|
this.updatedOnUtc,
|
||||||
|
this.productType,
|
||||||
|
this.parentGroupedProductId,
|
||||||
|
this.roleIds,
|
||||||
|
this.discountIds,
|
||||||
|
this.storeIds,
|
||||||
|
this.manufacturerIds,
|
||||||
|
this.reviews,
|
||||||
|
this.images,
|
||||||
|
this.attributes,
|
||||||
|
this.specifications,
|
||||||
|
this.associatedProductIds,
|
||||||
|
this.tags,
|
||||||
|
this.vendorId,
|
||||||
|
this.seName,
|
||||||
|
});
|
||||||
|
|
||||||
|
String id;
|
||||||
|
bool visibleIndividually;
|
||||||
|
String name;
|
||||||
|
String namen;
|
||||||
|
List<LocalizedName> localizedNames;
|
||||||
|
String shortDescription;
|
||||||
|
String shortDescriptionn;
|
||||||
|
String fullDescription;
|
||||||
|
String fullDescriptionn;
|
||||||
|
bool markasNew;
|
||||||
|
bool showOnHomePage;
|
||||||
|
String metaKeywords;
|
||||||
|
String metaDescription;
|
||||||
|
String metaTitle;
|
||||||
|
bool allowCustomerReviews;
|
||||||
|
int approvedRatingSum;
|
||||||
|
int notApprovedRatingSum;
|
||||||
|
int approvedTotalReviews;
|
||||||
|
int notApprovedTotalReviews;
|
||||||
|
String sku;
|
||||||
|
bool isRx;
|
||||||
|
bool prescriptionRequired;
|
||||||
|
dynamic rxMessage;
|
||||||
|
dynamic rxMessagen;
|
||||||
|
dynamic manufacturerPartNumber;
|
||||||
|
dynamic gtin;
|
||||||
|
bool isGiftCard;
|
||||||
|
bool requireOtherProducts;
|
||||||
|
bool automaticallyAddRequiredProducts;
|
||||||
|
bool isDownload;
|
||||||
|
bool unlimitedDownloads;
|
||||||
|
int maxNumberOfDownloads;
|
||||||
|
dynamic downloadExpirationDays;
|
||||||
|
bool hasSampleDownload;
|
||||||
|
bool hasUserAgreement;
|
||||||
|
bool isRecurring;
|
||||||
|
int recurringCycleLength;
|
||||||
|
int recurringTotalCycles;
|
||||||
|
bool isRental;
|
||||||
|
int rentalPriceLength;
|
||||||
|
bool isShipEnabled;
|
||||||
|
bool isFreeShipping;
|
||||||
|
bool shipSeparately;
|
||||||
|
int additionalShippingCharge;
|
||||||
|
bool isTaxExempt;
|
||||||
|
bool isTelecommunicationsOrBroadcastingOrElectronicServices;
|
||||||
|
bool useMultipleWarehouses;
|
||||||
|
int manageInventoryMethodId;
|
||||||
|
int stockQuantity;
|
||||||
|
String stockAvailability;
|
||||||
|
String stockAvailabilityn;
|
||||||
|
bool displayStockAvailability;
|
||||||
|
bool displayStockQuantity;
|
||||||
|
int minStockQuantity;
|
||||||
|
int notifyAdminForQuantityBelow;
|
||||||
|
bool allowBackInStockSubscriptions;
|
||||||
|
int orderMinimumQuantity;
|
||||||
|
int orderMaximumQuantity;
|
||||||
|
dynamic allowedQuantities;
|
||||||
|
bool allowAddingOnlyExistingAttributeCombinations;
|
||||||
|
bool disableBuyButton;
|
||||||
|
bool disableWishlistButton;
|
||||||
|
bool availableForPreOrder;
|
||||||
|
dynamic preOrderAvailabilityStartDateTimeUtc;
|
||||||
|
bool callForPrice;
|
||||||
|
double price;
|
||||||
|
int oldPrice;
|
||||||
|
double productCost;
|
||||||
|
dynamic specialPrice;
|
||||||
|
dynamic specialPriceStartDateTimeUtc;
|
||||||
|
dynamic specialPriceEndDateTimeUtc;
|
||||||
|
bool customerEntersPrice;
|
||||||
|
int minimumCustomerEnteredPrice;
|
||||||
|
int maximumCustomerEnteredPrice;
|
||||||
|
bool basepriceEnabled;
|
||||||
|
int basepriceAmount;
|
||||||
|
int basepriceBaseAmount;
|
||||||
|
bool hasTierPrices;
|
||||||
|
bool hasDiscountsApplied;
|
||||||
|
dynamic discountName;
|
||||||
|
dynamic discountNamen;
|
||||||
|
dynamic discountDescription;
|
||||||
|
dynamic discountDescriptionn;
|
||||||
|
dynamic discountPercentage;
|
||||||
|
String currency;
|
||||||
|
String currencyn;
|
||||||
|
double weight;
|
||||||
|
int length;
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
|
dynamic availableStartDateTimeUtc;
|
||||||
|
dynamic availableEndDateTimeUtc;
|
||||||
|
int displayOrder;
|
||||||
|
bool published;
|
||||||
|
bool deleted;
|
||||||
|
DateTime createdOnUtc;
|
||||||
|
DateTime updatedOnUtc;
|
||||||
|
String productType;
|
||||||
|
int parentGroupedProductId;
|
||||||
|
List<dynamic> roleIds;
|
||||||
|
List<dynamic> discountIds;
|
||||||
|
List<dynamic> storeIds;
|
||||||
|
List<int> manufacturerIds;
|
||||||
|
List<dynamic> reviews;
|
||||||
|
List<Image> images;
|
||||||
|
List<dynamic> attributes;
|
||||||
|
List<Specification> specifications;
|
||||||
|
List<dynamic> associatedProductIds;
|
||||||
|
List<dynamic> tags;
|
||||||
|
int vendorId;
|
||||||
|
String seName;
|
||||||
|
|
||||||
|
factory Product.fromJson(Map<String, dynamic> json) => Product(
|
||||||
|
id: json["id"],
|
||||||
|
visibleIndividually: json["visible_individually"],
|
||||||
|
name: json["name"],
|
||||||
|
namen: json["namen"],
|
||||||
|
localizedNames: List<LocalizedName>.from(json["localized_names"].map((x) => LocalizedName.fromJson(x))),
|
||||||
|
shortDescription: json["short_description"],
|
||||||
|
shortDescriptionn: json["short_descriptionn"],
|
||||||
|
fullDescription: json["full_description"],
|
||||||
|
fullDescriptionn: json["full_descriptionn"],
|
||||||
|
markasNew: json["markas_new"],
|
||||||
|
showOnHomePage: json["show_on_home_page"],
|
||||||
|
metaKeywords: json["meta_keywords"] == null ? null : json["meta_keywords"],
|
||||||
|
metaDescription: json["meta_description"] == null ? null : json["meta_description"],
|
||||||
|
metaTitle: json["meta_title"] == null ? null : json["meta_title"],
|
||||||
|
allowCustomerReviews: json["allow_customer_reviews"],
|
||||||
|
approvedRatingSum: json["approved_rating_sum"],
|
||||||
|
notApprovedRatingSum: json["not_approved_rating_sum"],
|
||||||
|
approvedTotalReviews: json["approved_total_reviews"],
|
||||||
|
notApprovedTotalReviews: json["not_approved_total_reviews"],
|
||||||
|
sku: json["sku"],
|
||||||
|
isRx: json["is_rx"],
|
||||||
|
prescriptionRequired: json["prescription_required"],
|
||||||
|
rxMessage: json["rx_message"],
|
||||||
|
rxMessagen: json["rx_messagen"],
|
||||||
|
manufacturerPartNumber: json["manufacturer_part_number"],
|
||||||
|
gtin: json["gtin"],
|
||||||
|
isGiftCard: json["is_gift_card"],
|
||||||
|
requireOtherProducts: json["require_other_products"],
|
||||||
|
automaticallyAddRequiredProducts: json["automatically_add_required_products"],
|
||||||
|
isDownload: json["is_download"],
|
||||||
|
unlimitedDownloads: json["unlimited_downloads"],
|
||||||
|
maxNumberOfDownloads: json["max_number_of_downloads"],
|
||||||
|
downloadExpirationDays: json["download_expiration_days"],
|
||||||
|
hasSampleDownload: json["has_sample_download"],
|
||||||
|
hasUserAgreement: json["has_user_agreement"],
|
||||||
|
isRecurring: json["is_recurring"],
|
||||||
|
recurringCycleLength: json["recurring_cycle_length"],
|
||||||
|
recurringTotalCycles: json["recurring_total_cycles"],
|
||||||
|
isRental: json["is_rental"],
|
||||||
|
rentalPriceLength: json["rental_price_length"],
|
||||||
|
isShipEnabled: json["is_ship_enabled"],
|
||||||
|
isFreeShipping: json["is_free_shipping"],
|
||||||
|
shipSeparately: json["ship_separately"],
|
||||||
|
additionalShippingCharge: json["additional_shipping_charge"],
|
||||||
|
isTaxExempt: json["is_tax_exempt"],
|
||||||
|
isTelecommunicationsOrBroadcastingOrElectronicServices: json["is_telecommunications_or_broadcasting_or_electronic_services"],
|
||||||
|
useMultipleWarehouses: json["use_multiple_warehouses"],
|
||||||
|
manageInventoryMethodId: json["manage_inventory_method_id"],
|
||||||
|
stockQuantity: json["stock_quantity"],
|
||||||
|
stockAvailability: json["stock_availability"],
|
||||||
|
stockAvailabilityn: json["stock_availabilityn"],
|
||||||
|
displayStockAvailability: json["display_stock_availability"],
|
||||||
|
displayStockQuantity: json["display_stock_quantity"],
|
||||||
|
minStockQuantity: json["min_stock_quantity"],
|
||||||
|
notifyAdminForQuantityBelow: json["notify_admin_for_quantity_below"],
|
||||||
|
allowBackInStockSubscriptions: json["allow_back_in_stock_subscriptions"],
|
||||||
|
orderMinimumQuantity: json["order_minimum_quantity"],
|
||||||
|
orderMaximumQuantity: json["order_maximum_quantity"],
|
||||||
|
allowedQuantities: json["allowed_quantities"],
|
||||||
|
allowAddingOnlyExistingAttributeCombinations: json["allow_adding_only_existing_attribute_combinations"],
|
||||||
|
disableBuyButton: json["disable_buy_button"],
|
||||||
|
disableWishlistButton: json["disable_wishlist_button"],
|
||||||
|
availableForPreOrder: json["available_for_pre_order"],
|
||||||
|
preOrderAvailabilityStartDateTimeUtc: json["pre_order_availability_start_date_time_utc"],
|
||||||
|
callForPrice: json["call_for_price"],
|
||||||
|
price: json["price"].toDouble(),
|
||||||
|
oldPrice: json["old_price"],
|
||||||
|
productCost: json["product_cost"].toDouble(),
|
||||||
|
specialPrice: json["special_price"],
|
||||||
|
specialPriceStartDateTimeUtc: json["special_price_start_date_time_utc"],
|
||||||
|
specialPriceEndDateTimeUtc: json["special_price_end_date_time_utc"],
|
||||||
|
customerEntersPrice: json["customer_enters_price"],
|
||||||
|
minimumCustomerEnteredPrice: json["minimum_customer_entered_price"],
|
||||||
|
maximumCustomerEnteredPrice: json["maximum_customer_entered_price"],
|
||||||
|
basepriceEnabled: json["baseprice_enabled"],
|
||||||
|
basepriceAmount: json["baseprice_amount"],
|
||||||
|
basepriceBaseAmount: json["baseprice_base_amount"],
|
||||||
|
hasTierPrices: json["has_tier_prices"],
|
||||||
|
hasDiscountsApplied: json["has_discounts_applied"],
|
||||||
|
discountName: json["discount_name"],
|
||||||
|
discountNamen: json["discount_namen"],
|
||||||
|
discountDescription: json["discount_description"],
|
||||||
|
discountDescriptionn: json["discount_Descriptionn"],
|
||||||
|
discountPercentage: json["discount_percentage"],
|
||||||
|
currency: json["currency"],
|
||||||
|
currencyn: json["currencyn"],
|
||||||
|
weight: json["weight"].toDouble(),
|
||||||
|
length: json["length"],
|
||||||
|
width: json["width"],
|
||||||
|
height: json["height"],
|
||||||
|
availableStartDateTimeUtc: json["available_start_date_time_utc"],
|
||||||
|
availableEndDateTimeUtc: json["available_end_date_time_utc"],
|
||||||
|
displayOrder: json["display_order"],
|
||||||
|
published: json["published"],
|
||||||
|
deleted: json["deleted"],
|
||||||
|
createdOnUtc: DateTime.parse(json["created_on_utc"]),
|
||||||
|
updatedOnUtc: DateTime.parse(json["updated_on_utc"]),
|
||||||
|
productType: json["product_type"],
|
||||||
|
parentGroupedProductId: json["parent_grouped_product_id"],
|
||||||
|
roleIds: List<dynamic>.from(json["role_ids"].map((x) => x)),
|
||||||
|
discountIds: List<dynamic>.from(json["discount_ids"].map((x) => x)),
|
||||||
|
storeIds: List<dynamic>.from(json["store_ids"].map((x) => x)),
|
||||||
|
manufacturerIds: List<int>.from(json["manufacturer_ids"].map((x) => x)),
|
||||||
|
reviews: List<dynamic>.from(json["reviews"].map((x) => x)),
|
||||||
|
images: List<Image>.from(json["images"].map((x) => Image.fromJson(x))),
|
||||||
|
attributes: List<dynamic>.from(json["attributes"].map((x) => x)),
|
||||||
|
specifications: List<Specification>.from(json["specifications"].map((x) => Specification.fromJson(x))),
|
||||||
|
associatedProductIds: List<dynamic>.from(json["associated_product_ids"].map((x) => x)),
|
||||||
|
tags: List<dynamic>.from(json["tags"].map((x) => x)),
|
||||||
|
vendorId: json["vendor_id"],
|
||||||
|
seName: json["se_name"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"id": id,
|
||||||
|
"visible_individually": visibleIndividually,
|
||||||
|
"name": name,
|
||||||
|
"namen": namen,
|
||||||
|
"localized_names": List<dynamic>.from(localizedNames.map((x) => x.toJson())),
|
||||||
|
"short_description": shortDescription,
|
||||||
|
"short_descriptionn": shortDescriptionn,
|
||||||
|
"full_description": fullDescription,
|
||||||
|
"full_descriptionn": fullDescriptionn,
|
||||||
|
"markas_new": markasNew,
|
||||||
|
"show_on_home_page": showOnHomePage,
|
||||||
|
"meta_keywords": metaKeywords == null ? null : metaKeywords,
|
||||||
|
"meta_description": metaDescription == null ? null : metaDescription,
|
||||||
|
"meta_title": metaTitle == null ? null : metaTitle,
|
||||||
|
"allow_customer_reviews": allowCustomerReviews,
|
||||||
|
"approved_rating_sum": approvedRatingSum,
|
||||||
|
"not_approved_rating_sum": notApprovedRatingSum,
|
||||||
|
"approved_total_reviews": approvedTotalReviews,
|
||||||
|
"not_approved_total_reviews": notApprovedTotalReviews,
|
||||||
|
"sku": sku,
|
||||||
|
"is_rx": isRx,
|
||||||
|
"prescription_required": prescriptionRequired,
|
||||||
|
"rx_message": rxMessage,
|
||||||
|
"rx_messagen": rxMessagen,
|
||||||
|
"manufacturer_part_number": manufacturerPartNumber,
|
||||||
|
"gtin": gtin,
|
||||||
|
"is_gift_card": isGiftCard,
|
||||||
|
"require_other_products": requireOtherProducts,
|
||||||
|
"automatically_add_required_products": automaticallyAddRequiredProducts,
|
||||||
|
"is_download": isDownload,
|
||||||
|
"unlimited_downloads": unlimitedDownloads,
|
||||||
|
"max_number_of_downloads": maxNumberOfDownloads,
|
||||||
|
"download_expiration_days": downloadExpirationDays,
|
||||||
|
"has_sample_download": hasSampleDownload,
|
||||||
|
"has_user_agreement": hasUserAgreement,
|
||||||
|
"is_recurring": isRecurring,
|
||||||
|
"recurring_cycle_length": recurringCycleLength,
|
||||||
|
"recurring_total_cycles": recurringTotalCycles,
|
||||||
|
"is_rental": isRental,
|
||||||
|
"rental_price_length": rentalPriceLength,
|
||||||
|
"is_ship_enabled": isShipEnabled,
|
||||||
|
"is_free_shipping": isFreeShipping,
|
||||||
|
"ship_separately": shipSeparately,
|
||||||
|
"additional_shipping_charge": additionalShippingCharge,
|
||||||
|
"is_tax_exempt": isTaxExempt,
|
||||||
|
"is_telecommunications_or_broadcasting_or_electronic_services": isTelecommunicationsOrBroadcastingOrElectronicServices,
|
||||||
|
"use_multiple_warehouses": useMultipleWarehouses,
|
||||||
|
"manage_inventory_method_id": manageInventoryMethodId,
|
||||||
|
"stock_quantity": stockQuantity,
|
||||||
|
"stock_availability": stockAvailability,
|
||||||
|
"stock_availabilityn": stockAvailabilityn,
|
||||||
|
"display_stock_availability": displayStockAvailability,
|
||||||
|
"display_stock_quantity": displayStockQuantity,
|
||||||
|
"min_stock_quantity": minStockQuantity,
|
||||||
|
"notify_admin_for_quantity_below": notifyAdminForQuantityBelow,
|
||||||
|
"allow_back_in_stock_subscriptions": allowBackInStockSubscriptions,
|
||||||
|
"order_minimum_quantity": orderMinimumQuantity,
|
||||||
|
"order_maximum_quantity": orderMaximumQuantity,
|
||||||
|
"allowed_quantities": allowedQuantities,
|
||||||
|
"allow_adding_only_existing_attribute_combinations": allowAddingOnlyExistingAttributeCombinations,
|
||||||
|
"disable_buy_button": disableBuyButton,
|
||||||
|
"disable_wishlist_button": disableWishlistButton,
|
||||||
|
"available_for_pre_order": availableForPreOrder,
|
||||||
|
"pre_order_availability_start_date_time_utc": preOrderAvailabilityStartDateTimeUtc,
|
||||||
|
"call_for_price": callForPrice,
|
||||||
|
"price": price,
|
||||||
|
"old_price": oldPrice,
|
||||||
|
"product_cost": productCost,
|
||||||
|
"special_price": specialPrice,
|
||||||
|
"special_price_start_date_time_utc": specialPriceStartDateTimeUtc,
|
||||||
|
"special_price_end_date_time_utc": specialPriceEndDateTimeUtc,
|
||||||
|
"customer_enters_price": customerEntersPrice,
|
||||||
|
"minimum_customer_entered_price": minimumCustomerEnteredPrice,
|
||||||
|
"maximum_customer_entered_price": maximumCustomerEnteredPrice,
|
||||||
|
"baseprice_enabled": basepriceEnabled,
|
||||||
|
"baseprice_amount": basepriceAmount,
|
||||||
|
"baseprice_base_amount": basepriceBaseAmount,
|
||||||
|
"has_tier_prices": hasTierPrices,
|
||||||
|
"has_discounts_applied": hasDiscountsApplied,
|
||||||
|
"discount_name": discountName,
|
||||||
|
"discount_namen": discountNamen,
|
||||||
|
"discount_description": discountDescription,
|
||||||
|
"discount_Descriptionn": discountDescriptionn,
|
||||||
|
"discount_percentage": discountPercentage,
|
||||||
|
"currency": currency,
|
||||||
|
"currencyn": currencyn,
|
||||||
|
"weight": weight,
|
||||||
|
"length": length,
|
||||||
|
"width": width,
|
||||||
|
"height": height,
|
||||||
|
"available_start_date_time_utc": availableStartDateTimeUtc,
|
||||||
|
"available_end_date_time_utc": availableEndDateTimeUtc,
|
||||||
|
"display_order": displayOrder,
|
||||||
|
"published": published,
|
||||||
|
"deleted": deleted,
|
||||||
|
"created_on_utc": createdOnUtc.toIso8601String(),
|
||||||
|
"updated_on_utc": updatedOnUtc.toIso8601String(),
|
||||||
|
"product_type": productType,
|
||||||
|
"parent_grouped_product_id": parentGroupedProductId,
|
||||||
|
"role_ids": List<dynamic>.from(roleIds.map((x) => x)),
|
||||||
|
"discount_ids": List<dynamic>.from(discountIds.map((x) => x)),
|
||||||
|
"store_ids": List<dynamic>.from(storeIds.map((x) => x)),
|
||||||
|
"manufacturer_ids": List<dynamic>.from(manufacturerIds.map((x) => x)),
|
||||||
|
"reviews": List<dynamic>.from(reviews.map((x) => x)),
|
||||||
|
"images": List<dynamic>.from(images.map((x) => x.toJson())),
|
||||||
|
"attributes": List<dynamic>.from(attributes.map((x) => x)),
|
||||||
|
"specifications": List<dynamic>.from(specifications.map((x) => x.toJson())),
|
||||||
|
"associated_product_ids": List<dynamic>.from(associatedProductIds.map((x) => x)),
|
||||||
|
"tags": List<dynamic>.from(tags.map((x) => x)),
|
||||||
|
"vendor_id": vendorId,
|
||||||
|
"se_name": seName,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class Image {
|
||||||
|
Image({
|
||||||
|
this.id,
|
||||||
|
this.position,
|
||||||
|
this.src,
|
||||||
|
this.thumb,
|
||||||
|
this.attachment,
|
||||||
|
});
|
||||||
|
|
||||||
|
int id;
|
||||||
|
int position;
|
||||||
|
String src;
|
||||||
|
String thumb;
|
||||||
|
String attachment;
|
||||||
|
|
||||||
|
factory Image.fromJson(Map<String, dynamic> json) => Image(
|
||||||
|
id: json["id"],
|
||||||
|
position: json["position"],
|
||||||
|
src: json["src"],
|
||||||
|
thumb: json["thumb"],
|
||||||
|
attachment: json["attachment"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"id": id,
|
||||||
|
"position": position,
|
||||||
|
"src": src,
|
||||||
|
"thumb": thumb,
|
||||||
|
"attachment": attachment,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class LocalizedName {
|
||||||
|
LocalizedName({
|
||||||
|
this.languageId,
|
||||||
|
this.localizedName,
|
||||||
|
});
|
||||||
|
|
||||||
|
int languageId;
|
||||||
|
String localizedName;
|
||||||
|
|
||||||
|
factory LocalizedName.fromJson(Map<String, dynamic> json) => LocalizedName(
|
||||||
|
languageId: json["language_id"],
|
||||||
|
localizedName: json["localized_name"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"language_id": languageId,
|
||||||
|
"localized_name": localizedName,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class Specification {
|
||||||
|
Specification({
|
||||||
|
this.id,
|
||||||
|
this.displayOrder,
|
||||||
|
this.defaultValue,
|
||||||
|
this.defaultValuen,
|
||||||
|
this.name,
|
||||||
|
this.nameN,
|
||||||
|
});
|
||||||
|
|
||||||
|
int id;
|
||||||
|
int displayOrder;
|
||||||
|
String defaultValue;
|
||||||
|
String defaultValuen;
|
||||||
|
String name;
|
||||||
|
String nameN;
|
||||||
|
|
||||||
|
factory Specification.fromJson(Map<String, dynamic> json) => Specification(
|
||||||
|
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() => {
|
||||||
|
"id": id,
|
||||||
|
"display_order": displayOrder,
|
||||||
|
"default_value": defaultValue,
|
||||||
|
"default_valuen": defaultValuen,
|
||||||
|
"name": name,
|
||||||
|
"nameN": nameN,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class EnumValues<T> {
|
||||||
|
Map<String, T> map;
|
||||||
|
Map<T, String> reverseMap;
|
||||||
|
|
||||||
|
EnumValues(this.map);
|
||||||
|
|
||||||
|
Map<T, String> get reverse {
|
||||||
|
if (reverseMap == null) {
|
||||||
|
reverseMap = map.map((k, v) => new MapEntry(v, k));
|
||||||
|
}
|
||||||
|
return reverseMap;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,137 @@
|
|||||||
|
// To parse this JSON data, do
|
||||||
|
//
|
||||||
|
// final brand = brandFromJson(jsonString);
|
||||||
|
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
List<Brand> brandFromJson(String str) => List<Brand>.from(json.decode(str).map((x) => Brand.fromJson(x)));
|
||||||
|
|
||||||
|
String brandToJson(List<Brand> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
|
||||||
|
|
||||||
|
class Brand {
|
||||||
|
Brand({
|
||||||
|
this.id,
|
||||||
|
this.name,
|
||||||
|
this.namen,
|
||||||
|
this.localizedNames,
|
||||||
|
this.description,
|
||||||
|
this.manufacturerTemplateId,
|
||||||
|
this.metaKeywords,
|
||||||
|
this.metaDescription,
|
||||||
|
this.metaTitle,
|
||||||
|
this.pageSize,
|
||||||
|
this.pageSizeOptions,
|
||||||
|
this.priceRanges,
|
||||||
|
this.published,
|
||||||
|
this.deleted,
|
||||||
|
this.displayOrder,
|
||||||
|
this.createdOnUtc,
|
||||||
|
this.updatedOnUtc,
|
||||||
|
this.image,
|
||||||
|
});
|
||||||
|
|
||||||
|
String id;
|
||||||
|
String name;
|
||||||
|
String namen;
|
||||||
|
List<LocalizedName> localizedNames;
|
||||||
|
String description;
|
||||||
|
int manufacturerTemplateId;
|
||||||
|
String metaKeywords;
|
||||||
|
dynamic metaDescription;
|
||||||
|
dynamic metaTitle;
|
||||||
|
int pageSize;
|
||||||
|
String pageSizeOptions;
|
||||||
|
dynamic priceRanges;
|
||||||
|
bool published;
|
||||||
|
bool deleted;
|
||||||
|
int displayOrder;
|
||||||
|
DateTime createdOnUtc;
|
||||||
|
DateTime updatedOnUtc;
|
||||||
|
Image image;
|
||||||
|
|
||||||
|
factory Brand.fromJson(Map<String, dynamic> json) => Brand(
|
||||||
|
id: json["id"],
|
||||||
|
name: json["name"],
|
||||||
|
namen: json["namen"],
|
||||||
|
localizedNames: List<LocalizedName>.from(json["localized_names"].map((x) => LocalizedName.fromJson(x))),
|
||||||
|
description: json["description"] == null ? null : json["description"],
|
||||||
|
manufacturerTemplateId: json["manufacturer_template_id"],
|
||||||
|
metaKeywords: json["meta_keywords"],
|
||||||
|
metaDescription: json["meta_description"],
|
||||||
|
metaTitle: json["meta_title"],
|
||||||
|
pageSize: json["page_size"],
|
||||||
|
pageSizeOptions: json["page_size_options"],
|
||||||
|
priceRanges: json["price_ranges"],
|
||||||
|
published: json["published"],
|
||||||
|
deleted: json["deleted"],
|
||||||
|
displayOrder: json["display_order"],
|
||||||
|
createdOnUtc: DateTime.parse(json["created_on_utc"]),
|
||||||
|
updatedOnUtc: DateTime.parse(json["updated_on_utc"]),
|
||||||
|
image: json["image"] == null ? null : Image.fromJson(json["image"]),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"id": id,
|
||||||
|
"name": name,
|
||||||
|
"namen": namen,
|
||||||
|
"localized_names": List<dynamic>.from(localizedNames.map((x) => x.toJson())),
|
||||||
|
"description": description == null ? null : description,
|
||||||
|
"manufacturer_template_id": manufacturerTemplateId,
|
||||||
|
"meta_keywords": metaKeywords,
|
||||||
|
"meta_description": metaDescription,
|
||||||
|
"meta_title": metaTitle,
|
||||||
|
"page_size": pageSize,
|
||||||
|
"page_size_options": pageSizeOptions,
|
||||||
|
"price_ranges": priceRanges,
|
||||||
|
"published": published,
|
||||||
|
"deleted": deleted,
|
||||||
|
"display_order": displayOrder,
|
||||||
|
"created_on_utc": createdOnUtc.toIso8601String(),
|
||||||
|
"updated_on_utc": updatedOnUtc.toIso8601String(),
|
||||||
|
"image": image == null ? null : image.toJson(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class Image {
|
||||||
|
Image({
|
||||||
|
this.src,
|
||||||
|
this.thumb,
|
||||||
|
this.attachment,
|
||||||
|
});
|
||||||
|
|
||||||
|
String src;
|
||||||
|
dynamic thumb;
|
||||||
|
dynamic attachment;
|
||||||
|
|
||||||
|
factory Image.fromJson(Map<String, dynamic> json) => Image(
|
||||||
|
src: json["src"],
|
||||||
|
thumb: json["thumb"],
|
||||||
|
attachment: json["attachment"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"src": src,
|
||||||
|
"thumb": thumb,
|
||||||
|
"attachment": attachment,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class LocalizedName {
|
||||||
|
LocalizedName({
|
||||||
|
this.languageId,
|
||||||
|
this.localizedName,
|
||||||
|
});
|
||||||
|
|
||||||
|
int languageId;
|
||||||
|
String localizedName;
|
||||||
|
|
||||||
|
factory LocalizedName.fromJson(Map<String, dynamic> json) => LocalizedName(
|
||||||
|
languageId: json["language_id"],
|
||||||
|
localizedName: json["localized_name"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"language_id": languageId,
|
||||||
|
"localized_name": localizedName,
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -0,0 +1,159 @@
|
|||||||
|
// To parse this JSON data, do
|
||||||
|
//
|
||||||
|
// final locationModel = locationModelFromJson(jsonString);
|
||||||
|
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
List<LocationModel> locationModelFromJson(String str) => List<LocationModel>.from(json.decode(str).map((x) => LocationModel.fromJson(x)));
|
||||||
|
|
||||||
|
String locationModelToJson(List<LocationModel> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
|
||||||
|
|
||||||
|
class LocationModel {
|
||||||
|
LocationModel({
|
||||||
|
this.expiryDate,
|
||||||
|
this.sellingPrice,
|
||||||
|
this.quantity,
|
||||||
|
this.itemId,
|
||||||
|
this.locationId,
|
||||||
|
this.projectId,
|
||||||
|
this.setupId,
|
||||||
|
this.locationDescription,
|
||||||
|
this.locationDescriptionN,
|
||||||
|
this.itemDescription,
|
||||||
|
this.itemDescriptionN,
|
||||||
|
this.alias,
|
||||||
|
this.locationTypeId,
|
||||||
|
this.barcode,
|
||||||
|
this.companybarcode,
|
||||||
|
this.cityId,
|
||||||
|
this.cityName,
|
||||||
|
this.distanceInKilometers,
|
||||||
|
this.latitude,
|
||||||
|
this.locationType,
|
||||||
|
this.longitude,
|
||||||
|
this.phoneNumber,
|
||||||
|
this.projectImageUrl,
|
||||||
|
this.sortOrder,
|
||||||
|
});
|
||||||
|
|
||||||
|
ExpiryDate expiryDate;
|
||||||
|
double sellingPrice;
|
||||||
|
int quantity;
|
||||||
|
int itemId;
|
||||||
|
int locationId;
|
||||||
|
int projectId;
|
||||||
|
String setupId;
|
||||||
|
String locationDescription;
|
||||||
|
dynamic locationDescriptionN;
|
||||||
|
ItemDescription itemDescription;
|
||||||
|
dynamic itemDescriptionN;
|
||||||
|
Alias alias;
|
||||||
|
int locationTypeId;
|
||||||
|
int barcode;
|
||||||
|
dynamic companybarcode;
|
||||||
|
int cityId;
|
||||||
|
CityName cityName;
|
||||||
|
int distanceInKilometers;
|
||||||
|
String latitude;
|
||||||
|
int locationType;
|
||||||
|
String longitude;
|
||||||
|
String phoneNumber;
|
||||||
|
String projectImageUrl;
|
||||||
|
int sortOrder;
|
||||||
|
|
||||||
|
factory LocationModel.fromJson(Map<String, dynamic> json) => LocationModel(
|
||||||
|
expiryDate: expiryDateValues.map[json["ExpiryDate"]],
|
||||||
|
sellingPrice: json["SellingPrice"].toDouble(),
|
||||||
|
quantity: json["Quantity"],
|
||||||
|
itemId: json["ItemID"],
|
||||||
|
locationId: json["LocationID"],
|
||||||
|
projectId: json["ProjectID"],
|
||||||
|
setupId: json["SetupID"],
|
||||||
|
locationDescription: json["LocationDescription"],
|
||||||
|
locationDescriptionN: json["LocationDescriptionN"],
|
||||||
|
itemDescription: itemDescriptionValues.map[json["ItemDescription"]],
|
||||||
|
itemDescriptionN: json["ItemDescriptionN"],
|
||||||
|
alias: aliasValues.map[json["Alias"]],
|
||||||
|
locationTypeId: json["LocationTypeID"],
|
||||||
|
barcode: json["Barcode"],
|
||||||
|
companybarcode: json["Companybarcode"],
|
||||||
|
cityId: json["CityID"],
|
||||||
|
cityName: cityNameValues.map[json["CityName"]],
|
||||||
|
distanceInKilometers: json["DistanceInKilometers"],
|
||||||
|
latitude: json["Latitude"],
|
||||||
|
locationType: json["LocationType"],
|
||||||
|
longitude: json["Longitude"],
|
||||||
|
phoneNumber: json["PhoneNumber"],
|
||||||
|
projectImageUrl: json["ProjectImageURL"],
|
||||||
|
sortOrder: json["SortOrder"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"ExpiryDate": expiryDateValues.reverse[expiryDate],
|
||||||
|
"SellingPrice": sellingPrice,
|
||||||
|
"Quantity": quantity,
|
||||||
|
"ItemID": itemId,
|
||||||
|
"LocationID": locationId,
|
||||||
|
"ProjectID": projectId,
|
||||||
|
"SetupID": setupId,
|
||||||
|
"LocationDescription": locationDescription,
|
||||||
|
"LocationDescriptionN": locationDescriptionN,
|
||||||
|
"ItemDescription": itemDescriptionValues.reverse[itemDescription],
|
||||||
|
"ItemDescriptionN": itemDescriptionN,
|
||||||
|
"Alias": aliasValues.reverse[alias],
|
||||||
|
"LocationTypeID": locationTypeId,
|
||||||
|
"Barcode": barcode,
|
||||||
|
"Companybarcode": companybarcode,
|
||||||
|
"CityID": cityId,
|
||||||
|
"CityName": cityNameValues.reverse[cityName],
|
||||||
|
"DistanceInKilometers": distanceInKilometers,
|
||||||
|
"Latitude": latitude,
|
||||||
|
"LocationType": locationType,
|
||||||
|
"Longitude": longitude,
|
||||||
|
"PhoneNumber": phoneNumber,
|
||||||
|
"ProjectImageURL": projectImageUrl,
|
||||||
|
"SortOrder": sortOrder,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Alias { CAPSULE }
|
||||||
|
|
||||||
|
final aliasValues = EnumValues({
|
||||||
|
"CAPSULE": Alias.CAPSULE
|
||||||
|
});
|
||||||
|
|
||||||
|
enum CityName { RIYADH, KHOBAR, QASSIM }
|
||||||
|
|
||||||
|
final cityNameValues = EnumValues({
|
||||||
|
"Khobar": CityName.KHOBAR,
|
||||||
|
"Qassim": CityName.QASSIM,
|
||||||
|
"Riyadh": CityName.RIYADH
|
||||||
|
});
|
||||||
|
|
||||||
|
enum ExpiryDate { DATE_16223220000000300, DATE_16250004000000300, DATE_16538580000000300 }
|
||||||
|
|
||||||
|
final expiryDateValues = EnumValues({
|
||||||
|
"/Date(1622322000000+0300)/": ExpiryDate.DATE_16223220000000300,
|
||||||
|
"/Date(1625000400000+0300)/": ExpiryDate.DATE_16250004000000300,
|
||||||
|
"/Date(1653858000000+0300)/": ExpiryDate.DATE_16538580000000300
|
||||||
|
});
|
||||||
|
|
||||||
|
enum ItemDescription { XERACTAN_20_MG_CAP_30_S }
|
||||||
|
|
||||||
|
final itemDescriptionValues = EnumValues({
|
||||||
|
"XERACTAN 20 MG CAP 30'S": ItemDescription.XERACTAN_20_MG_CAP_30_S
|
||||||
|
});
|
||||||
|
|
||||||
|
class EnumValues<T> {
|
||||||
|
Map<String, T> map;
|
||||||
|
Map<T, String> reverseMap;
|
||||||
|
|
||||||
|
EnumValues(this.map);
|
||||||
|
|
||||||
|
Map<T, String> get reverse {
|
||||||
|
if (reverseMap == null) {
|
||||||
|
reverseMap = map.map((k, v) => new MapEntry(v, k));
|
||||||
|
}
|
||||||
|
return reverseMap;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,249 @@
|
|||||||
|
// To parse this JSON data, do
|
||||||
|
//
|
||||||
|
// final productDetail = productDetailFromJson(jsonString);
|
||||||
|
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
List<ProductDetail> productDetailFromJson(String str) => List<ProductDetail>.from(json.decode(str).map((x) => ProductDetail.fromJson(x)));
|
||||||
|
|
||||||
|
String productDetailToJson(List<ProductDetail> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
|
||||||
|
|
||||||
|
class ProductDetail {
|
||||||
|
ProductDetail({
|
||||||
|
this.reviews,
|
||||||
|
});
|
||||||
|
|
||||||
|
List<Review> reviews;
|
||||||
|
|
||||||
|
factory ProductDetail.fromJson(Map<String, dynamic> json) => ProductDetail(
|
||||||
|
reviews: List<Review>.from(json["reviews"].map((x) => Review.fromJson(x))),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"reviews": List<dynamic>.from(reviews.map((x) => x.toJson())),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class Review {
|
||||||
|
Review({
|
||||||
|
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,
|
||||||
|
});
|
||||||
|
|
||||||
|
int id;
|
||||||
|
int position;
|
||||||
|
int reviewId;
|
||||||
|
int customerId;
|
||||||
|
int productId;
|
||||||
|
int storeId;
|
||||||
|
bool isApproved;
|
||||||
|
String title;
|
||||||
|
String reviewText;
|
||||||
|
dynamic replyText;
|
||||||
|
int rating;
|
||||||
|
int helpfulYesTotal;
|
||||||
|
int helpfulNoTotal;
|
||||||
|
DateTime createdOnUtc;
|
||||||
|
Customer customer;
|
||||||
|
dynamic product;
|
||||||
|
|
||||||
|
factory Review.fromJson(Map<String, dynamic> json) => Review(
|
||||||
|
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: DateTime.parse(json["created_on_utc"]),
|
||||||
|
customer: Customer.fromJson(json["customer"]),
|
||||||
|
product: json["product"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"id": id,
|
||||||
|
"position": position,
|
||||||
|
"review_id": reviewId,
|
||||||
|
"customer_id": customerId,
|
||||||
|
"product_id": productId,
|
||||||
|
"store_id": storeId,
|
||||||
|
"is_approved": isApproved,
|
||||||
|
"title": title,
|
||||||
|
"review_text": reviewText,
|
||||||
|
"reply_text": replyText,
|
||||||
|
"rating": rating,
|
||||||
|
"helpful_yes_total": helpfulYesTotal,
|
||||||
|
"helpful_no_total": helpfulNoTotal,
|
||||||
|
"created_on_utc": createdOnUtc.toIso8601String(),
|
||||||
|
"customer": customer.toJson(),
|
||||||
|
"product": product,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class Customer {
|
||||||
|
Customer({
|
||||||
|
this.fileNumber,
|
||||||
|
this.iqamaNumber,
|
||||||
|
this.isOutSa,
|
||||||
|
this.patientType,
|
||||||
|
this.gender,
|
||||||
|
this.birthDate,
|
||||||
|
this.phone,
|
||||||
|
this.countryCode,
|
||||||
|
this.yahalaAccountno,
|
||||||
|
this.billingAddress,
|
||||||
|
this.shippingAddress,
|
||||||
|
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,
|
||||||
|
});
|
||||||
|
|
||||||
|
dynamic fileNumber;
|
||||||
|
dynamic iqamaNumber;
|
||||||
|
int isOutSa;
|
||||||
|
int patientType;
|
||||||
|
dynamic gender;
|
||||||
|
DateTime birthDate;
|
||||||
|
dynamic phone;
|
||||||
|
dynamic countryCode;
|
||||||
|
dynamic yahalaAccountno;
|
||||||
|
dynamic billingAddress;
|
||||||
|
dynamic shippingAddress;
|
||||||
|
String id;
|
||||||
|
Email username;
|
||||||
|
Email email;
|
||||||
|
dynamic firstName;
|
||||||
|
dynamic lastName;
|
||||||
|
dynamic languageId;
|
||||||
|
dynamic adminComment;
|
||||||
|
dynamic isTaxExempt;
|
||||||
|
dynamic hasShoppingCartItems;
|
||||||
|
dynamic active;
|
||||||
|
dynamic deleted;
|
||||||
|
dynamic isSystemAccount;
|
||||||
|
dynamic systemName;
|
||||||
|
dynamic lastIpAddress;
|
||||||
|
dynamic createdOnUtc;
|
||||||
|
dynamic lastLoginDateUtc;
|
||||||
|
dynamic lastActivityDateUtc;
|
||||||
|
dynamic registeredInStoreId;
|
||||||
|
|
||||||
|
factory Customer.fromJson(Map<String, dynamic> json) => Customer(
|
||||||
|
fileNumber: json["file_number"],
|
||||||
|
iqamaNumber: json["iqama_number"],
|
||||||
|
isOutSa: json["is_out_sa"],
|
||||||
|
patientType: json["patient_type"],
|
||||||
|
gender: json["gender"],
|
||||||
|
birthDate: DateTime.parse(json["birth_date"]),
|
||||||
|
phone: json["phone"],
|
||||||
|
countryCode: json["country_code"],
|
||||||
|
yahalaAccountno: json["yahala_accountno"],
|
||||||
|
billingAddress: json["billing_address"],
|
||||||
|
shippingAddress: json["shipping_address"],
|
||||||
|
id: json["id"],
|
||||||
|
username: emailValues.map[json["username"]],
|
||||||
|
email: emailValues.map[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"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"file_number": fileNumber,
|
||||||
|
"iqama_number": iqamaNumber,
|
||||||
|
"is_out_sa": isOutSa,
|
||||||
|
"patient_type": patientType,
|
||||||
|
"gender": gender,
|
||||||
|
"birth_date": birthDate.toIso8601String(),
|
||||||
|
"phone": phone,
|
||||||
|
"country_code": countryCode,
|
||||||
|
"yahala_accountno": yahalaAccountno,
|
||||||
|
"billing_address": billingAddress,
|
||||||
|
"shipping_address": shippingAddress,
|
||||||
|
"id": id,
|
||||||
|
"username": emailValues.reverse[username],
|
||||||
|
"email": emailValues.reverse[email],
|
||||||
|
"first_name": firstName,
|
||||||
|
"last_name": lastName,
|
||||||
|
"language_id": languageId,
|
||||||
|
"admin_comment": adminComment,
|
||||||
|
"is_tax_exempt": isTaxExempt,
|
||||||
|
"has_shopping_cart_items": hasShoppingCartItems,
|
||||||
|
"active": active,
|
||||||
|
"deleted": deleted,
|
||||||
|
"is_system_account": isSystemAccount,
|
||||||
|
"system_name": systemName,
|
||||||
|
"last_ip_address": lastIpAddress,
|
||||||
|
"created_on_utc": createdOnUtc,
|
||||||
|
"last_login_date_utc": lastLoginDateUtc,
|
||||||
|
"last_activity_date_utc": lastActivityDateUtc,
|
||||||
|
"registered_in_store_id": registeredInStoreId,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Email { STEVE_GATES_NOP_COMMERCE_COM }
|
||||||
|
|
||||||
|
final emailValues = EnumValues({
|
||||||
|
"steve_gates@nopCommerce.com": Email.STEVE_GATES_NOP_COMMERCE_COM
|
||||||
|
});
|
||||||
|
|
||||||
|
class EnumValues<T> {
|
||||||
|
Map<String, T> map;
|
||||||
|
Map<T, String> reverseMap;
|
||||||
|
|
||||||
|
EnumValues(this.map);
|
||||||
|
|
||||||
|
Map<T, String> get reverse {
|
||||||
|
if (reverseMap == null) {
|
||||||
|
reverseMap = map.map((k, v) => new MapEntry(v, k));
|
||||||
|
}
|
||||||
|
return reverseMap;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,835 @@
|
|||||||
|
// To parse this JSON data, do
|
||||||
|
//
|
||||||
|
// final products = productsFromJson(jsonString);
|
||||||
|
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
Products productsFromJson(String str) => Products.fromJson(json.decode(str));
|
||||||
|
|
||||||
|
String productsToJson(Products data) => json.encode(data.toJson());
|
||||||
|
|
||||||
|
class Products {
|
||||||
|
Products({
|
||||||
|
this.messageStatus,
|
||||||
|
this.products,
|
||||||
|
});
|
||||||
|
|
||||||
|
dynamic messageStatus;
|
||||||
|
List<Product> products;
|
||||||
|
|
||||||
|
factory Products.fromJson(Map<String, dynamic> json) => Products(
|
||||||
|
messageStatus: json["MessageStatus"],
|
||||||
|
products: List<Product>.from(json["products"].map((x) => Product.fromJson(x))),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"MessageStatus": messageStatus,
|
||||||
|
"products": List<dynamic>.from(products.map((x) => x.toJson())),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class Product {
|
||||||
|
Product({
|
||||||
|
this.id,
|
||||||
|
this.visibleIndividually,
|
||||||
|
this.name,
|
||||||
|
this.namen,
|
||||||
|
this.localizedNames,
|
||||||
|
this.shortDescription,
|
||||||
|
this.shortDescriptionn,
|
||||||
|
this.fullDescription,
|
||||||
|
this.fullDescriptionn,
|
||||||
|
this.markasNew,
|
||||||
|
this.showOnHomePage,
|
||||||
|
this.metaKeywords,
|
||||||
|
this.metaDescription,
|
||||||
|
this.metaTitle,
|
||||||
|
this.allowCustomerReviews,
|
||||||
|
this.approvedRatingSum,
|
||||||
|
this.notApprovedRatingSum,
|
||||||
|
this.approvedTotalReviews,
|
||||||
|
this.notApprovedTotalReviews,
|
||||||
|
this.sku,
|
||||||
|
this.isRx,
|
||||||
|
this.prescriptionRequired,
|
||||||
|
this.rxMessage,
|
||||||
|
this.rxMessagen,
|
||||||
|
this.manufacturerPartNumber,
|
||||||
|
this.gtin,
|
||||||
|
this.isGiftCard,
|
||||||
|
this.requireOtherProducts,
|
||||||
|
this.automaticallyAddRequiredProducts,
|
||||||
|
this.isDownload,
|
||||||
|
this.unlimitedDownloads,
|
||||||
|
this.maxNumberOfDownloads,
|
||||||
|
this.downloadExpirationDays,
|
||||||
|
this.hasSampleDownload,
|
||||||
|
this.hasUserAgreement,
|
||||||
|
this.isRecurring,
|
||||||
|
this.recurringCycleLength,
|
||||||
|
this.recurringTotalCycles,
|
||||||
|
this.isRental,
|
||||||
|
this.rentalPriceLength,
|
||||||
|
this.isShipEnabled,
|
||||||
|
this.isFreeShipping,
|
||||||
|
this.shipSeparately,
|
||||||
|
this.additionalShippingCharge,
|
||||||
|
this.isTaxExempt,
|
||||||
|
this.isTelecommunicationsOrBroadcastingOrElectronicServices,
|
||||||
|
this.useMultipleWarehouses,
|
||||||
|
this.manageInventoryMethodId,
|
||||||
|
this.stockQuantity,
|
||||||
|
this.stockAvailability,
|
||||||
|
this.stockAvailabilityn,
|
||||||
|
this.displayStockAvailability,
|
||||||
|
this.displayStockQuantity,
|
||||||
|
this.minStockQuantity,
|
||||||
|
this.notifyAdminForQuantityBelow,
|
||||||
|
this.allowBackInStockSubscriptions,
|
||||||
|
this.orderMinimumQuantity,
|
||||||
|
this.orderMaximumQuantity,
|
||||||
|
this.allowedQuantities,
|
||||||
|
this.allowAddingOnlyExistingAttributeCombinations,
|
||||||
|
this.disableBuyButton,
|
||||||
|
this.disableWishlistButton,
|
||||||
|
this.availableForPreOrder,
|
||||||
|
this.preOrderAvailabilityStartDateTimeUtc,
|
||||||
|
this.callForPrice,
|
||||||
|
this.price,
|
||||||
|
this.oldPrice,
|
||||||
|
this.productCost,
|
||||||
|
this.specialPrice,
|
||||||
|
this.specialPriceStartDateTimeUtc,
|
||||||
|
this.specialPriceEndDateTimeUtc,
|
||||||
|
this.customerEntersPrice,
|
||||||
|
this.minimumCustomerEnteredPrice,
|
||||||
|
this.maximumCustomerEnteredPrice,
|
||||||
|
this.basepriceEnabled,
|
||||||
|
this.basepriceAmount,
|
||||||
|
this.basepriceBaseAmount,
|
||||||
|
this.hasTierPrices,
|
||||||
|
this.hasDiscountsApplied,
|
||||||
|
this.discountName,
|
||||||
|
this.discountNamen,
|
||||||
|
this.discountDescription,
|
||||||
|
this.discountDescriptionn,
|
||||||
|
this.discountPercentage,
|
||||||
|
this.currency,
|
||||||
|
this.currencyn,
|
||||||
|
this.weight,
|
||||||
|
this.length,
|
||||||
|
this.width,
|
||||||
|
this.height,
|
||||||
|
this.availableStartDateTimeUtc,
|
||||||
|
this.availableEndDateTimeUtc,
|
||||||
|
this.displayOrder,
|
||||||
|
this.published,
|
||||||
|
this.deleted,
|
||||||
|
this.createdOnUtc,
|
||||||
|
this.updatedOnUtc,
|
||||||
|
this.productType,
|
||||||
|
this.parentGroupedProductId,
|
||||||
|
this.roleIds,
|
||||||
|
this.discountIds,
|
||||||
|
this.storeIds,
|
||||||
|
this.manufacturerIds,
|
||||||
|
this.reviews,
|
||||||
|
this.images,
|
||||||
|
this.attributes,
|
||||||
|
this.specifications,
|
||||||
|
this.associatedProductIds,
|
||||||
|
this.tags,
|
||||||
|
this.vendorId,
|
||||||
|
this.seName,
|
||||||
|
});
|
||||||
|
|
||||||
|
String id;
|
||||||
|
bool visibleIndividually;
|
||||||
|
String name;
|
||||||
|
String namen;
|
||||||
|
List<LocalizedName> localizedNames;
|
||||||
|
String shortDescription;
|
||||||
|
String shortDescriptionn;
|
||||||
|
String fullDescription;
|
||||||
|
String fullDescriptionn;
|
||||||
|
bool markasNew;
|
||||||
|
bool showOnHomePage;
|
||||||
|
String metaKeywords;
|
||||||
|
String metaDescription;
|
||||||
|
String metaTitle;
|
||||||
|
bool allowCustomerReviews;
|
||||||
|
int approvedRatingSum;
|
||||||
|
int notApprovedRatingSum;
|
||||||
|
int approvedTotalReviews;
|
||||||
|
int notApprovedTotalReviews;
|
||||||
|
String sku;
|
||||||
|
bool isRx;
|
||||||
|
bool prescriptionRequired;
|
||||||
|
String rxMessage;
|
||||||
|
String rxMessagen;
|
||||||
|
dynamic manufacturerPartNumber;
|
||||||
|
dynamic gtin;
|
||||||
|
bool isGiftCard;
|
||||||
|
bool requireOtherProducts;
|
||||||
|
bool automaticallyAddRequiredProducts;
|
||||||
|
bool isDownload;
|
||||||
|
bool unlimitedDownloads;
|
||||||
|
int maxNumberOfDownloads;
|
||||||
|
dynamic downloadExpirationDays;
|
||||||
|
bool hasSampleDownload;
|
||||||
|
bool hasUserAgreement;
|
||||||
|
bool isRecurring;
|
||||||
|
int recurringCycleLength;
|
||||||
|
int recurringTotalCycles;
|
||||||
|
bool isRental;
|
||||||
|
int rentalPriceLength;
|
||||||
|
bool isShipEnabled;
|
||||||
|
bool isFreeShipping;
|
||||||
|
bool shipSeparately;
|
||||||
|
int additionalShippingCharge;
|
||||||
|
bool isTaxExempt;
|
||||||
|
bool isTelecommunicationsOrBroadcastingOrElectronicServices;
|
||||||
|
bool useMultipleWarehouses;
|
||||||
|
int manageInventoryMethodId;
|
||||||
|
int stockQuantity;
|
||||||
|
String stockAvailability;
|
||||||
|
String stockAvailabilityn;
|
||||||
|
bool displayStockAvailability;
|
||||||
|
bool displayStockQuantity;
|
||||||
|
int minStockQuantity;
|
||||||
|
int notifyAdminForQuantityBelow;
|
||||||
|
bool allowBackInStockSubscriptions;
|
||||||
|
int orderMinimumQuantity;
|
||||||
|
int orderMaximumQuantity;
|
||||||
|
dynamic allowedQuantities;
|
||||||
|
bool allowAddingOnlyExistingAttributeCombinations;
|
||||||
|
bool disableBuyButton;
|
||||||
|
bool disableWishlistButton;
|
||||||
|
bool availableForPreOrder;
|
||||||
|
dynamic preOrderAvailabilityStartDateTimeUtc;
|
||||||
|
bool callForPrice;
|
||||||
|
double price;
|
||||||
|
int oldPrice;
|
||||||
|
double productCost;
|
||||||
|
dynamic specialPrice;
|
||||||
|
dynamic specialPriceStartDateTimeUtc;
|
||||||
|
dynamic specialPriceEndDateTimeUtc;
|
||||||
|
bool customerEntersPrice;
|
||||||
|
int minimumCustomerEnteredPrice;
|
||||||
|
int maximumCustomerEnteredPrice;
|
||||||
|
bool basepriceEnabled;
|
||||||
|
int basepriceAmount;
|
||||||
|
int basepriceBaseAmount;
|
||||||
|
bool hasTierPrices;
|
||||||
|
bool hasDiscountsApplied;
|
||||||
|
String discountName;
|
||||||
|
String discountNamen;
|
||||||
|
String discountDescription;
|
||||||
|
String discountDescriptionn;
|
||||||
|
String discountPercentage;
|
||||||
|
String currency;
|
||||||
|
String currencyn;
|
||||||
|
double weight;
|
||||||
|
int length;
|
||||||
|
int width;
|
||||||
|
int height;
|
||||||
|
dynamic availableStartDateTimeUtc;
|
||||||
|
dynamic availableEndDateTimeUtc;
|
||||||
|
int displayOrder;
|
||||||
|
bool published;
|
||||||
|
bool deleted;
|
||||||
|
DateTime createdOnUtc;
|
||||||
|
DateTime updatedOnUtc;
|
||||||
|
String productType;
|
||||||
|
int parentGroupedProductId;
|
||||||
|
List<dynamic> roleIds;
|
||||||
|
List<int> discountIds;
|
||||||
|
List<dynamic> storeIds;
|
||||||
|
List<int> manufacturerIds;
|
||||||
|
List<Review> reviews;
|
||||||
|
List<Image> images;
|
||||||
|
List<dynamic> attributes;
|
||||||
|
List<Specification> specifications;
|
||||||
|
List<dynamic> associatedProductIds;
|
||||||
|
List<dynamic> tags;
|
||||||
|
int vendorId;
|
||||||
|
String seName;
|
||||||
|
|
||||||
|
factory Product.fromJson(Map<String, dynamic> json) => Product(
|
||||||
|
id: json["id"],
|
||||||
|
visibleIndividually: json["visible_individually"],
|
||||||
|
name: json["name"],
|
||||||
|
namen: json["namen"],
|
||||||
|
localizedNames: List<LocalizedName>.from(json["localized_names"].map((x) => LocalizedName.fromJson(x))),
|
||||||
|
shortDescription: json["short_description"] == null ? null : json["short_description"],
|
||||||
|
shortDescriptionn: json["short_descriptionn"] == null ? null : json["short_descriptionn"],
|
||||||
|
fullDescription: json["full_description"],
|
||||||
|
fullDescriptionn: json["full_descriptionn"],
|
||||||
|
markasNew: json["markas_new"],
|
||||||
|
showOnHomePage: json["show_on_home_page"],
|
||||||
|
metaKeywords: json["meta_keywords"] == null ? null : json["meta_keywords"],
|
||||||
|
metaDescription: json["meta_description"] == null ? null : json["meta_description"],
|
||||||
|
metaTitle: json["meta_title"] == null ? null : json["meta_title"],
|
||||||
|
allowCustomerReviews: json["allow_customer_reviews"],
|
||||||
|
approvedRatingSum: json["approved_rating_sum"],
|
||||||
|
notApprovedRatingSum: json["not_approved_rating_sum"],
|
||||||
|
approvedTotalReviews: json["approved_total_reviews"],
|
||||||
|
notApprovedTotalReviews: json["not_approved_total_reviews"],
|
||||||
|
sku: json["sku"],
|
||||||
|
isRx: json["is_rx"],
|
||||||
|
prescriptionRequired: json["prescription_required"],
|
||||||
|
rxMessage: json["rx_message"] == null ? null : json["rx_message"],
|
||||||
|
rxMessagen: json["rx_messagen"] == null ? null : json["rx_messagen"],
|
||||||
|
manufacturerPartNumber: json["manufacturer_part_number"],
|
||||||
|
gtin: json["gtin"],
|
||||||
|
isGiftCard: json["is_gift_card"],
|
||||||
|
requireOtherProducts: json["require_other_products"],
|
||||||
|
automaticallyAddRequiredProducts: json["automatically_add_required_products"],
|
||||||
|
isDownload: json["is_download"],
|
||||||
|
unlimitedDownloads: json["unlimited_downloads"],
|
||||||
|
maxNumberOfDownloads: json["max_number_of_downloads"],
|
||||||
|
downloadExpirationDays: json["download_expiration_days"],
|
||||||
|
hasSampleDownload: json["has_sample_download"],
|
||||||
|
hasUserAgreement: json["has_user_agreement"],
|
||||||
|
isRecurring: json["is_recurring"],
|
||||||
|
recurringCycleLength: json["recurring_cycle_length"],
|
||||||
|
recurringTotalCycles: json["recurring_total_cycles"],
|
||||||
|
isRental: json["is_rental"],
|
||||||
|
rentalPriceLength: json["rental_price_length"],
|
||||||
|
isShipEnabled: json["is_ship_enabled"],
|
||||||
|
isFreeShipping: json["is_free_shipping"],
|
||||||
|
shipSeparately: json["ship_separately"],
|
||||||
|
additionalShippingCharge: json["additional_shipping_charge"],
|
||||||
|
isTaxExempt: json["is_tax_exempt"],
|
||||||
|
isTelecommunicationsOrBroadcastingOrElectronicServices: json["is_telecommunications_or_broadcasting_or_electronic_services"],
|
||||||
|
useMultipleWarehouses: json["use_multiple_warehouses"],
|
||||||
|
manageInventoryMethodId: json["manage_inventory_method_id"],
|
||||||
|
stockQuantity: json["stock_quantity"],
|
||||||
|
stockAvailability: json["stock_availability"],
|
||||||
|
stockAvailabilityn: json["stock_availabilityn"],
|
||||||
|
displayStockAvailability: json["display_stock_availability"],
|
||||||
|
displayStockQuantity: json["display_stock_quantity"],
|
||||||
|
minStockQuantity: json["min_stock_quantity"],
|
||||||
|
notifyAdminForQuantityBelow: json["notify_admin_for_quantity_below"],
|
||||||
|
allowBackInStockSubscriptions: json["allow_back_in_stock_subscriptions"],
|
||||||
|
orderMinimumQuantity: json["order_minimum_quantity"],
|
||||||
|
orderMaximumQuantity: json["order_maximum_quantity"],
|
||||||
|
allowedQuantities: json["allowed_quantities"],
|
||||||
|
allowAddingOnlyExistingAttributeCombinations: json["allow_adding_only_existing_attribute_combinations"],
|
||||||
|
disableBuyButton: json["disable_buy_button"],
|
||||||
|
disableWishlistButton: json["disable_wishlist_button"],
|
||||||
|
availableForPreOrder: json["available_for_pre_order"],
|
||||||
|
preOrderAvailabilityStartDateTimeUtc: json["pre_order_availability_start_date_time_utc"],
|
||||||
|
callForPrice: json["call_for_price"],
|
||||||
|
price: json["price"].toDouble(),
|
||||||
|
oldPrice: json["old_price"],
|
||||||
|
productCost: json["product_cost"].toDouble(),
|
||||||
|
specialPrice: json["special_price"],
|
||||||
|
specialPriceStartDateTimeUtc: json["special_price_start_date_time_utc"],
|
||||||
|
specialPriceEndDateTimeUtc: json["special_price_end_date_time_utc"],
|
||||||
|
customerEntersPrice: json["customer_enters_price"],
|
||||||
|
minimumCustomerEnteredPrice: json["minimum_customer_entered_price"],
|
||||||
|
maximumCustomerEnteredPrice: json["maximum_customer_entered_price"],
|
||||||
|
basepriceEnabled: json["baseprice_enabled"],
|
||||||
|
basepriceAmount: json["baseprice_amount"],
|
||||||
|
basepriceBaseAmount: json["baseprice_base_amount"],
|
||||||
|
hasTierPrices: json["has_tier_prices"],
|
||||||
|
hasDiscountsApplied: json["has_discounts_applied"],
|
||||||
|
discountName: json["discount_name"] == null ? null : json["discount_name"],
|
||||||
|
discountNamen: json["discount_namen"] == null ? null : json["discount_namen"],
|
||||||
|
discountDescription: json["discount_description"] == null ? null : json["discount_description"],
|
||||||
|
discountDescriptionn: json["discount_Descriptionn"] == null ? null : json["discount_Descriptionn"],
|
||||||
|
discountPercentage: json["discount_percentage"] == null ? null : json["discount_percentage"],
|
||||||
|
currency: json["currency"],
|
||||||
|
currencyn: json["currencyn"],
|
||||||
|
weight: json["weight"].toDouble(),
|
||||||
|
length: json["length"],
|
||||||
|
width: json["width"],
|
||||||
|
height: json["height"],
|
||||||
|
availableStartDateTimeUtc: json["available_start_date_time_utc"],
|
||||||
|
availableEndDateTimeUtc: json["available_end_date_time_utc"],
|
||||||
|
displayOrder: json["display_order"],
|
||||||
|
published: json["published"],
|
||||||
|
deleted: json["deleted"],
|
||||||
|
createdOnUtc: DateTime.parse(json["created_on_utc"]),
|
||||||
|
updatedOnUtc: DateTime.parse(json["updated_on_utc"]),
|
||||||
|
productType: json["product_type"],
|
||||||
|
parentGroupedProductId: json["parent_grouped_product_id"],
|
||||||
|
roleIds: List<dynamic>.from(json["role_ids"].map((x) => x)),
|
||||||
|
discountIds: List<int>.from(json["discount_ids"].map((x) => x)),
|
||||||
|
storeIds: List<dynamic>.from(json["store_ids"].map((x) => x)),
|
||||||
|
manufacturerIds: List<int>.from(json["manufacturer_ids"].map((x) => x)),
|
||||||
|
reviews: List<Review>.from(json["reviews"].map((x) => Review.fromJson(x))),
|
||||||
|
images: List<Image>.from(json["images"].map((x) => Image.fromJson(x))),
|
||||||
|
attributes: List<dynamic>.from(json["attributes"].map((x) => x)),
|
||||||
|
specifications: List<Specification>.from(json["specifications"].map((x) => Specification.fromJson(x))),
|
||||||
|
associatedProductIds: List<dynamic>.from(json["associated_product_ids"].map((x) => x)),
|
||||||
|
tags: List<dynamic>.from(json["tags"].map((x) => x)),
|
||||||
|
vendorId: json["vendor_id"],
|
||||||
|
seName: json["se_name"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"id": id,
|
||||||
|
"visible_individually": visibleIndividually,
|
||||||
|
"name": name,
|
||||||
|
"namen": namen,
|
||||||
|
"localized_names": List<dynamic>.from(localizedNames.map((x) => x.toJson())),
|
||||||
|
"short_description": shortDescription == null ? null : shortDescription,
|
||||||
|
"short_descriptionn": shortDescriptionn == null ? null : shortDescriptionn,
|
||||||
|
"full_description": fullDescription,
|
||||||
|
"full_descriptionn": fullDescriptionn,
|
||||||
|
"markas_new": markasNew,
|
||||||
|
"show_on_home_page": showOnHomePage,
|
||||||
|
"meta_keywords": metaKeywords == null ? null : metaKeywords,
|
||||||
|
"meta_description": metaDescription == null ? null : metaDescription,
|
||||||
|
"meta_title": metaTitle == null ? null : metaTitle,
|
||||||
|
"allow_customer_reviews": allowCustomerReviews,
|
||||||
|
"approved_rating_sum": approvedRatingSum,
|
||||||
|
"not_approved_rating_sum": notApprovedRatingSum,
|
||||||
|
"approved_total_reviews": approvedTotalReviews,
|
||||||
|
"not_approved_total_reviews": notApprovedTotalReviews,
|
||||||
|
"sku": sku,
|
||||||
|
"is_rx": isRx,
|
||||||
|
"prescription_required": prescriptionRequired,
|
||||||
|
"rx_message": rxMessage == null ? null : rxMessage,
|
||||||
|
"rx_messagen": rxMessagen == null ? null : rxMessagen,
|
||||||
|
"manufacturer_part_number": manufacturerPartNumber,
|
||||||
|
"gtin": gtin,
|
||||||
|
"is_gift_card": isGiftCard,
|
||||||
|
"require_other_products": requireOtherProducts,
|
||||||
|
"automatically_add_required_products": automaticallyAddRequiredProducts,
|
||||||
|
"is_download": isDownload,
|
||||||
|
"unlimited_downloads": unlimitedDownloads,
|
||||||
|
"max_number_of_downloads": maxNumberOfDownloads,
|
||||||
|
"download_expiration_days": downloadExpirationDays,
|
||||||
|
"has_sample_download": hasSampleDownload,
|
||||||
|
"has_user_agreement": hasUserAgreement,
|
||||||
|
"is_recurring": isRecurring,
|
||||||
|
"recurring_cycle_length": recurringCycleLength,
|
||||||
|
"recurring_total_cycles": recurringTotalCycles,
|
||||||
|
"is_rental": isRental,
|
||||||
|
"rental_price_length": rentalPriceLength,
|
||||||
|
"is_ship_enabled": isShipEnabled,
|
||||||
|
"is_free_shipping": isFreeShipping,
|
||||||
|
"ship_separately": shipSeparately,
|
||||||
|
"additional_shipping_charge": additionalShippingCharge,
|
||||||
|
"is_tax_exempt": isTaxExempt,
|
||||||
|
"is_telecommunications_or_broadcasting_or_electronic_services": isTelecommunicationsOrBroadcastingOrElectronicServices,
|
||||||
|
"use_multiple_warehouses": useMultipleWarehouses,
|
||||||
|
"manage_inventory_method_id": manageInventoryMethodId,
|
||||||
|
"stock_quantity": stockQuantity,
|
||||||
|
"stock_availability": stockAvailability,
|
||||||
|
"stock_availabilityn": stockAvailabilityn,
|
||||||
|
"display_stock_availability": displayStockAvailability,
|
||||||
|
"display_stock_quantity": displayStockQuantity,
|
||||||
|
"min_stock_quantity": minStockQuantity,
|
||||||
|
"notify_admin_for_quantity_below": notifyAdminForQuantityBelow,
|
||||||
|
"allow_back_in_stock_subscriptions": allowBackInStockSubscriptions,
|
||||||
|
"order_minimum_quantity": orderMinimumQuantity,
|
||||||
|
"order_maximum_quantity": orderMaximumQuantity,
|
||||||
|
"allowed_quantities": allowedQuantities,
|
||||||
|
"allow_adding_only_existing_attribute_combinations": allowAddingOnlyExistingAttributeCombinations,
|
||||||
|
"disable_buy_button": disableBuyButton,
|
||||||
|
"disable_wishlist_button": disableWishlistButton,
|
||||||
|
"available_for_pre_order": availableForPreOrder,
|
||||||
|
"pre_order_availability_start_date_time_utc": preOrderAvailabilityStartDateTimeUtc,
|
||||||
|
"call_for_price": callForPrice,
|
||||||
|
"price": price,
|
||||||
|
"old_price": oldPrice,
|
||||||
|
"product_cost": productCost,
|
||||||
|
"special_price": specialPrice,
|
||||||
|
"special_price_start_date_time_utc": specialPriceStartDateTimeUtc,
|
||||||
|
"special_price_end_date_time_utc": specialPriceEndDateTimeUtc,
|
||||||
|
"customer_enters_price": customerEntersPrice,
|
||||||
|
"minimum_customer_entered_price": minimumCustomerEnteredPrice,
|
||||||
|
"maximum_customer_entered_price": maximumCustomerEnteredPrice,
|
||||||
|
"baseprice_enabled": basepriceEnabled,
|
||||||
|
"baseprice_amount": basepriceAmount,
|
||||||
|
"baseprice_base_amount": basepriceBaseAmount,
|
||||||
|
"has_tier_prices": hasTierPrices,
|
||||||
|
"has_discounts_applied": hasDiscountsApplied,
|
||||||
|
"discount_name": discountName == null ? null : discountName,
|
||||||
|
"discount_namen": discountNamen == null ? null : discountNamen,
|
||||||
|
"discount_description": discountDescription == null ? null : discountDescription,
|
||||||
|
"discount_Descriptionn": discountDescriptionn == null ? null : discountDescriptionn,
|
||||||
|
"discount_percentage": discountPercentage == null ? null : discountPercentage,
|
||||||
|
"currency": currency,
|
||||||
|
"currencyn": currencyn,
|
||||||
|
"weight": weight,
|
||||||
|
"length": length,
|
||||||
|
"width": width,
|
||||||
|
"height": height,
|
||||||
|
"available_start_date_time_utc": availableStartDateTimeUtc,
|
||||||
|
"available_end_date_time_utc": availableEndDateTimeUtc,
|
||||||
|
"display_order": displayOrder,
|
||||||
|
"published": published,
|
||||||
|
"deleted": deleted,
|
||||||
|
"created_on_utc": createdOnUtc.toIso8601String(),
|
||||||
|
"updated_on_utc": updatedOnUtc.toIso8601String(),
|
||||||
|
"product_type": productType,
|
||||||
|
"parent_grouped_product_id": parentGroupedProductId,
|
||||||
|
"role_ids": List<dynamic>.from(roleIds.map((x) => x)),
|
||||||
|
"discount_ids": List<dynamic>.from(discountIds.map((x) => x)),
|
||||||
|
"store_ids": List<dynamic>.from(storeIds.map((x) => x)),
|
||||||
|
"manufacturer_ids": List<dynamic>.from(manufacturerIds.map((x) => x)),
|
||||||
|
"reviews": List<dynamic>.from(reviews.map((x) => x.toJson())),
|
||||||
|
"images": List<dynamic>.from(images.map((x) => x.toJson())),
|
||||||
|
"attributes": List<dynamic>.from(attributes.map((x) => x)),
|
||||||
|
"specifications": List<dynamic>.from(specifications.map((x) => x.toJson())),
|
||||||
|
"associated_product_ids": List<dynamic>.from(associatedProductIds.map((x) => x)),
|
||||||
|
"tags": List<dynamic>.from(tags.map((x) => x)),
|
||||||
|
"vendor_id": vendorId,
|
||||||
|
"se_name": seName,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class Image {
|
||||||
|
Image({
|
||||||
|
this.id,
|
||||||
|
this.position,
|
||||||
|
this.src,
|
||||||
|
this.thumb,
|
||||||
|
this.attachment,
|
||||||
|
});
|
||||||
|
|
||||||
|
int id;
|
||||||
|
int position;
|
||||||
|
String src;
|
||||||
|
String thumb;
|
||||||
|
String attachment;
|
||||||
|
|
||||||
|
factory Image.fromJson(Map<String, dynamic> json) => Image(
|
||||||
|
id: json["id"],
|
||||||
|
position: json["position"],
|
||||||
|
src: json["src"],
|
||||||
|
thumb: json["thumb"],
|
||||||
|
attachment: json["attachment"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"id": id,
|
||||||
|
"position": position,
|
||||||
|
"src": src,
|
||||||
|
"thumb": thumb,
|
||||||
|
"attachment": attachment,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class LocalizedName {
|
||||||
|
LocalizedName({
|
||||||
|
this.languageId,
|
||||||
|
this.localizedName,
|
||||||
|
});
|
||||||
|
|
||||||
|
int languageId;
|
||||||
|
String localizedName;
|
||||||
|
|
||||||
|
factory LocalizedName.fromJson(Map<String, dynamic> json) => LocalizedName(
|
||||||
|
languageId: json["language_id"],
|
||||||
|
localizedName: json["localized_name"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"language_id": languageId,
|
||||||
|
"localized_name": localizedName,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class Review {
|
||||||
|
Review({
|
||||||
|
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,
|
||||||
|
});
|
||||||
|
|
||||||
|
int id;
|
||||||
|
int position;
|
||||||
|
int reviewId;
|
||||||
|
int customerId;
|
||||||
|
int productId;
|
||||||
|
int storeId;
|
||||||
|
bool isApproved;
|
||||||
|
String title;
|
||||||
|
String reviewText;
|
||||||
|
dynamic replyText;
|
||||||
|
int rating;
|
||||||
|
int helpfulYesTotal;
|
||||||
|
int helpfulNoTotal;
|
||||||
|
DateTime createdOnUtc;
|
||||||
|
Customer customer;
|
||||||
|
dynamic product;
|
||||||
|
|
||||||
|
factory Review.fromJson(Map<String, dynamic> json) => Review(
|
||||||
|
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: DateTime.parse(json["created_on_utc"]),
|
||||||
|
customer: Customer.fromJson(json["customer"]),
|
||||||
|
product: json["product"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"id": id,
|
||||||
|
"position": position,
|
||||||
|
"review_id": reviewId,
|
||||||
|
"customer_id": customerId,
|
||||||
|
"product_id": productId,
|
||||||
|
"store_id": storeId,
|
||||||
|
"is_approved": isApproved,
|
||||||
|
"title": title,
|
||||||
|
"review_text": reviewText,
|
||||||
|
"reply_text": replyText,
|
||||||
|
"rating": rating,
|
||||||
|
"helpful_yes_total": helpfulYesTotal,
|
||||||
|
"helpful_no_total": helpfulNoTotal,
|
||||||
|
"created_on_utc": createdOnUtc.toIso8601String(),
|
||||||
|
"customer": customer.toJson(),
|
||||||
|
"product": product,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class Customer {
|
||||||
|
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,
|
||||||
|
});
|
||||||
|
|
||||||
|
dynamic fileNumber;
|
||||||
|
dynamic iqamaNumber;
|
||||||
|
int isOutSa;
|
||||||
|
int patientType;
|
||||||
|
dynamic gender;
|
||||||
|
DateTime birthDate;
|
||||||
|
dynamic phone;
|
||||||
|
dynamic countryCode;
|
||||||
|
dynamic yahalaAccountno;
|
||||||
|
dynamic billingAddress;
|
||||||
|
dynamic shippingAddress;
|
||||||
|
List<dynamic> addresses;
|
||||||
|
String id;
|
||||||
|
Username username;
|
||||||
|
Email email;
|
||||||
|
dynamic firstName;
|
||||||
|
dynamic lastName;
|
||||||
|
dynamic languageId;
|
||||||
|
dynamic adminComment;
|
||||||
|
dynamic isTaxExempt;
|
||||||
|
dynamic hasShoppingCartItems;
|
||||||
|
dynamic active;
|
||||||
|
dynamic deleted;
|
||||||
|
dynamic isSystemAccount;
|
||||||
|
dynamic systemName;
|
||||||
|
dynamic lastIpAddress;
|
||||||
|
dynamic createdOnUtc;
|
||||||
|
dynamic lastLoginDateUtc;
|
||||||
|
dynamic lastActivityDateUtc;
|
||||||
|
dynamic registeredInStoreId;
|
||||||
|
List<dynamic> roleIds;
|
||||||
|
|
||||||
|
factory Customer.fromJson(Map<String, dynamic> json) => Customer(
|
||||||
|
fileNumber: json["file_number"],
|
||||||
|
iqamaNumber: json["iqama_number"],
|
||||||
|
isOutSa: json["is_out_sa"],
|
||||||
|
patientType: json["patient_type"],
|
||||||
|
gender: json["gender"],
|
||||||
|
birthDate: DateTime.parse(json["birth_date"]),
|
||||||
|
phone: json["phone"],
|
||||||
|
countryCode: json["country_code"],
|
||||||
|
yahalaAccountno: json["yahala_accountno"],
|
||||||
|
billingAddress: json["billing_address"],
|
||||||
|
shippingAddress: json["shipping_address"],
|
||||||
|
addresses: List<dynamic>.from(json["addresses"].map((x) => x)),
|
||||||
|
id: json["id"],
|
||||||
|
username: usernameValues.map[json["username"]],
|
||||||
|
email: emailValues.map[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"],
|
||||||
|
roleIds: List<dynamic>.from(json["role_ids"].map((x) => x)),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"file_number": fileNumber,
|
||||||
|
"iqama_number": iqamaNumber,
|
||||||
|
"is_out_sa": isOutSa,
|
||||||
|
"patient_type": patientType,
|
||||||
|
"gender": gender,
|
||||||
|
"birth_date": birthDate.toIso8601String(),
|
||||||
|
"phone": phone,
|
||||||
|
"country_code": countryCode,
|
||||||
|
"yahala_accountno": yahalaAccountno,
|
||||||
|
"billing_address": billingAddress,
|
||||||
|
"shipping_address": shippingAddress,
|
||||||
|
"addresses": List<dynamic>.from(addresses.map((x) => x)),
|
||||||
|
"id": id,
|
||||||
|
"username": usernameValues.reverse[username],
|
||||||
|
"email": emailValues.reverse[email],
|
||||||
|
"first_name": firstName,
|
||||||
|
"last_name": lastName,
|
||||||
|
"language_id": languageId,
|
||||||
|
"admin_comment": adminComment,
|
||||||
|
"is_tax_exempt": isTaxExempt,
|
||||||
|
"has_shopping_cart_items": hasShoppingCartItems,
|
||||||
|
"active": active,
|
||||||
|
"deleted": deleted,
|
||||||
|
"is_system_account": isSystemAccount,
|
||||||
|
"system_name": systemName,
|
||||||
|
"last_ip_address": lastIpAddress,
|
||||||
|
"created_on_utc": createdOnUtc,
|
||||||
|
"last_login_date_utc": lastLoginDateUtc,
|
||||||
|
"last_activity_date_utc": lastActivityDateUtc,
|
||||||
|
"registered_in_store_id": registeredInStoreId,
|
||||||
|
"role_ids": List<dynamic>.from(roleIds.map((x) => x)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Email { MEMO17299_GMAIL_COM, STEVE_GATES_NOP_COMMERCE_COM }
|
||||||
|
|
||||||
|
final emailValues = EnumValues({
|
||||||
|
"Memo17299@gmail.com": Email.MEMO17299_GMAIL_COM,
|
||||||
|
"steve_gates@nopCommerce.com": Email.STEVE_GATES_NOP_COMMERCE_COM
|
||||||
|
});
|
||||||
|
|
||||||
|
enum Username { AMAL_26, STEVE_GATES_NOP_COMMERCE_COM }
|
||||||
|
|
||||||
|
final usernameValues = EnumValues({
|
||||||
|
"amal_26": Username.AMAL_26,
|
||||||
|
"steve_gates@nopCommerce.com": Username.STEVE_GATES_NOP_COMMERCE_COM
|
||||||
|
});
|
||||||
|
|
||||||
|
class Specification {
|
||||||
|
Specification({
|
||||||
|
this.id,
|
||||||
|
this.displayOrder,
|
||||||
|
this.defaultValue,
|
||||||
|
this.defaultValuen,
|
||||||
|
this.name,
|
||||||
|
this.nameN,
|
||||||
|
});
|
||||||
|
|
||||||
|
int id;
|
||||||
|
int displayOrder;
|
||||||
|
String defaultValue;
|
||||||
|
String defaultValuen;
|
||||||
|
Name name;
|
||||||
|
NameN nameN;
|
||||||
|
|
||||||
|
factory Specification.fromJson(Map<String, dynamic> json) => Specification(
|
||||||
|
id: json["id"],
|
||||||
|
displayOrder: json["display_order"],
|
||||||
|
defaultValue: json["default_value"],
|
||||||
|
defaultValuen: json["default_valuen"],
|
||||||
|
name: nameValues.map[json["name"]],
|
||||||
|
nameN: nameNValues.map[json["nameN"]],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"id": id,
|
||||||
|
"display_order": displayOrder,
|
||||||
|
"default_value": defaultValue,
|
||||||
|
"default_valuen": defaultValuen,
|
||||||
|
"name": nameValues.reverse[name],
|
||||||
|
"nameN": nameNValues.reverse[nameN],
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Name { PRIMARY_UNIT_OF_MEASURE, BRAND, MANUFACTURER_COUNTRY_NAME, STORAGE, COMPOSITION, SPF }
|
||||||
|
|
||||||
|
final nameValues = EnumValues({
|
||||||
|
"BRAND": Name.BRAND,
|
||||||
|
"COMPOSITION": Name.COMPOSITION,
|
||||||
|
"MANUFACTURER COUNTRY NAME": Name.MANUFACTURER_COUNTRY_NAME,
|
||||||
|
"Primary Unit Of Measure": Name.PRIMARY_UNIT_OF_MEASURE,
|
||||||
|
"SPF": Name.SPF,
|
||||||
|
"STORAGE": Name.STORAGE
|
||||||
|
});
|
||||||
|
|
||||||
|
enum NameN { EMPTY, NAME_N, PURPLE, FLUFFY, TENTACLED, SPF }
|
||||||
|
|
||||||
|
final nameNValues = EnumValues({
|
||||||
|
"وحدة القياس الأولية": NameN.EMPTY,
|
||||||
|
"تخزين": NameN.FLUFFY,
|
||||||
|
"علامة تجارية": NameN.NAME_N,
|
||||||
|
"اسم البلد المصنع": NameN.PURPLE,
|
||||||
|
"SPF": NameN.SPF,
|
||||||
|
"المكونات": NameN.TENTACLED
|
||||||
|
});
|
||||||
|
|
||||||
|
class EnumValues<T> {
|
||||||
|
Map<String, T> map;
|
||||||
|
Map<T, String> reverseMap;
|
||||||
|
|
||||||
|
EnumValues(this.map);
|
||||||
|
|
||||||
|
Map<T, String> get reverse {
|
||||||
|
if (reverseMap == null) {
|
||||||
|
reverseMap = map.map((k, v) => new MapEntry(v, k));
|
||||||
|
}
|
||||||
|
return reverseMap;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,803 @@
|
|||||||
|
// To parse this JSON data, do
|
||||||
|
//
|
||||||
|
// final review = reviewFromJson(jsonString);
|
||||||
|
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
List<Review> reviewFromJson(String str) => List<Review>.from(json.decode(str).map((x) => Review.fromJson(x)));
|
||||||
|
|
||||||
|
String reviewToJson(List<Review> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
|
||||||
|
|
||||||
|
class Product {
|
||||||
|
Product({
|
||||||
|
this.id,
|
||||||
|
this.visibleIndividually,
|
||||||
|
this.name,
|
||||||
|
this.namen,
|
||||||
|
this.localizedNames,
|
||||||
|
this.shortDescription,
|
||||||
|
this.shortDescriptionn,
|
||||||
|
this.fullDescription,
|
||||||
|
this.fullDescriptionn,
|
||||||
|
this.markasNew,
|
||||||
|
this.showOnHomePage,
|
||||||
|
this.metaKeywords,
|
||||||
|
this.metaDescription,
|
||||||
|
this.metaTitle,
|
||||||
|
this.allowCustomerReviews,
|
||||||
|
this.approvedRatingSum,
|
||||||
|
this.notApprovedRatingSum,
|
||||||
|
this.approvedTotalReviews,
|
||||||
|
this.notApprovedTotalReviews,
|
||||||
|
this.sku,
|
||||||
|
this.isRx,
|
||||||
|
this.prescriptionRequired,
|
||||||
|
this.rxMessage,
|
||||||
|
this.rxMessagen,
|
||||||
|
this.manufacturerPartNumber,
|
||||||
|
this.gtin,
|
||||||
|
this.isGiftCard,
|
||||||
|
this.requireOtherProducts,
|
||||||
|
this.automaticallyAddRequiredProducts,
|
||||||
|
this.isDownload,
|
||||||
|
this.unlimitedDownloads,
|
||||||
|
this.maxNumberOfDownloads,
|
||||||
|
this.downloadExpirationDays,
|
||||||
|
this.hasSampleDownload,
|
||||||
|
this.hasUserAgreement,
|
||||||
|
this.isRecurring,
|
||||||
|
this.recurringCycleLength,
|
||||||
|
this.recurringTotalCycles,
|
||||||
|
this.isRental,
|
||||||
|
this.rentalPriceLength,
|
||||||
|
this.isShipEnabled,
|
||||||
|
this.isFreeShipping,
|
||||||
|
this.shipSeparately,
|
||||||
|
this.additionalShippingCharge,
|
||||||
|
this.isTaxExempt,
|
||||||
|
this.isTelecommunicationsOrBroadcastingOrElectronicServices,
|
||||||
|
this.useMultipleWarehouses,
|
||||||
|
this.manageInventoryMethodId,
|
||||||
|
this.stockQuantity,
|
||||||
|
this.stockAvailability,
|
||||||
|
this.stockAvailabilityn,
|
||||||
|
this.displayStockAvailability,
|
||||||
|
this.displayStockQuantity,
|
||||||
|
this.minStockQuantity,
|
||||||
|
this.notifyAdminForQuantityBelow,
|
||||||
|
this.allowBackInStockSubscriptions,
|
||||||
|
this.orderMinimumQuantity,
|
||||||
|
this.orderMaximumQuantity,
|
||||||
|
this.allowedQuantities,
|
||||||
|
this.allowAddingOnlyExistingAttributeCombinations,
|
||||||
|
this.disableBuyButton,
|
||||||
|
this.disableWishlistButton,
|
||||||
|
this.availableForPreOrder,
|
||||||
|
this.preOrderAvailabilityStartDateTimeUtc,
|
||||||
|
this.callForPrice,
|
||||||
|
this.price,
|
||||||
|
this.oldPrice,
|
||||||
|
this.productCost,
|
||||||
|
this.specialPrice,
|
||||||
|
this.specialPriceStartDateTimeUtc,
|
||||||
|
this.specialPriceEndDateTimeUtc,
|
||||||
|
this.customerEntersPrice,
|
||||||
|
this.minimumCustomerEnteredPrice,
|
||||||
|
this.maximumCustomerEnteredPrice,
|
||||||
|
this.basepriceEnabled,
|
||||||
|
this.basepriceAmount,
|
||||||
|
this.basepriceBaseAmount,
|
||||||
|
this.hasTierPrices,
|
||||||
|
this.hasDiscountsApplied,
|
||||||
|
this.discountName,
|
||||||
|
this.discountNamen,
|
||||||
|
this.discountDescription,
|
||||||
|
this.discountDescriptionn,
|
||||||
|
this.discountPercentage,
|
||||||
|
this.currency,
|
||||||
|
this.currencyn,
|
||||||
|
this.weight,
|
||||||
|
this.length,
|
||||||
|
this.width,
|
||||||
|
this.height,
|
||||||
|
this.availableStartDateTimeUtc,
|
||||||
|
this.availableEndDateTimeUtc,
|
||||||
|
this.displayOrder,
|
||||||
|
this.published,
|
||||||
|
this.deleted,
|
||||||
|
this.createdOnUtc,
|
||||||
|
this.updatedOnUtc,
|
||||||
|
this.productType,
|
||||||
|
this.parentGroupedProductId,
|
||||||
|
this.roleIds,
|
||||||
|
this.discountIds,
|
||||||
|
this.storeIds,
|
||||||
|
this.manufacturerIds,
|
||||||
|
this.reviews,
|
||||||
|
this.images,
|
||||||
|
this.attributes,
|
||||||
|
this.specifications,
|
||||||
|
this.associatedProductIds,
|
||||||
|
this.tags,
|
||||||
|
this.vendorId,
|
||||||
|
this.seName,
|
||||||
|
});
|
||||||
|
|
||||||
|
String id;
|
||||||
|
bool visibleIndividually;
|
||||||
|
String name;
|
||||||
|
String namen;
|
||||||
|
List<LocalizedName> localizedNames;
|
||||||
|
String shortDescription;
|
||||||
|
String shortDescriptionn;
|
||||||
|
String fullDescription;
|
||||||
|
String fullDescriptionn;
|
||||||
|
bool markasNew;
|
||||||
|
bool showOnHomePage;
|
||||||
|
String metaKeywords;
|
||||||
|
String metaDescription;
|
||||||
|
String metaTitle;
|
||||||
|
bool allowCustomerReviews;
|
||||||
|
dynamic approvedRatingSum;
|
||||||
|
dynamic notApprovedRatingSum;
|
||||||
|
dynamic approvedTotalReviews;
|
||||||
|
dynamic notApprovedTotalReviews;
|
||||||
|
String sku;
|
||||||
|
bool isRx;
|
||||||
|
bool prescriptionRequired;
|
||||||
|
dynamic rxMessage;
|
||||||
|
dynamic rxMessagen;
|
||||||
|
dynamic manufacturerPartNumber;
|
||||||
|
dynamic gtin;
|
||||||
|
bool isGiftCard;
|
||||||
|
bool requireOtherProducts;
|
||||||
|
bool automaticallyAddRequiredProducts;
|
||||||
|
bool isDownload;
|
||||||
|
bool unlimitedDownloads;
|
||||||
|
dynamic maxNumberOfDownloads;
|
||||||
|
dynamic downloadExpirationDays;
|
||||||
|
bool hasSampleDownload;
|
||||||
|
bool hasUserAgreement;
|
||||||
|
bool isRecurring;
|
||||||
|
dynamic recurringCycleLength;
|
||||||
|
dynamic recurringTotalCycles;
|
||||||
|
bool isRental;
|
||||||
|
dynamic rentalPriceLength;
|
||||||
|
bool isShipEnabled;
|
||||||
|
bool isFreeShipping;
|
||||||
|
bool shipSeparately;
|
||||||
|
dynamic additionalShippingCharge;
|
||||||
|
bool isTaxExempt;
|
||||||
|
bool isTelecommunicationsOrBroadcastingOrElectronicServices;
|
||||||
|
bool useMultipleWarehouses;
|
||||||
|
dynamic manageInventoryMethodId;
|
||||||
|
dynamic stockQuantity;
|
||||||
|
String stockAvailability;
|
||||||
|
String stockAvailabilityn;
|
||||||
|
bool displayStockAvailability;
|
||||||
|
bool displayStockQuantity;
|
||||||
|
dynamic minStockQuantity;
|
||||||
|
dynamic notifyAdminForQuantityBelow;
|
||||||
|
bool allowBackInStockSubscriptions;
|
||||||
|
dynamic orderMinimumQuantity;
|
||||||
|
dynamic orderMaximumQuantity;
|
||||||
|
dynamic allowedQuantities;
|
||||||
|
bool allowAddingOnlyExistingAttributeCombinations;
|
||||||
|
bool disableBuyButton;
|
||||||
|
bool disableWishlistButton;
|
||||||
|
bool availableForPreOrder;
|
||||||
|
dynamic preOrderAvailabilityStartDateTimeUtc;
|
||||||
|
bool callForPrice;
|
||||||
|
dynamic price;
|
||||||
|
dynamic oldPrice;
|
||||||
|
dynamic productCost;
|
||||||
|
dynamic specialPrice;
|
||||||
|
dynamic specialPriceStartDateTimeUtc;
|
||||||
|
dynamic specialPriceEndDateTimeUtc;
|
||||||
|
bool customerEntersPrice;
|
||||||
|
dynamic minimumCustomerEnteredPrice;
|
||||||
|
dynamic maximumCustomerEnteredPrice;
|
||||||
|
bool basepriceEnabled;
|
||||||
|
dynamic basepriceAmount;
|
||||||
|
dynamic basepriceBaseAmount;
|
||||||
|
bool hasTierPrices;
|
||||||
|
bool hasDiscountsApplied;
|
||||||
|
dynamic discountName;
|
||||||
|
dynamic discountNamen;
|
||||||
|
dynamic discountDescription;
|
||||||
|
dynamic discountDescriptionn;
|
||||||
|
dynamic discountPercentage;
|
||||||
|
String currency;
|
||||||
|
String currencyn;
|
||||||
|
double weight;
|
||||||
|
dynamic length;
|
||||||
|
dynamic width;
|
||||||
|
dynamic height;
|
||||||
|
dynamic availableStartDateTimeUtc;
|
||||||
|
dynamic availableEndDateTimeUtc;
|
||||||
|
dynamic displayOrder;
|
||||||
|
bool published;
|
||||||
|
bool deleted;
|
||||||
|
DateTime createdOnUtc;
|
||||||
|
DateTime updatedOnUtc;
|
||||||
|
String productType;
|
||||||
|
dynamic parentGroupedProductId;
|
||||||
|
List<dynamic> roleIds;
|
||||||
|
List<dynamic> discountIds;
|
||||||
|
List<dynamic> storeIds;
|
||||||
|
List<dynamic> manufacturerIds;
|
||||||
|
List<Review> reviews;
|
||||||
|
List<Image> images;
|
||||||
|
List<dynamic> attributes;
|
||||||
|
List<Specification> specifications;
|
||||||
|
List<dynamic> associatedProductIds;
|
||||||
|
List<dynamic> tags;
|
||||||
|
dynamic vendorId;
|
||||||
|
String seName;
|
||||||
|
|
||||||
|
factory Product.fromJson(Map<String, dynamic> json) => Product(
|
||||||
|
id: json["id"],
|
||||||
|
visibleIndividually: json["visible_individually"],
|
||||||
|
name: json["name"],
|
||||||
|
namen: json["namen"],
|
||||||
|
localizedNames: List<LocalizedName>.from(json["localized_names"].map((x) => LocalizedName.fromJson(x))),
|
||||||
|
shortDescription: json["short_description"],
|
||||||
|
shortDescriptionn: json["short_descriptionn"],
|
||||||
|
fullDescription: json["full_description"],
|
||||||
|
fullDescriptionn: json["full_descriptionn"],
|
||||||
|
markasNew: json["markas_new"],
|
||||||
|
showOnHomePage: json["show_on_home_page"],
|
||||||
|
metaKeywords: json["meta_keywords"],
|
||||||
|
metaDescription: json["meta_description"],
|
||||||
|
metaTitle: json["meta_title"],
|
||||||
|
allowCustomerReviews: json["allow_customer_reviews"],
|
||||||
|
approvedRatingSum: json["approved_rating_sum"],
|
||||||
|
notApprovedRatingSum: json["not_approved_rating_sum"],
|
||||||
|
approvedTotalReviews: json["approved_total_reviews"],
|
||||||
|
notApprovedTotalReviews: json["not_approved_total_reviews"],
|
||||||
|
sku: json["sku"],
|
||||||
|
isRx: json["is_rx"],
|
||||||
|
prescriptionRequired: json["prescription_required"],
|
||||||
|
rxMessage: json["rx_message"],
|
||||||
|
rxMessagen: json["rx_messagen"],
|
||||||
|
manufacturerPartNumber: json["manufacturer_part_number"],
|
||||||
|
gtin: json["gtin"],
|
||||||
|
isGiftCard: json["is_gift_card"],
|
||||||
|
requireOtherProducts: json["require_other_products"],
|
||||||
|
automaticallyAddRequiredProducts: json["automatically_add_required_products"],
|
||||||
|
isDownload: json["is_download"],
|
||||||
|
unlimitedDownloads: json["unlimited_downloads"],
|
||||||
|
maxNumberOfDownloads: json["max_number_of_downloads"],
|
||||||
|
downloadExpirationDays: json["download_expiration_days"],
|
||||||
|
hasSampleDownload: json["has_sample_download"],
|
||||||
|
hasUserAgreement: json["has_user_agreement"],
|
||||||
|
isRecurring: json["is_recurring"],
|
||||||
|
recurringCycleLength: json["recurring_cycle_length"],
|
||||||
|
recurringTotalCycles: json["recurring_total_cycles"],
|
||||||
|
isRental: json["is_rental"],
|
||||||
|
rentalPriceLength: json["rental_price_length"],
|
||||||
|
isShipEnabled: json["is_ship_enabled"],
|
||||||
|
isFreeShipping: json["is_free_shipping"],
|
||||||
|
shipSeparately: json["ship_separately"],
|
||||||
|
additionalShippingCharge: json["additional_shipping_charge"],
|
||||||
|
isTaxExempt: json["is_tax_exempt"],
|
||||||
|
isTelecommunicationsOrBroadcastingOrElectronicServices: json["is_telecommunications_or_broadcasting_or_electronic_services"],
|
||||||
|
useMultipleWarehouses: json["use_multiple_warehouses"],
|
||||||
|
manageInventoryMethodId: json["manage_inventory_method_id"],
|
||||||
|
stockQuantity: json["stock_quantity"],
|
||||||
|
stockAvailability: json["stock_availability"],
|
||||||
|
stockAvailabilityn: json["stock_availabilityn"],
|
||||||
|
displayStockAvailability: json["display_stock_availability"],
|
||||||
|
displayStockQuantity: json["display_stock_quantity"],
|
||||||
|
minStockQuantity: json["min_stock_quantity"],
|
||||||
|
notifyAdminForQuantityBelow: json["notify_admin_for_quantity_below"],
|
||||||
|
allowBackInStockSubscriptions: json["allow_back_in_stock_subscriptions"],
|
||||||
|
orderMinimumQuantity: json["order_minimum_quantity"],
|
||||||
|
orderMaximumQuantity: json["order_maximum_quantity"],
|
||||||
|
allowedQuantities: json["allowed_quantities"],
|
||||||
|
allowAddingOnlyExistingAttributeCombinations: json["allow_adding_only_existing_attribute_combinations"],
|
||||||
|
disableBuyButton: json["disable_buy_button"],
|
||||||
|
disableWishlistButton: json["disable_wishlist_button"],
|
||||||
|
availableForPreOrder: json["available_for_pre_order"],
|
||||||
|
preOrderAvailabilityStartDateTimeUtc: json["pre_order_availability_start_date_time_utc"],
|
||||||
|
callForPrice: json["call_for_price"],
|
||||||
|
price: json["price"],
|
||||||
|
oldPrice: json["old_price"],
|
||||||
|
productCost: json["product_cost"],
|
||||||
|
specialPrice: json["special_price"],
|
||||||
|
specialPriceStartDateTimeUtc: json["special_price_start_date_time_utc"],
|
||||||
|
specialPriceEndDateTimeUtc: json["special_price_end_date_time_utc"],
|
||||||
|
customerEntersPrice: json["customer_enters_price"],
|
||||||
|
minimumCustomerEnteredPrice: json["minimum_customer_entered_price"],
|
||||||
|
maximumCustomerEnteredPrice: json["maximum_customer_entered_price"],
|
||||||
|
basepriceEnabled: json["baseprice_enabled"],
|
||||||
|
basepriceAmount: json["baseprice_amount"],
|
||||||
|
basepriceBaseAmount: json["baseprice_base_amount"],
|
||||||
|
hasTierPrices: json["has_tier_prices"],
|
||||||
|
hasDiscountsApplied: json["has_discounts_applied"],
|
||||||
|
discountName: json["discount_name"],
|
||||||
|
discountNamen: json["discount_namen"],
|
||||||
|
discountDescription: json["discount_description"],
|
||||||
|
discountDescriptionn: json["discount_Descriptionn"],
|
||||||
|
discountPercentage: json["discount_percentage"],
|
||||||
|
currency: json["currency"],
|
||||||
|
currencyn: json["currencyn"],
|
||||||
|
weight: json["weight"].toDouble(),
|
||||||
|
length: json["length"],
|
||||||
|
width: json["width"],
|
||||||
|
height: json["height"],
|
||||||
|
availableStartDateTimeUtc: json["available_start_date_time_utc"],
|
||||||
|
availableEndDateTimeUtc: json["available_end_date_time_utc"],
|
||||||
|
displayOrder: json["display_order"],
|
||||||
|
published: json["published"],
|
||||||
|
deleted: json["deleted"],
|
||||||
|
createdOnUtc: DateTime.parse(json["created_on_utc"]),
|
||||||
|
updatedOnUtc: DateTime.parse(json["updated_on_utc"]),
|
||||||
|
productType: json["product_type"],
|
||||||
|
parentGroupedProductId: json["parent_grouped_product_id"],
|
||||||
|
roleIds: List<dynamic>.from(json["role_ids"].map((x) => x)),
|
||||||
|
discountIds: List<dynamic>.from(json["discount_ids"].map((x) => x)),
|
||||||
|
storeIds: List<dynamic>.from(json["store_ids"].map((x) => x)),
|
||||||
|
manufacturerIds: List<dynamic>.from(json["manufacturer_ids"].map((x) => x)),
|
||||||
|
reviews: List<Review>.from(json["reviews"].map((x) => Review.fromJson(x))),
|
||||||
|
images: List<Image>.from(json["images"].map((x) => Image.fromJson(x))),
|
||||||
|
attributes: List<dynamic>.from(json["attributes"].map((x) => x)),
|
||||||
|
specifications: List<Specification>.from(json["specifications"].map((x) => Specification.fromJson(x))),
|
||||||
|
associatedProductIds: List<dynamic>.from(json["associated_product_ids"].map((x) => x)),
|
||||||
|
tags: List<dynamic>.from(json["tags"].map((x) => x)),
|
||||||
|
vendorId: json["vendor_id"],
|
||||||
|
seName: json["se_name"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"id": id,
|
||||||
|
"visible_individually": visibleIndividually,
|
||||||
|
"name": name,
|
||||||
|
"namen": namen,
|
||||||
|
"localized_names": List<dynamic>.from(localizedNames.map((x) => x.toJson())),
|
||||||
|
"short_description": shortDescription,
|
||||||
|
"short_descriptionn": shortDescriptionn,
|
||||||
|
"full_description": fullDescription,
|
||||||
|
"full_descriptionn": fullDescriptionn,
|
||||||
|
"markas_new": markasNew,
|
||||||
|
"show_on_home_page": showOnHomePage,
|
||||||
|
"meta_keywords": metaKeywords,
|
||||||
|
"meta_description": metaDescription,
|
||||||
|
"meta_title": metaTitle,
|
||||||
|
"allow_customer_reviews": allowCustomerReviews,
|
||||||
|
"approved_rating_sum": approvedRatingSum,
|
||||||
|
"not_approved_rating_sum": notApprovedRatingSum,
|
||||||
|
"approved_total_reviews": approvedTotalReviews,
|
||||||
|
"not_approved_total_reviews": notApprovedTotalReviews,
|
||||||
|
"sku": sku,
|
||||||
|
"is_rx": isRx,
|
||||||
|
"prescription_required": prescriptionRequired,
|
||||||
|
"rx_message": rxMessage,
|
||||||
|
"rx_messagen": rxMessagen,
|
||||||
|
"manufacturer_part_number": manufacturerPartNumber,
|
||||||
|
"gtin": gtin,
|
||||||
|
"is_gift_card": isGiftCard,
|
||||||
|
"require_other_products": requireOtherProducts,
|
||||||
|
"automatically_add_required_products": automaticallyAddRequiredProducts,
|
||||||
|
"is_download": isDownload,
|
||||||
|
"unlimited_downloads": unlimitedDownloads,
|
||||||
|
"max_number_of_downloads": maxNumberOfDownloads,
|
||||||
|
"download_expiration_days": downloadExpirationDays,
|
||||||
|
"has_sample_download": hasSampleDownload,
|
||||||
|
"has_user_agreement": hasUserAgreement,
|
||||||
|
"is_recurring": isRecurring,
|
||||||
|
"recurring_cycle_length": recurringCycleLength,
|
||||||
|
"recurring_total_cycles": recurringTotalCycles,
|
||||||
|
"is_rental": isRental,
|
||||||
|
"rental_price_length": rentalPriceLength,
|
||||||
|
"is_ship_enabled": isShipEnabled,
|
||||||
|
"is_free_shipping": isFreeShipping,
|
||||||
|
"ship_separately": shipSeparately,
|
||||||
|
"additional_shipping_charge": additionalShippingCharge,
|
||||||
|
"is_tax_exempt": isTaxExempt,
|
||||||
|
"is_telecommunications_or_broadcasting_or_electronic_services": isTelecommunicationsOrBroadcastingOrElectronicServices,
|
||||||
|
"use_multiple_warehouses": useMultipleWarehouses,
|
||||||
|
"manage_inventory_method_id": manageInventoryMethodId,
|
||||||
|
"stock_quantity": stockQuantity,
|
||||||
|
"stock_availability": stockAvailability,
|
||||||
|
"stock_availabilityn": stockAvailabilityn,
|
||||||
|
"display_stock_availability": displayStockAvailability,
|
||||||
|
"display_stock_quantity": displayStockQuantity,
|
||||||
|
"min_stock_quantity": minStockQuantity,
|
||||||
|
"notify_admin_for_quantity_below": notifyAdminForQuantityBelow,
|
||||||
|
"allow_back_in_stock_subscriptions": allowBackInStockSubscriptions,
|
||||||
|
"order_minimum_quantity": orderMinimumQuantity,
|
||||||
|
"order_maximum_quantity": orderMaximumQuantity,
|
||||||
|
"allowed_quantities": allowedQuantities,
|
||||||
|
"allow_adding_only_existing_attribute_combinations": allowAddingOnlyExistingAttributeCombinations,
|
||||||
|
"disable_buy_button": disableBuyButton,
|
||||||
|
"disable_wishlist_button": disableWishlistButton,
|
||||||
|
"available_for_pre_order": availableForPreOrder,
|
||||||
|
"pre_order_availability_start_date_time_utc": preOrderAvailabilityStartDateTimeUtc,
|
||||||
|
"call_for_price": callForPrice,
|
||||||
|
"price": price,
|
||||||
|
"old_price": oldPrice,
|
||||||
|
"product_cost": productCost,
|
||||||
|
"special_price": specialPrice,
|
||||||
|
"special_price_start_date_time_utc": specialPriceStartDateTimeUtc,
|
||||||
|
"special_price_end_date_time_utc": specialPriceEndDateTimeUtc,
|
||||||
|
"customer_enters_price": customerEntersPrice,
|
||||||
|
"minimum_customer_entered_price": minimumCustomerEnteredPrice,
|
||||||
|
"maximum_customer_entered_price": maximumCustomerEnteredPrice,
|
||||||
|
"baseprice_enabled": basepriceEnabled,
|
||||||
|
"baseprice_amount": basepriceAmount,
|
||||||
|
"baseprice_base_amount": basepriceBaseAmount,
|
||||||
|
"has_tier_prices": hasTierPrices,
|
||||||
|
"has_discounts_applied": hasDiscountsApplied,
|
||||||
|
"discount_name": discountName,
|
||||||
|
"discount_namen": discountNamen,
|
||||||
|
"discount_description": discountDescription,
|
||||||
|
"discount_Descriptionn": discountDescriptionn,
|
||||||
|
"discount_percentage": discountPercentage,
|
||||||
|
"currency": currency,
|
||||||
|
"currencyn": currencyn,
|
||||||
|
"weight": weight,
|
||||||
|
"length": length,
|
||||||
|
"width": width,
|
||||||
|
"height": height,
|
||||||
|
"available_start_date_time_utc": availableStartDateTimeUtc,
|
||||||
|
"available_end_date_time_utc": availableEndDateTimeUtc,
|
||||||
|
"display_order": displayOrder,
|
||||||
|
"published": published,
|
||||||
|
"deleted": deleted,
|
||||||
|
"created_on_utc": createdOnUtc.toIso8601String(),
|
||||||
|
"updated_on_utc": updatedOnUtc.toIso8601String(),
|
||||||
|
"product_type": productType,
|
||||||
|
"parent_grouped_product_id": parentGroupedProductId,
|
||||||
|
"role_ids": List<dynamic>.from(roleIds.map((x) => x)),
|
||||||
|
"discount_ids": List<dynamic>.from(discountIds.map((x) => x)),
|
||||||
|
"store_ids": List<dynamic>.from(storeIds.map((x) => x)),
|
||||||
|
"manufacturer_ids": List<dynamic>.from(manufacturerIds.map((x) => x)),
|
||||||
|
"reviews": List<dynamic>.from(reviews.map((x) => x.toJson())),
|
||||||
|
"images": List<dynamic>.from(images.map((x) => x.toJson())),
|
||||||
|
"attributes": List<dynamic>.from(attributes.map((x) => x)),
|
||||||
|
"specifications": List<dynamic>.from(specifications.map((x) => x.toJson())),
|
||||||
|
"associated_product_ids": List<dynamic>.from(associatedProductIds.map((x) => x)),
|
||||||
|
"tags": List<dynamic>.from(tags.map((x) => x)),
|
||||||
|
"vendor_id": vendorId,
|
||||||
|
"se_name": seName,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class Review {
|
||||||
|
Review({
|
||||||
|
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,
|
||||||
|
});
|
||||||
|
|
||||||
|
dynamic id;
|
||||||
|
dynamic position;
|
||||||
|
dynamic reviewId;
|
||||||
|
dynamic customerId;
|
||||||
|
dynamic productId;
|
||||||
|
dynamic storeId;
|
||||||
|
bool isApproved;
|
||||||
|
String title;
|
||||||
|
ReviewText reviewText;
|
||||||
|
dynamic replyText;
|
||||||
|
dynamic rating;
|
||||||
|
dynamic helpfulYesTotal;
|
||||||
|
dynamic helpfulNoTotal;
|
||||||
|
DateTime createdOnUtc;
|
||||||
|
Customer customer;
|
||||||
|
Product product;
|
||||||
|
|
||||||
|
factory Review.fromJson(Map<String, dynamic> json) => Review(
|
||||||
|
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: reviewTextValues.map[json["review_text"]],
|
||||||
|
replyText: json["reply_text"],
|
||||||
|
rating: json["rating"],
|
||||||
|
helpfulYesTotal: json["helpful_yes_total"],
|
||||||
|
helpfulNoTotal: json["helpful_no_total"],
|
||||||
|
createdOnUtc: DateTime.parse(json["created_on_utc"]),
|
||||||
|
customer: Customer.fromJson(json["customer"]),
|
||||||
|
product: json["product"] == null ? null : Product.fromJson(json["product"]),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"id": id,
|
||||||
|
"position": position,
|
||||||
|
"review_id": reviewId,
|
||||||
|
"customer_id": customerId,
|
||||||
|
"product_id": productId,
|
||||||
|
"store_id": storeId,
|
||||||
|
"is_approved": isApproved,
|
||||||
|
"title": title,
|
||||||
|
"review_text": reviewText,
|
||||||
|
"reply_text": replyText,
|
||||||
|
"rating": rating,
|
||||||
|
"helpful_yes_total": helpfulYesTotal,
|
||||||
|
"helpful_no_total": helpfulNoTotal,
|
||||||
|
"created_on_utc": createdOnUtc.toIso8601String(),
|
||||||
|
"customer": customer.toJson(),
|
||||||
|
"product": product == null ? null : product.toJson(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class Image {
|
||||||
|
Image({
|
||||||
|
this.id,
|
||||||
|
this.position,
|
||||||
|
this.src,
|
||||||
|
this.thumb,
|
||||||
|
this.attachment,
|
||||||
|
});
|
||||||
|
|
||||||
|
dynamic id;
|
||||||
|
dynamic position;
|
||||||
|
String src;
|
||||||
|
String thumb;
|
||||||
|
String attachment;
|
||||||
|
|
||||||
|
factory Image.fromJson(Map<String, dynamic> json) => Image(
|
||||||
|
id: json["id"],
|
||||||
|
position: json["position"],
|
||||||
|
src: json["src"],
|
||||||
|
thumb: json["thumb"],
|
||||||
|
attachment: json["attachment"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"id": id,
|
||||||
|
"position": position,
|
||||||
|
"src": src,
|
||||||
|
"thumb": thumb,
|
||||||
|
"attachment": attachment,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class LocalizedName {
|
||||||
|
LocalizedName({
|
||||||
|
this.languageId,
|
||||||
|
this.localizedName,
|
||||||
|
});
|
||||||
|
|
||||||
|
dynamic languageId;
|
||||||
|
String localizedName;
|
||||||
|
|
||||||
|
factory LocalizedName.fromJson(Map<String, dynamic> json) => LocalizedName(
|
||||||
|
languageId: json["language_id"],
|
||||||
|
localizedName: json["localized_name"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"language_id": languageId,
|
||||||
|
"localized_name": localizedName,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class Specification {
|
||||||
|
Specification({
|
||||||
|
this.id,
|
||||||
|
this.displayOrder,
|
||||||
|
this.defaultValue,
|
||||||
|
this.defaultValuen,
|
||||||
|
this.name,
|
||||||
|
this.nameN,
|
||||||
|
});
|
||||||
|
|
||||||
|
dynamic id;
|
||||||
|
dynamic displayOrder;
|
||||||
|
String defaultValue;
|
||||||
|
String defaultValuen;
|
||||||
|
String name;
|
||||||
|
String nameN;
|
||||||
|
|
||||||
|
factory Specification.fromJson(Map<String, dynamic> json) => Specification(
|
||||||
|
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() => {
|
||||||
|
"id": id,
|
||||||
|
"display_order": displayOrder,
|
||||||
|
"default_value": defaultValue,
|
||||||
|
"default_valuen": defaultValuen,
|
||||||
|
"name": name,
|
||||||
|
"nameN": nameN,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class Customer {
|
||||||
|
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,
|
||||||
|
});
|
||||||
|
|
||||||
|
dynamic fileNumber;
|
||||||
|
dynamic iqamaNumber;
|
||||||
|
dynamic isOutSa;
|
||||||
|
dynamic patientType;
|
||||||
|
dynamic gender;
|
||||||
|
DateTime birthDate;
|
||||||
|
dynamic phone;
|
||||||
|
dynamic countryCode;
|
||||||
|
dynamic yahalaAccountno;
|
||||||
|
dynamic billingAddress;
|
||||||
|
dynamic shippingAddress;
|
||||||
|
List<dynamic> addresses;
|
||||||
|
String id;
|
||||||
|
Username username;
|
||||||
|
Email email;
|
||||||
|
dynamic firstName;
|
||||||
|
dynamic lastName;
|
||||||
|
dynamic languageId;
|
||||||
|
dynamic adminComment;
|
||||||
|
dynamic isTaxExempt;
|
||||||
|
dynamic hasShoppingCartItems;
|
||||||
|
dynamic active;
|
||||||
|
dynamic deleted;
|
||||||
|
dynamic isSystemAccount;
|
||||||
|
dynamic systemName;
|
||||||
|
dynamic lastIpAddress;
|
||||||
|
dynamic createdOnUtc;
|
||||||
|
dynamic lastLoginDateUtc;
|
||||||
|
dynamic lastActivityDateUtc;
|
||||||
|
dynamic registeredInStoreId;
|
||||||
|
List<dynamic> roleIds;
|
||||||
|
|
||||||
|
factory Customer.fromJson(Map<String, dynamic> json) => Customer(
|
||||||
|
fileNumber: json["file_number"],
|
||||||
|
iqamaNumber: json["iqama_number"],
|
||||||
|
isOutSa: json["is_out_sa"],
|
||||||
|
patientType: json["patient_type"],
|
||||||
|
gender: json["gender"],
|
||||||
|
birthDate: DateTime.parse(json["birth_date"]),
|
||||||
|
phone: json["phone"],
|
||||||
|
countryCode: json["country_code"],
|
||||||
|
yahalaAccountno: json["yahala_accountno"],
|
||||||
|
billingAddress: json["billing_address"],
|
||||||
|
shippingAddress: json["shipping_address"],
|
||||||
|
addresses: List<dynamic>.from(json["addresses"].map((x) => x)),
|
||||||
|
id: json["id"],
|
||||||
|
username: usernameValues.map[json["username"]],
|
||||||
|
email: emailValues.map[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"],
|
||||||
|
roleIds: List<dynamic>.from(json["role_ids"].map((x) => x)),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"file_number": fileNumber,
|
||||||
|
"iqama_number": iqamaNumber,
|
||||||
|
"is_out_sa": isOutSa,
|
||||||
|
"patient_type": patientType,
|
||||||
|
"gender": gender,
|
||||||
|
"birth_date": birthDate.toIso8601String(),
|
||||||
|
"phone": phone,
|
||||||
|
"country_code": countryCode,
|
||||||
|
"yahala_accountno": yahalaAccountno,
|
||||||
|
"billing_address": billingAddress,
|
||||||
|
"shipping_address": shippingAddress,
|
||||||
|
"addresses": List<dynamic>.from(addresses.map((x) => x)),
|
||||||
|
"id": id,
|
||||||
|
"username": usernameValues.reverse[username],
|
||||||
|
"email": emailValues.reverse[email],
|
||||||
|
"first_name": firstName,
|
||||||
|
"last_name": lastName,
|
||||||
|
"language_id": languageId,
|
||||||
|
"admin_comment": adminComment,
|
||||||
|
"is_tax_exempt": isTaxExempt,
|
||||||
|
"has_shopping_cart_items": hasShoppingCartItems,
|
||||||
|
"active": active,
|
||||||
|
"deleted": deleted,
|
||||||
|
"is_system_account": isSystemAccount,
|
||||||
|
"system_name": systemName,
|
||||||
|
"last_ip_address": lastIpAddress,
|
||||||
|
"created_on_utc": createdOnUtc,
|
||||||
|
"last_login_date_utc": lastLoginDateUtc,
|
||||||
|
"last_activity_date_utc": lastActivityDateUtc,
|
||||||
|
"registered_in_store_id": registeredInStoreId,
|
||||||
|
"role_ids": List<dynamic>.from(roleIds.map((x) => x)),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
enum Email { TAMER_FANASHEH_DRSULAIMANALHABIB_COM, STEVE_GATES_NOP_COMMERCE_COM }
|
||||||
|
|
||||||
|
final emailValues = EnumValues({
|
||||||
|
"steve_gates@nopCommerce.com": Email.STEVE_GATES_NOP_COMMERCE_COM,
|
||||||
|
"tamer.fanasheh@drsulaimanalhabib.com": Email.TAMER_FANASHEH_DRSULAIMANALHABIB_COM
|
||||||
|
});
|
||||||
|
|
||||||
|
enum Username { TAMERF, STEVE_GATES_NOP_COMMERCE_COM }
|
||||||
|
|
||||||
|
final usernameValues = EnumValues({
|
||||||
|
"steve_gates@nopCommerce.com": Username.STEVE_GATES_NOP_COMMERCE_COM,
|
||||||
|
"tamerf": Username.TAMERF
|
||||||
|
});
|
||||||
|
|
||||||
|
enum ReviewText { ENADDD, ENAD_TEST_0001, GOOD, ENAD_TEST_REVIEW_001, ENAD }
|
||||||
|
|
||||||
|
final reviewTextValues = EnumValues({
|
||||||
|
"ENAD ": ReviewText.ENAD,
|
||||||
|
"enaddd": ReviewText.ENADDD,
|
||||||
|
"ENAD TEST 0001": ReviewText.ENAD_TEST_0001,
|
||||||
|
"Enad Test Review 001": ReviewText.ENAD_TEST_REVIEW_001,
|
||||||
|
"good": ReviewText.GOOD
|
||||||
|
});
|
||||||
|
|
||||||
|
class EnumValues<T> {
|
||||||
|
Map<String, T> map;
|
||||||
|
Map<T, String> reverseMap;
|
||||||
|
|
||||||
|
EnumValues(this.map);
|
||||||
|
|
||||||
|
Map<T, String> get reverse {
|
||||||
|
if (reverseMap == null) {
|
||||||
|
reverseMap = map.map((k, v) => new MapEntry(v, k));
|
||||||
|
}
|
||||||
|
return reverseMap;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,61 @@
|
|||||||
|
// To parse this JSON data, do
|
||||||
|
//
|
||||||
|
// final specificationModel = specificationModelFromJson(jsonString);
|
||||||
|
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
SpecificationModel specificationModelFromJson(String str) => SpecificationModel.fromJson(json.decode(str));
|
||||||
|
|
||||||
|
String specificationModelToJson(SpecificationModel data) => json.encode(data.toJson());
|
||||||
|
|
||||||
|
class SpecificationModel {
|
||||||
|
SpecificationModel({
|
||||||
|
this.specification,
|
||||||
|
});
|
||||||
|
|
||||||
|
List<Specification> specification;
|
||||||
|
|
||||||
|
factory SpecificationModel.fromJson(Map<String, dynamic> json) => SpecificationModel(
|
||||||
|
specification: List<Specification>.from(json["specification"].map((x) => Specification.fromJson(x))),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"specification": List<dynamic>.from(specification.map((x) => x.toJson())),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class Specification {
|
||||||
|
Specification({
|
||||||
|
this.id,
|
||||||
|
this.displayOrder,
|
||||||
|
this.defaultValue,
|
||||||
|
this.defaultValuen,
|
||||||
|
this.name,
|
||||||
|
this.nameN,
|
||||||
|
});
|
||||||
|
|
||||||
|
int id;
|
||||||
|
int displayOrder;
|
||||||
|
String defaultValue;
|
||||||
|
String defaultValuen;
|
||||||
|
String name;
|
||||||
|
String nameN;
|
||||||
|
|
||||||
|
factory Specification.fromJson(Map<String, dynamic> json) => Specification(
|
||||||
|
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() => {
|
||||||
|
"id": id,
|
||||||
|
"display_order": displayOrder,
|
||||||
|
"default_value": defaultValue,
|
||||||
|
"default_valuen": defaultValuen,
|
||||||
|
"name": name,
|
||||||
|
"nameN": nameN,
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -0,0 +1,137 @@
|
|||||||
|
// To parse this JSON data, do
|
||||||
|
//
|
||||||
|
// final topBrand = topBrandFromJson(jsonString);
|
||||||
|
|
||||||
|
import 'dart:convert';
|
||||||
|
|
||||||
|
List<TopBrand> topBrandFromJson(String str) => List<TopBrand>.from(json.decode(str).map((x) => TopBrand.fromJson(x)));
|
||||||
|
|
||||||
|
String topBrandToJson(List<TopBrand> data) => json.encode(List<dynamic>.from(data.map((x) => x.toJson())));
|
||||||
|
|
||||||
|
class TopBrand {
|
||||||
|
TopBrand({
|
||||||
|
this.id,
|
||||||
|
this.name,
|
||||||
|
this.namen,
|
||||||
|
this.localizedNames,
|
||||||
|
this.description,
|
||||||
|
this.manufacturerTemplateId,
|
||||||
|
this.metaKeywords,
|
||||||
|
this.metaDescription,
|
||||||
|
this.metaTitle,
|
||||||
|
this.pageSize,
|
||||||
|
this.pageSizeOptions,
|
||||||
|
this.priceRanges,
|
||||||
|
this.published,
|
||||||
|
this.deleted,
|
||||||
|
this.displayOrder,
|
||||||
|
this.createdOnUtc,
|
||||||
|
this.updatedOnUtc,
|
||||||
|
this.image,
|
||||||
|
});
|
||||||
|
|
||||||
|
String id;
|
||||||
|
String name;
|
||||||
|
String namen;
|
||||||
|
List<LocalizedName> localizedNames;
|
||||||
|
String description;
|
||||||
|
int manufacturerTemplateId;
|
||||||
|
String metaKeywords;
|
||||||
|
dynamic metaDescription;
|
||||||
|
dynamic metaTitle;
|
||||||
|
int pageSize;
|
||||||
|
String pageSizeOptions;
|
||||||
|
dynamic priceRanges;
|
||||||
|
bool published;
|
||||||
|
bool deleted;
|
||||||
|
int displayOrder;
|
||||||
|
DateTime createdOnUtc;
|
||||||
|
DateTime updatedOnUtc;
|
||||||
|
Image image;
|
||||||
|
|
||||||
|
factory TopBrand.fromJson(Map<String, dynamic> json) => TopBrand(
|
||||||
|
id: json["id"],
|
||||||
|
name: json["name"],
|
||||||
|
namen: json["namen"],
|
||||||
|
localizedNames: List<LocalizedName>.from(json["localized_names"].map((x) => LocalizedName.fromJson(x))),
|
||||||
|
description: json["description"] == null ? null : json["description"],
|
||||||
|
manufacturerTemplateId: json["manufacturer_template_id"],
|
||||||
|
metaKeywords: json["meta_keywords"],
|
||||||
|
metaDescription: json["meta_description"],
|
||||||
|
metaTitle: json["meta_title"],
|
||||||
|
pageSize: json["page_size"],
|
||||||
|
pageSizeOptions: json["page_size_options"],
|
||||||
|
priceRanges: json["price_ranges"],
|
||||||
|
published: json["published"],
|
||||||
|
deleted: json["deleted"],
|
||||||
|
displayOrder: json["display_order"],
|
||||||
|
createdOnUtc: DateTime.parse(json["created_on_utc"]),
|
||||||
|
updatedOnUtc: DateTime.parse(json["updated_on_utc"]),
|
||||||
|
image: json["image"] == null ? null : Image.fromJson(json["image"]),
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"id": id,
|
||||||
|
"name": name,
|
||||||
|
"namen": namen,
|
||||||
|
"localized_names": List<dynamic>.from(localizedNames.map((x) => x.toJson())),
|
||||||
|
"description": description == null ? null : description,
|
||||||
|
"manufacturer_template_id": manufacturerTemplateId,
|
||||||
|
"meta_keywords": metaKeywords,
|
||||||
|
"meta_description": metaDescription,
|
||||||
|
"meta_title": metaTitle,
|
||||||
|
"page_size": pageSize,
|
||||||
|
"page_size_options": pageSizeOptions,
|
||||||
|
"price_ranges": priceRanges,
|
||||||
|
"published": published,
|
||||||
|
"deleted": deleted,
|
||||||
|
"display_order": displayOrder,
|
||||||
|
"created_on_utc": createdOnUtc.toIso8601String(),
|
||||||
|
"updated_on_utc": updatedOnUtc.toIso8601String(),
|
||||||
|
"image": image == null ? null : image.toJson(),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class Image {
|
||||||
|
Image({
|
||||||
|
this.src,
|
||||||
|
this.thumb,
|
||||||
|
this.attachment,
|
||||||
|
});
|
||||||
|
|
||||||
|
String src;
|
||||||
|
dynamic thumb;
|
||||||
|
dynamic attachment;
|
||||||
|
|
||||||
|
factory Image.fromJson(Map<String, dynamic> json) => Image(
|
||||||
|
src: json["src"],
|
||||||
|
thumb: json["thumb"],
|
||||||
|
attachment: json["attachment"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"src": src,
|
||||||
|
"thumb": thumb,
|
||||||
|
"attachment": attachment,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
class LocalizedName {
|
||||||
|
LocalizedName({
|
||||||
|
this.languageId,
|
||||||
|
this.localizedName,
|
||||||
|
});
|
||||||
|
|
||||||
|
int languageId;
|
||||||
|
String localizedName;
|
||||||
|
|
||||||
|
factory LocalizedName.fromJson(Map<String, dynamic> json) => LocalizedName(
|
||||||
|
languageId: json["language_id"],
|
||||||
|
localizedName: json["localized_name"],
|
||||||
|
);
|
||||||
|
|
||||||
|
Map<String, dynamic> toJson() => {
|
||||||
|
"language_id": languageId,
|
||||||
|
"localized_name": localizedName,
|
||||||
|
};
|
||||||
|
}
|
||||||
@ -0,0 +1,480 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'base/base_view.dart';
|
||||||
|
|
||||||
|
class FinalProductsPage extends StatefulWidget {
|
||||||
|
String id;
|
||||||
|
FinalProductsPage({this.id});
|
||||||
|
@override
|
||||||
|
_FinalProductsPageState createState() => _FinalProductsPageState(id: id);
|
||||||
|
}
|
||||||
|
|
||||||
|
class _FinalProductsPageState extends State<FinalProductsPage> {
|
||||||
|
String id;
|
||||||
|
_FinalProductsPageState({this.id});
|
||||||
|
String categoriseName = "Personal Care";
|
||||||
|
bool styleOne = true;
|
||||||
|
bool styleTwo = false;
|
||||||
|
Icon styleIcon = Icon(
|
||||||
|
Icons.widgets_sharp,
|
||||||
|
color: Colors.blue,
|
||||||
|
size: 29.0,
|
||||||
|
);
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BaseView<PharmacyCategoriseViewModel>(
|
||||||
|
onModelReady: (model) => model.getFinalProducts(i: id),
|
||||||
|
builder: (BuildContext context, PharmacyCategoriseViewModel model,
|
||||||
|
Widget child) =>
|
||||||
|
PharmacyAppScaffold(
|
||||||
|
appBarTitle: 'Products',
|
||||||
|
isBottomBar: false,
|
||||||
|
isShowAppBar: true,
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
isShowDecPage: false,
|
||||||
|
baseViewModel: model,
|
||||||
|
body: Container(
|
||||||
|
height: MediaQuery.of(context).size.height * 5.87,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
//Expanded widget heree if nassery
|
||||||
|
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.all(8.0),
|
||||||
|
child: Texts(
|
||||||
|
'Products',
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
height: 44.0,
|
||||||
|
child: VerticalDivider(
|
||||||
|
color: Colors.black45,
|
||||||
|
thickness: 1.0,
|
||||||
|
//width: 0.3,
|
||||||
|
// indent: 0.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.all(8.0),
|
||||||
|
child: InkWell(
|
||||||
|
child: styleIcon,
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
if (styleOne == true) {
|
||||||
|
styleOne = false;
|
||||||
|
styleTwo = true;
|
||||||
|
styleIcon = Icon(
|
||||||
|
Icons.auto_awesome_mosaic,
|
||||||
|
color: Colors.blue,
|
||||||
|
size: 29.0,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
styleOne = true;
|
||||||
|
styleTwo = false;
|
||||||
|
styleIcon = Icon(
|
||||||
|
Icons.widgets_sharp,
|
||||||
|
color: Colors.blue,
|
||||||
|
size: 29.0,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Divider(
|
||||||
|
thickness: 1.0,
|
||||||
|
color: Colors.grey.shade400,
|
||||||
|
),
|
||||||
|
styleOne == true
|
||||||
|
? Expanded(
|
||||||
|
child: Container(
|
||||||
|
height: MediaQuery.of(context).size.height * 3.90,
|
||||||
|
child: GridView.builder(
|
||||||
|
gridDelegate:
|
||||||
|
SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
crossAxisCount: 2,
|
||||||
|
crossAxisSpacing: 0.5,
|
||||||
|
mainAxisSpacing: 2.0,
|
||||||
|
childAspectRatio: 1.0,
|
||||||
|
),
|
||||||
|
itemCount: model.finalProducts.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return NetworkBaseView(
|
||||||
|
baseViewModel: model,
|
||||||
|
child: Card(
|
||||||
|
color: model.finalProducts[index]
|
||||||
|
.discountName !=
|
||||||
|
null
|
||||||
|
? Color(0xffFFFF00)
|
||||||
|
: Colors.white,
|
||||||
|
elevation: 0,
|
||||||
|
shape: Border(
|
||||||
|
right: BorderSide(
|
||||||
|
color: Colors.grey.shade300,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
left: BorderSide(
|
||||||
|
color: Colors.grey.shade300,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
bottom: BorderSide(
|
||||||
|
color: Colors.grey.shade300,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
top: BorderSide(
|
||||||
|
color: Colors.grey.shade300,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
margin: EdgeInsets.symmetric(
|
||||||
|
horizontal: 8,
|
||||||
|
vertical: 4,
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(110.0),
|
||||||
|
),
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 0),
|
||||||
|
width: MediaQuery.of(context)
|
||||||
|
.size
|
||||||
|
.width /
|
||||||
|
3,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Stack(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.fromLTRB(
|
||||||
|
0, 16, 0, 0),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Image.network(
|
||||||
|
model.finalProducts[index]
|
||||||
|
.images.isNotEmpty
|
||||||
|
? model
|
||||||
|
.finalProducts[
|
||||||
|
index]
|
||||||
|
.images[0]
|
||||||
|
.thumb
|
||||||
|
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
height: 80,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: model
|
||||||
|
.finalProducts[
|
||||||
|
index]
|
||||||
|
.rxMessage !=
|
||||||
|
null
|
||||||
|
? MediaQuery.of(context)
|
||||||
|
.size
|
||||||
|
.width /
|
||||||
|
2.8
|
||||||
|
: 0,
|
||||||
|
padding: EdgeInsets.all(4),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xffb23838),
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.only(
|
||||||
|
topLeft: Radius
|
||||||
|
.circular(6)),
|
||||||
|
),
|
||||||
|
child: Texts(
|
||||||
|
model.finalProducts[index]
|
||||||
|
.rxMessage !=
|
||||||
|
null
|
||||||
|
? model
|
||||||
|
.finalProducts[
|
||||||
|
index]
|
||||||
|
.rxMessage
|
||||||
|
: "",
|
||||||
|
color: Colors.white,
|
||||||
|
regular: true,
|
||||||
|
fontSize: 10,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.symmetric(
|
||||||
|
horizontal: 6,
|
||||||
|
vertical: 0,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
if (model
|
||||||
|
.finalProducts[
|
||||||
|
index]
|
||||||
|
.discountName !=
|
||||||
|
null)
|
||||||
|
Container(
|
||||||
|
width: double.infinity,
|
||||||
|
height: 13.0,
|
||||||
|
decoration:
|
||||||
|
BoxDecoration(
|
||||||
|
color:
|
||||||
|
Color(0xff5AB145),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Texts(
|
||||||
|
model
|
||||||
|
.finalProducts[
|
||||||
|
index]
|
||||||
|
.discountName,
|
||||||
|
regular: true,
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 10.4,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Texts(
|
||||||
|
model.finalProducts[index]
|
||||||
|
.name,
|
||||||
|
regular: true,
|
||||||
|
fontSize: 12,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w400,
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.only(
|
||||||
|
top: 4,
|
||||||
|
bottom: 4),
|
||||||
|
child: Texts(
|
||||||
|
"SAR ${model.finalProducts[index].price}",
|
||||||
|
bold: true,
|
||||||
|
fontSize: 14,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
StarRating(
|
||||||
|
totalAverage: model
|
||||||
|
.finalProducts[
|
||||||
|
index]
|
||||||
|
.approvedRatingSum >
|
||||||
|
0
|
||||||
|
? (model.finalProducts[index].approvedRatingSum
|
||||||
|
.toDouble() /
|
||||||
|
model
|
||||||
|
.finalProducts[index]
|
||||||
|
.approvedRatingSum
|
||||||
|
.toDouble())
|
||||||
|
.toDouble()
|
||||||
|
: 0,
|
||||||
|
forceStars: true),
|
||||||
|
Texts(
|
||||||
|
"(${model.finalProducts[index].approvedTotalReviews})",
|
||||||
|
regular: true,
|
||||||
|
fontSize: 10,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w400,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Expanded(
|
||||||
|
child: Container(
|
||||||
|
height: MediaQuery.of(context).size.height * 5.0,
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: model.finalProducts.length,
|
||||||
|
itemBuilder:
|
||||||
|
(BuildContext context, int index) {
|
||||||
|
return Card(
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Stack(
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
left: 9.0,
|
||||||
|
top: 8.0,
|
||||||
|
right: 10.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.fromLTRB(
|
||||||
|
0, 0, 0, 0),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Image.network(
|
||||||
|
model.finalProducts[index]
|
||||||
|
.images.isNotEmpty
|
||||||
|
? model
|
||||||
|
.finalProducts[
|
||||||
|
index]
|
||||||
|
.images[0]
|
||||||
|
.thumb
|
||||||
|
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
|
||||||
|
fit: BoxFit.contain,
|
||||||
|
height: 80,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: model
|
||||||
|
.finalProducts[
|
||||||
|
index]
|
||||||
|
.rxMessage !=
|
||||||
|
null
|
||||||
|
? MediaQuery.of(context)
|
||||||
|
.size
|
||||||
|
.width /
|
||||||
|
3.5
|
||||||
|
: 0,
|
||||||
|
padding: EdgeInsets.all(4),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xffb23838),
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.only(
|
||||||
|
topLeft: Radius
|
||||||
|
.circular(6)),
|
||||||
|
),
|
||||||
|
child: Texts(
|
||||||
|
model.finalProducts[index]
|
||||||
|
.rxMessage !=
|
||||||
|
null
|
||||||
|
? model
|
||||||
|
.finalProducts[
|
||||||
|
index]
|
||||||
|
.rxMessage
|
||||||
|
: "",
|
||||||
|
color: Colors.white,
|
||||||
|
regular: true,
|
||||||
|
fontSize: 10,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: 100.0,
|
||||||
|
margin: EdgeInsets.symmetric(
|
||||||
|
horizontal: 6,
|
||||||
|
vertical: 0,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceAround,
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
height: 4.0,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: 35.0,
|
||||||
|
width: 250.0,
|
||||||
|
child: Texts(
|
||||||
|
model.finalProducts[index]
|
||||||
|
.name,
|
||||||
|
regular: true,
|
||||||
|
fontSize: 13.2,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
maxLines: 2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 8.0,
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.only(
|
||||||
|
top: 4, bottom: 4),
|
||||||
|
child: Texts(
|
||||||
|
"SAR ${model.finalProducts[index].price}",
|
||||||
|
bold: true,
|
||||||
|
fontSize: 14,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
StarRating(
|
||||||
|
totalAverage: model
|
||||||
|
.finalProducts[
|
||||||
|
index]
|
||||||
|
.approvedRatingSum >
|
||||||
|
0
|
||||||
|
? (model
|
||||||
|
.finalProducts[
|
||||||
|
index]
|
||||||
|
.approvedRatingSum
|
||||||
|
.toDouble() /
|
||||||
|
model
|
||||||
|
.finalProducts[
|
||||||
|
index]
|
||||||
|
.approvedRatingSum
|
||||||
|
.toDouble())
|
||||||
|
.toDouble()
|
||||||
|
: 0,
|
||||||
|
forceStars: true),
|
||||||
|
Texts(
|
||||||
|
"(${model.finalProducts[index].approvedTotalReviews})",
|
||||||
|
regular: true,
|
||||||
|
fontSize: 10,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w400,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,166 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/parent_categorise_page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/pharmacies/screens/pharmacy_module_page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/pharmacy/profile/profile.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/pharmacy_categorise.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/search_products_page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/drawer/app_drawer_widget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/pharmacy/bottom_nav_pharmacy_bar.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/pharmacies/wishlist.dart';
|
||||||
|
|
||||||
|
import '../offers_categorise_page.dart';
|
||||||
|
|
||||||
|
class LandingPagePharmacy extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_LandingPagePharmacyState createState() => _LandingPagePharmacyState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _LandingPagePharmacyState extends State<LandingPagePharmacy> {
|
||||||
|
int currentTab = 0;
|
||||||
|
PageController pageController;
|
||||||
|
ProjectViewModel projectProvider;
|
||||||
|
|
||||||
|
_changeCurrentTab(int tab) {
|
||||||
|
setState(() {
|
||||||
|
currentTab = tab;
|
||||||
|
pageController.jumpToPage(tab);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
void initState() {
|
||||||
|
super.initState();
|
||||||
|
pageController = PageController(keepPage: true);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Scaffold(
|
||||||
|
appBar: currentTab == 0 || currentTab == 1
|
||||||
|
? AppBar(
|
||||||
|
backgroundColor: Color(0xff5AB145),
|
||||||
|
elevation: 0,
|
||||||
|
title: Container(
|
||||||
|
height: MediaQuery.of(context).size.height * 0.056,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(5.0),
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
child: InkWell(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(8.0),
|
||||||
|
child: Row(
|
||||||
|
//crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Icon(Icons.search, size: 25.0),
|
||||||
|
SizedBox(
|
||||||
|
width: 15.0,
|
||||||
|
),
|
||||||
|
Texts(
|
||||||
|
TranslationBase.of(context).searchProductHere,
|
||||||
|
fontSize: 13,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => SearchProductsPage()),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
leading: Builder(
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
height: 2.0,
|
||||||
|
width: 10.0,
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/images/pharmacy_logo.png',
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
actions: [
|
||||||
|
// IconButton(
|
||||||
|
// iconSize: 70,
|
||||||
|
// icon: SvgPicture.asset('assets/images/svg/robort_svg.svg',
|
||||||
|
// height: 100, width: 100, fit: BoxFit.cover),
|
||||||
|
// onPressed: () {
|
||||||
|
// triggerRobot();
|
||||||
|
// } //do something,
|
||||||
|
// )
|
||||||
|
],
|
||||||
|
centerTitle: true,
|
||||||
|
)
|
||||||
|
: currentTab == 4
|
||||||
|
? null
|
||||||
|
: AppBar(
|
||||||
|
backgroundColor: Color(0xff5AB145),
|
||||||
|
elevation: 0,
|
||||||
|
textTheme: TextTheme(
|
||||||
|
headline6: TextStyle(
|
||||||
|
color: Colors.white, fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
title: Text(getText(currentTab).toUpperCase()),
|
||||||
|
leading: Builder(
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return IconButton(
|
||||||
|
icon: Icon(Icons.arrow_back),
|
||||||
|
color: Colors.white,
|
||||||
|
onPressed: () => Scaffold.of(context).openDrawer(),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
actions: [
|
||||||
|
// IconButton(
|
||||||
|
// iconSize: 70,
|
||||||
|
// icon: SvgPicture.asset('assets/images/svg/robort_svg.svg',
|
||||||
|
// height: 100, width: 100, fit: BoxFit.cover),
|
||||||
|
// onPressed: () {
|
||||||
|
// triggerRobot();
|
||||||
|
// } //do something,
|
||||||
|
// )
|
||||||
|
],
|
||||||
|
centerTitle: true,
|
||||||
|
),
|
||||||
|
extendBody: false,
|
||||||
|
body: PageView(
|
||||||
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
controller: pageController,
|
||||||
|
children: [
|
||||||
|
PharmacyPage(),
|
||||||
|
PharmacyCategorisePage(),
|
||||||
|
// OffersCategorisePage(),
|
||||||
|
WishlistPage(),
|
||||||
|
PharmacyProfilePage(),
|
||||||
|
// Container(
|
||||||
|
// child: Text('text'),
|
||||||
|
// ),
|
||||||
|
CartOrderPage(),
|
||||||
|
], // Please do not remove the BookingOptions from this array
|
||||||
|
),
|
||||||
|
bottomNavigationBar: BottomNavPharmacyBar(
|
||||||
|
changeIndex: _changeCurrentTab,
|
||||||
|
index: currentTab,
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
getText(currentTab) {
|
||||||
|
switch (currentTab) {
|
||||||
|
case 2:
|
||||||
|
return 'Wishlist';
|
||||||
|
case 3:
|
||||||
|
return 'My Account';
|
||||||
|
case 4:
|
||||||
|
return 'Shopping Cart';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,620 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/offers_Categorise_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
import 'base/base_view.dart';
|
||||||
|
|
||||||
|
class OffersCategorisePage extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_OffersCategorisePageState createState() => _OffersCategorisePageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _OffersCategorisePageState extends State<OffersCategorisePage> {
|
||||||
|
String categoriseName = "Personal Care";
|
||||||
|
bool styleOne = true;
|
||||||
|
bool styleTwo = false;
|
||||||
|
Icon styleIcon = Icon(
|
||||||
|
Icons.widgets_sharp,
|
||||||
|
color: Colors.blue,
|
||||||
|
size: 29.0,
|
||||||
|
);
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
ProjectViewModel projectProvider = Provider.of(context);
|
||||||
|
return BaseView<OffersCategoriseViewModel>(
|
||||||
|
onModelReady: (model) => model.getOffersCategorise(),
|
||||||
|
builder: (BuildContext context, OffersCategoriseViewModel model,
|
||||||
|
Widget child) =>
|
||||||
|
PharmacyAppScaffold(
|
||||||
|
appBarTitle: 'Offers',
|
||||||
|
isShowAppBar: true,
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
isShowDecPage: false,
|
||||||
|
baseViewModel: model,
|
||||||
|
body: Container(
|
||||||
|
//height: MediaQuery.of(context).size.height * 0.57,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.all(10.0),
|
||||||
|
child: Container(
|
||||||
|
child: Texts(
|
||||||
|
'Categories',
|
||||||
|
fontWeight: FontWeight.w800,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Divider(
|
||||||
|
thickness: 1.0,
|
||||||
|
color: Colors.grey.shade400,
|
||||||
|
),
|
||||||
|
//Expanded widget heree if nassery
|
||||||
|
Container(
|
||||||
|
height: MediaQuery.of(context).size.height * 0.20,
|
||||||
|
child: ListView.builder(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
itemCount: model.categorise.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.all(8.0),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
InkWell(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
height: 60.0,
|
||||||
|
width: 65.0,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
color: Colors.orange.shade200
|
||||||
|
.withOpacity(0.45),
|
||||||
|
),
|
||||||
|
child: Icon(
|
||||||
|
Icons.apps_sharp,
|
||||||
|
size: 32.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context)
|
||||||
|
.size
|
||||||
|
.width *
|
||||||
|
0.2,
|
||||||
|
height: MediaQuery.of(context)
|
||||||
|
.size
|
||||||
|
.height *
|
||||||
|
0.09,
|
||||||
|
child: Center(
|
||||||
|
child: Texts(
|
||||||
|
model.categorise[index].name,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
fontSize: 13.8,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
model.getOffersProducts(
|
||||||
|
i: model.categorise[index].id);
|
||||||
|
String ids = model.categorise[index].id;
|
||||||
|
|
||||||
|
categoriseName =
|
||||||
|
model.categorise[index].name;
|
||||||
|
}),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
Divider(
|
||||||
|
thickness: 1.0,
|
||||||
|
color: Colors.grey.shade400,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.all(8.0),
|
||||||
|
child: Texts(
|
||||||
|
categoriseName,
|
||||||
|
fontWeight: FontWeight.w800,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
height: 44.0,
|
||||||
|
child: VerticalDivider(
|
||||||
|
color: Colors.black45,
|
||||||
|
thickness: 0.7,
|
||||||
|
//width: 0.3,
|
||||||
|
// indent: 0.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.all(8.0),
|
||||||
|
child: InkWell(
|
||||||
|
child: styleIcon,
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
if (styleOne == true) {
|
||||||
|
styleOne = false;
|
||||||
|
styleTwo = true;
|
||||||
|
styleIcon = Icon(
|
||||||
|
Icons.auto_awesome_mosaic,
|
||||||
|
color: Colors.blue,
|
||||||
|
size: 29.0,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
styleOne = true;
|
||||||
|
styleTwo = false;
|
||||||
|
styleIcon = Icon(
|
||||||
|
Icons.widgets_sharp,
|
||||||
|
color: Colors.blue,
|
||||||
|
size: 29.0,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Divider(
|
||||||
|
thickness: 1.0,
|
||||||
|
color: Colors.grey.shade400,
|
||||||
|
),
|
||||||
|
styleOne == true
|
||||||
|
? Expanded(
|
||||||
|
child: Container(
|
||||||
|
height: MediaQuery.of(context).size.height * 0.50,
|
||||||
|
child: GridView.builder(
|
||||||
|
gridDelegate:
|
||||||
|
SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
crossAxisCount: 2,
|
||||||
|
crossAxisSpacing: 0.5,
|
||||||
|
mainAxisSpacing: 2.0,
|
||||||
|
childAspectRatio: 0.85,
|
||||||
|
),
|
||||||
|
itemCount: model.products.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return NetworkBaseView(
|
||||||
|
baseViewModel: model,
|
||||||
|
child: Card(
|
||||||
|
color: model.products[index]
|
||||||
|
.discountName !=
|
||||||
|
null
|
||||||
|
? Color(0xffFFFF00)
|
||||||
|
: Colors.white,
|
||||||
|
elevation: 0,
|
||||||
|
shape: Border(
|
||||||
|
right: BorderSide(
|
||||||
|
color: Colors.grey.shade300,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
left: BorderSide(
|
||||||
|
color: Colors.grey.shade300,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
bottom: BorderSide(
|
||||||
|
color: Colors.grey.shade300,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
top: BorderSide(
|
||||||
|
color: Colors.grey.shade300,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
margin: EdgeInsets.symmetric(
|
||||||
|
horizontal: 8,
|
||||||
|
vertical: 4,
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
height: 250.0,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(110.0),
|
||||||
|
),
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 0),
|
||||||
|
width: MediaQuery.of(context)
|
||||||
|
.size
|
||||||
|
.width /
|
||||||
|
3,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Stack(
|
||||||
|
children: [
|
||||||
|
if (model.products[index]
|
||||||
|
.discountName !=
|
||||||
|
null)
|
||||||
|
RotatedBox(
|
||||||
|
quarterTurns: 4,
|
||||||
|
child: Container(
|
||||||
|
decoration:
|
||||||
|
BoxDecoration(),
|
||||||
|
child: Padding(
|
||||||
|
padding:
|
||||||
|
EdgeInsets.only(
|
||||||
|
right: 5.0,
|
||||||
|
top: 20.0,
|
||||||
|
bottom: 5.0,
|
||||||
|
),
|
||||||
|
child: Texts(
|
||||||
|
'offer'
|
||||||
|
.toUpperCase(),
|
||||||
|
color: Colors.red,
|
||||||
|
fontSize: 13.0,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w900,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
transform: new Matrix4
|
||||||
|
.rotationZ(
|
||||||
|
5.837200),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.fromLTRB(
|
||||||
|
0, 16, 0, 0),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Image.network(
|
||||||
|
model.products[index]
|
||||||
|
.images.isNotEmpty
|
||||||
|
? model
|
||||||
|
.products[index]
|
||||||
|
.images[0]
|
||||||
|
.thumb
|
||||||
|
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
height: 80,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: model.products[index]
|
||||||
|
.rxMessage !=
|
||||||
|
null
|
||||||
|
? MediaQuery.of(context)
|
||||||
|
.size
|
||||||
|
.width /
|
||||||
|
5
|
||||||
|
: 0,
|
||||||
|
padding: EdgeInsets.all(4),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xffb23838),
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.only(
|
||||||
|
topLeft: Radius
|
||||||
|
.circular(6)),
|
||||||
|
),
|
||||||
|
child: Texts(
|
||||||
|
model.products[index]
|
||||||
|
.rxMessage !=
|
||||||
|
null
|
||||||
|
? model
|
||||||
|
.products[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: [
|
||||||
|
if (model.products[index]
|
||||||
|
.discountName !=
|
||||||
|
null)
|
||||||
|
Container(
|
||||||
|
width: double.infinity,
|
||||||
|
height: 22.0,
|
||||||
|
decoration:
|
||||||
|
BoxDecoration(
|
||||||
|
color:
|
||||||
|
Color(0xff5AB145),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Texts(
|
||||||
|
model
|
||||||
|
.products[index]
|
||||||
|
.discountName,
|
||||||
|
regular: true,
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 12.0,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w700,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Texts(
|
||||||
|
model
|
||||||
|
.products[index].name,
|
||||||
|
regular: true,
|
||||||
|
fontSize: 12.58,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w600,
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.only(
|
||||||
|
top: 4,
|
||||||
|
bottom: 4),
|
||||||
|
child: Texts(
|
||||||
|
"SAR ${model.products[index].price}",
|
||||||
|
bold: true,
|
||||||
|
fontSize: 14,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
StarRating(
|
||||||
|
totalAverage: model
|
||||||
|
.products[
|
||||||
|
index]
|
||||||
|
.approvedRatingSum >
|
||||||
|
0
|
||||||
|
? (model.products[index].approvedRatingSum
|
||||||
|
.toDouble() /
|
||||||
|
model
|
||||||
|
.products[index]
|
||||||
|
.approvedRatingSum
|
||||||
|
.toDouble())
|
||||||
|
.toDouble()
|
||||||
|
: 0,
|
||||||
|
forceStars: true),
|
||||||
|
Texts(
|
||||||
|
"(${model.products[index].approvedTotalReviews})",
|
||||||
|
regular: true,
|
||||||
|
fontSize: 10,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w400,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: model.products.length,
|
||||||
|
itemBuilder:
|
||||||
|
(BuildContext context, int index) {
|
||||||
|
return Card(
|
||||||
|
// color:
|
||||||
|
// model.products[index].discountName !=
|
||||||
|
// null
|
||||||
|
// ? Color(0xffFFFF00)
|
||||||
|
// : Colors.white,
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Stack(
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
if (model.products[index]
|
||||||
|
.discountName !=
|
||||||
|
null)
|
||||||
|
Container(
|
||||||
|
decoration:
|
||||||
|
BoxDecoration(),
|
||||||
|
child: Padding(
|
||||||
|
padding:
|
||||||
|
EdgeInsets.only(
|
||||||
|
left: 9.0,
|
||||||
|
top: 8.0,
|
||||||
|
right: 10.0,
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
color: Colors.yellow,
|
||||||
|
height: 25.0,
|
||||||
|
width: 70.0,
|
||||||
|
child: Center(
|
||||||
|
child: Texts(
|
||||||
|
'offer'
|
||||||
|
.toUpperCase(),
|
||||||
|
color: Colors.red,
|
||||||
|
fontSize: 13.0,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight
|
||||||
|
.w900,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
transform:
|
||||||
|
new Matrix4.rotationZ(
|
||||||
|
6.15099),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.fromLTRB(
|
||||||
|
0, 0, 0, 0),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Image.network(
|
||||||
|
model.products[index]
|
||||||
|
.images.isNotEmpty
|
||||||
|
? model
|
||||||
|
.products[index]
|
||||||
|
.images[0]
|
||||||
|
.thumb
|
||||||
|
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
height: 80,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: model.products[index]
|
||||||
|
.rxMessage !=
|
||||||
|
null
|
||||||
|
? MediaQuery.of(context)
|
||||||
|
.size
|
||||||
|
.width /
|
||||||
|
5
|
||||||
|
: 0,
|
||||||
|
padding: EdgeInsets.all(4),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xffb23838),
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.only(
|
||||||
|
topLeft: Radius
|
||||||
|
.circular(6)),
|
||||||
|
),
|
||||||
|
child: Texts(
|
||||||
|
model.products[index]
|
||||||
|
.rxMessage !=
|
||||||
|
null
|
||||||
|
? model
|
||||||
|
.products[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: [
|
||||||
|
if (model.products[index]
|
||||||
|
.discountName !=
|
||||||
|
null)
|
||||||
|
Container(
|
||||||
|
width: 250.0,
|
||||||
|
height: 22.5,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xff5AB145),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding:
|
||||||
|
EdgeInsets.symmetric(
|
||||||
|
horizontal: 5.5,
|
||||||
|
),
|
||||||
|
child: Texts(
|
||||||
|
model.products[index]
|
||||||
|
.discountName,
|
||||||
|
regular: true,
|
||||||
|
color: Colors.white,
|
||||||
|
fontSize: 12.0,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w700,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 4.0,
|
||||||
|
),
|
||||||
|
Texts(
|
||||||
|
model.products[index].name,
|
||||||
|
regular: true,
|
||||||
|
fontSize: 14.0,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 8.0,
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.only(
|
||||||
|
top: 4, bottom: 4),
|
||||||
|
child: Texts(
|
||||||
|
"SAR ${model.products[index].price}",
|
||||||
|
bold: true,
|
||||||
|
fontSize: 14,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
StarRating(
|
||||||
|
totalAverage: model
|
||||||
|
.products[
|
||||||
|
index]
|
||||||
|
.approvedRatingSum >
|
||||||
|
0
|
||||||
|
? (model
|
||||||
|
.products[
|
||||||
|
index]
|
||||||
|
.approvedRatingSum
|
||||||
|
.toDouble() /
|
||||||
|
model
|
||||||
|
.products[
|
||||||
|
index]
|
||||||
|
.approvedRatingSum
|
||||||
|
.toDouble())
|
||||||
|
.toDouble()
|
||||||
|
: 0,
|
||||||
|
forceStars: true),
|
||||||
|
Texts(
|
||||||
|
"(${model.products[index].approvedTotalReviews})",
|
||||||
|
regular: true,
|
||||||
|
fontSize: 10,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w500,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,70 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/pharmacy/product_tile.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||||
|
var languageID;
|
||||||
|
class ProductCheckTypeWidget extends StatelessWidget {
|
||||||
|
final List<dynamic> wishlist;
|
||||||
|
final bool isTrue;
|
||||||
|
|
||||||
|
ProductCheckTypeWidget(this.isTrue, this.wishlist);
|
||||||
|
|
||||||
|
|
||||||
|
void initState() {
|
||||||
|
getLanguageID();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return isTrue
|
||||||
|
? ListView.builder(
|
||||||
|
itemCount: wishlist.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
child: isTrue
|
||||||
|
? productTile(
|
||||||
|
productName: languageID == 'ar' ? wishlist[index].product.namen : wishlist[index].product.name,
|
||||||
|
productPrice: wishlist[index].subtotal,
|
||||||
|
productRate:
|
||||||
|
double.parse(wishlist[index].subtotalVatRate),
|
||||||
|
productImage: wishlist[index].product.images[0].src,
|
||||||
|
showLine: isTrue,
|
||||||
|
productID: wishlist[index].product.id,
|
||||||
|
)
|
||||||
|
: productTile(
|
||||||
|
productName: languageID == 'ar' ? wishlist[index].product.namen : wishlist[index].product.name,
|
||||||
|
productPrice: wishlist[index].subtotal,
|
||||||
|
productRate:
|
||||||
|
double.parse(wishlist[index].subtotalVatRate),
|
||||||
|
productImage: wishlist[index].product.images[0].src,
|
||||||
|
showLine: isTrue,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Divider(height: 1, color: Colors.grey)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
})
|
||||||
|
: GridView.count(
|
||||||
|
crossAxisCount: 2,
|
||||||
|
children: List.generate(
|
||||||
|
wishlist.length,
|
||||||
|
(index) => productTile(
|
||||||
|
productName: wishlist[index].product.name,
|
||||||
|
productPrice: wishlist[index].subtotal,
|
||||||
|
productRate:
|
||||||
|
double.parse(wishlist[index].subtotalVatRate),
|
||||||
|
productImage: wishlist[index].product.images[0].src,
|
||||||
|
showLine: isTrue,
|
||||||
|
)),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getLanguageID() async {
|
||||||
|
languageID = await sharedPref.getString(APP_LANGUAGE);
|
||||||
|
}
|
||||||
|
|
||||||
@ -0,0 +1,36 @@
|
|||||||
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
|
||||||
|
|
||||||
|
class CompareList with ChangeNotifier {
|
||||||
|
List<PharmacyProduct> _product = [];
|
||||||
|
|
||||||
|
List<PharmacyProduct> get productListItems => _product;
|
||||||
|
|
||||||
|
void addItem(data) {
|
||||||
|
if (_product.length == 0) {
|
||||||
|
_product.add(data);
|
||||||
|
AppToast.showSuccessToast(message: 'You have added a product to the Compare list');
|
||||||
|
} else {
|
||||||
|
for (int i = 0; i < _product.length; i++) {
|
||||||
|
if (_product.length <= 4 && _product[i].id != data.id) {
|
||||||
|
_product.add(data);
|
||||||
|
AppToast.showSuccessToast(message: 'You have added a product to the Compare list');
|
||||||
|
break;
|
||||||
|
} else if(_product[i].id == data.id){
|
||||||
|
AppToast.showErrorToast(message: 'the item is already in the list');
|
||||||
|
} else if(_product.length == 4){
|
||||||
|
AppToast.showErrorToast(message: 'your compare list is full');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
|
||||||
|
void deleteItem(data) {
|
||||||
|
for (int i = 0; i < _product.length; i++) {
|
||||||
|
if (_product[i].id == data) _product.remove(_product[i]);
|
||||||
|
}
|
||||||
|
notifyListeners();
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,330 @@
|
|||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:carousel_slider/carousel_slider.dart';
|
||||||
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/pharmacies/compare-list.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/pharmacies/PharmacyProduct.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
int counter = 0;
|
||||||
|
|
||||||
|
void main() => runApp(ComparePage());
|
||||||
|
|
||||||
|
class ComparePage extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_ComparePageState createState() => _ComparePageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
//CompareList compareItems = CompareList();
|
||||||
|
class _ComparePageState extends State<ComparePage> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return AppScaffold(
|
||||||
|
appBarTitle: 'Reviews page',
|
||||||
|
isShowAppBar: true,
|
||||||
|
isPharmacy: true,
|
||||||
|
body: Container(
|
||||||
|
child: compareList(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class compareList extends StatelessWidget {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
final productItemData = Provider.of<CompareList>(context);
|
||||||
|
final productItem = productItemData.productListItems;
|
||||||
|
return productItem.length == 0
|
||||||
|
? Container(
|
||||||
|
child: Center(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/images/new-design/empty_box.png',
|
||||||
|
width: 100,
|
||||||
|
height: 100,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Text(
|
||||||
|
'There is no data',
|
||||||
|
style: TextStyle(fontSize: 30),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: CarouselSlider(
|
||||||
|
options: CarouselOptions(
|
||||||
|
height: 800.0,
|
||||||
|
viewportFraction: 0.87,
|
||||||
|
enableInfiniteScroll: false),
|
||||||
|
items: productItem.map((i) {
|
||||||
|
return Builder(
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return Padding(
|
||||||
|
padding: const EdgeInsets.only(top: 8),
|
||||||
|
child: Container(
|
||||||
|
width: MediaQuery.of(context).size.width,
|
||||||
|
margin: EdgeInsets.symmetric(horizontal: 10.0),
|
||||||
|
child: productItem.length != 0
|
||||||
|
? slideDetail(productItem)
|
||||||
|
: Container(),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}).toList(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class slideDetail extends StatefulWidget {
|
||||||
|
final List<PharmacyProduct> data;
|
||||||
|
|
||||||
|
slideDetail(this.data);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_slideDetailState createState() => _slideDetailState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _slideDetailState extends State<slideDetail> {
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return ListView.builder(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
itemCount: widget.data.length,
|
||||||
|
itemBuilder: (BuildContext contx, int index) {
|
||||||
|
return Row(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
height: 550,
|
||||||
|
width: 150,
|
||||||
|
margin: EdgeInsets.symmetric(horizontal: 10.0),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
border: Border(
|
||||||
|
top: BorderSide(width: 0.5, color: Colors.grey),
|
||||||
|
left: BorderSide(width: 0.5, color: Colors.grey),
|
||||||
|
right: BorderSide(width: 0.5, color: Colors.grey),
|
||||||
|
bottom: BorderSide(width: 0.5, color: Colors.grey),
|
||||||
|
),
|
||||||
|
color: Colors.white),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.topRight,
|
||||||
|
child: IconButton(
|
||||||
|
icon: Icon(FontAwesomeIcons.trashAlt, size: 15),
|
||||||
|
onPressed: () {
|
||||||
|
setState(() {
|
||||||
|
Provider.of<CompareList>(context, listen: false)
|
||||||
|
.deleteItem(widget.data[index].id);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
Image.network(
|
||||||
|
widget.data[index].images[0].src.trim(),
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
width: 100,
|
||||||
|
height: 60,
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(top: 8.0),
|
||||||
|
child: Container(
|
||||||
|
height: 1.0,
|
||||||
|
width: 300.0,
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.all(5),
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.topLeft,
|
||||||
|
child: RichText(
|
||||||
|
text: TextSpan(
|
||||||
|
text: widget.data[index].name,
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.black,
|
||||||
|
fontSize: 13),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.all(5),
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.topLeft,
|
||||||
|
child: RichText(
|
||||||
|
text: TextSpan(
|
||||||
|
text: widget.data[index].price.toString(),
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.black54,
|
||||||
|
fontSize: 15,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(top: 8.0),
|
||||||
|
child: Container(
|
||||||
|
height: 1.0,
|
||||||
|
width: 300.0,
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.all(5),
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.topLeft,
|
||||||
|
child: RichText(
|
||||||
|
text: TextSpan(
|
||||||
|
text: widget.data[index].specifications[0].name,
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.black,
|
||||||
|
fontSize: 13),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.all(5),
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.topLeft,
|
||||||
|
child: RichText(
|
||||||
|
text: TextSpan(
|
||||||
|
text: widget.data[index].specifications[1].name,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.black54,
|
||||||
|
fontSize: 15,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(top: 8.0),
|
||||||
|
child: Container(
|
||||||
|
height: 1.0,
|
||||||
|
width: 300.0,
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.all(5),
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.topLeft,
|
||||||
|
child: RichText(
|
||||||
|
text: TextSpan(
|
||||||
|
text: widget.data[index].specifications[2].name,
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.black,
|
||||||
|
fontSize: 13),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.all(5),
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.topLeft,
|
||||||
|
child: RichText(
|
||||||
|
text: TextSpan(
|
||||||
|
text: widget.data[index].specifications[3].name,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.black54,
|
||||||
|
fontSize: 15,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(top: 8.0),
|
||||||
|
child: Container(
|
||||||
|
height: 1.0,
|
||||||
|
width: 300.0,
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.all(5),
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.topLeft,
|
||||||
|
child: RichText(
|
||||||
|
text: TextSpan(
|
||||||
|
text: widget.data[index].specifications[4].name,
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.black,
|
||||||
|
fontSize: 13),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.all(5),
|
||||||
|
child: Align(
|
||||||
|
alignment: Alignment.topLeft,
|
||||||
|
child: RichText(
|
||||||
|
text: TextSpan(
|
||||||
|
text: widget.data[index].specifications[5].name,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.black54,
|
||||||
|
fontSize: 15,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(top: 8.0),
|
||||||
|
child: Container(
|
||||||
|
height: 1.0,
|
||||||
|
width: 300.0,
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String returnString(data) {
|
||||||
|
for (int i = 0; i < data.length; i++) {
|
||||||
|
print(data[i]);
|
||||||
|
// if(data[i] == null){
|
||||||
|
// if(counter == i){
|
||||||
|
//
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
}
|
||||||
|
return "ENAD HILAL";
|
||||||
|
}
|
||||||
@ -0,0 +1,249 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/review_view_model.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:rating_bar/rating_bar.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||||
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||||
|
|
||||||
|
void main() => runApp(MyReviewsPage());
|
||||||
|
|
||||||
|
class MyReviewsPage extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_MyReviewsPageState createState() => _MyReviewsPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
var languageID;
|
||||||
|
|
||||||
|
class _MyReviewsPageState extends State<MyReviewsPage> {
|
||||||
|
void initState() {
|
||||||
|
getLanguageID();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BaseView<ReviewViewModel>(
|
||||||
|
onModelReady: (model) => model.getReviewData(),
|
||||||
|
builder: (_, model, wi) => AppScaffold(
|
||||||
|
appBarTitle: 'Wishlist page',
|
||||||
|
isShowAppBar: true,
|
||||||
|
isPharmacy: true,
|
||||||
|
body: model.reviewListList.length == 0
|
||||||
|
? Container(
|
||||||
|
child: Center(
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/images/new-design/empty_box.png',
|
||||||
|
width: 100,
|
||||||
|
height: 100,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Text(
|
||||||
|
'There is no data',
|
||||||
|
style: TextStyle(fontSize: 30),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Container(
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: model.reviewListList.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
child: reviewDetails(
|
||||||
|
model.reviewListList[index],
|
||||||
|
double.parse(model.reviewListList[index].product
|
||||||
|
.approvedTotalReviews
|
||||||
|
.toString()),
|
||||||
|
double.parse(model.reviewListList[index].rating
|
||||||
|
.toString()),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Divider(height: 1, color: Colors.grey)
|
||||||
|
],
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
reviewDetails(data, rate, myRate) {
|
||||||
|
return Container(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(bottom: 10.0),
|
||||||
|
child: Container(
|
||||||
|
height: 200,
|
||||||
|
width: double.infinity,
|
||||||
|
color: Colors.white,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
margin: languageID == 'ar'
|
||||||
|
? EdgeInsets.only(top: 10, right: 10)
|
||||||
|
: EdgeInsets.only(top: 10, left: 10),
|
||||||
|
child: Image.network(
|
||||||
|
data.product.images[0].src.trim(),
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
width: 80,
|
||||||
|
height: 80,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.all(5),
|
||||||
|
child: Align(
|
||||||
|
alignment: languageID == 'ar'
|
||||||
|
? Alignment.topRight
|
||||||
|
: Alignment.topLeft,
|
||||||
|
child: RichText(
|
||||||
|
text: TextSpan(
|
||||||
|
text: languageID == 'ar'
|
||||||
|
? data.product.namen
|
||||||
|
: data.product.name,
|
||||||
|
style: TextStyle(
|
||||||
|
color: Colors.black54,
|
||||||
|
fontSize: languageID == 'ar' ? 7 : 13,
|
||||||
|
fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.all(5),
|
||||||
|
child: Align(
|
||||||
|
alignment: languageID == 'ar'
|
||||||
|
? Alignment.topRight
|
||||||
|
: Alignment.topLeft,
|
||||||
|
child: RichText(
|
||||||
|
text: TextSpan(
|
||||||
|
text: data.product.price.toString() +
|
||||||
|
" " +
|
||||||
|
data.product.currency,
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
color: Colors.black,
|
||||||
|
fontSize: 13),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.all(5),
|
||||||
|
child: Align(
|
||||||
|
alignment: languageID == 'ar'
|
||||||
|
? Alignment.topRight
|
||||||
|
: Alignment.topLeft,
|
||||||
|
child: RatingBar.readOnly(
|
||||||
|
initialRating: rate,
|
||||||
|
size: 15.0,
|
||||||
|
filledColor: Colors.yellow[700],
|
||||||
|
emptyColor: Colors.grey[500],
|
||||||
|
isHalfAllowed: true,
|
||||||
|
halfFilledIcon: Icons.star_half,
|
||||||
|
filledIcon: Icons.star,
|
||||||
|
emptyIcon: Icons.star,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 20,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: languageID == 'ar'
|
||||||
|
? EdgeInsets.only(right: 10)
|
||||||
|
: EdgeInsets.only(left: 10),
|
||||||
|
child: Text(data.createdOnUtc.toString())),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.end,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.end,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
padding: languageID == 'ar'
|
||||||
|
? EdgeInsets.only(right: 60)
|
||||||
|
: EdgeInsets.only(left: 60),
|
||||||
|
child: RatingBar.readOnly(
|
||||||
|
initialRating: myRate,
|
||||||
|
size: 15.0,
|
||||||
|
filledColor: Colors.yellow[700],
|
||||||
|
emptyColor: Colors.grey[500],
|
||||||
|
isHalfAllowed: true,
|
||||||
|
halfFilledIcon: Icons.star_half,
|
||||||
|
filledIcon: Icons.star,
|
||||||
|
emptyIcon: Icons.star,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 15,
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Container(
|
||||||
|
padding: languageID == 'ar'
|
||||||
|
? EdgeInsets.only(right: 10)
|
||||||
|
: EdgeInsets.only(left: 10),
|
||||||
|
child: Text(fixingString(data.reviewText.toString())),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
fixingString(txt) {
|
||||||
|
String stringTxt;
|
||||||
|
String newTxt;
|
||||||
|
stringTxt = txt.toString();
|
||||||
|
newTxt = stringTxt.split('.')[1];
|
||||||
|
|
||||||
|
return newTxt;
|
||||||
|
}
|
||||||
|
|
||||||
|
getLanguageID() async {
|
||||||
|
languageID = await sharedPref.getString(APP_LANGUAGE);
|
||||||
|
}
|
||||||
@ -0,0 +1,254 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/login/register-info.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/pharmacies/search_brands_page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/search_products_page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/brand_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||||
|
|
||||||
|
void main() => runApp(ProductBrandsPage());
|
||||||
|
|
||||||
|
class ProductBrandsPage extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_ProductBrandsPageState createState() => _ProductBrandsPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
var languageID;
|
||||||
|
class _ProductBrandsPageState extends State<ProductBrandsPage> {
|
||||||
|
|
||||||
|
void initState() {
|
||||||
|
getLanguageID();
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BaseView<BrandsViewModel>(
|
||||||
|
onModelReady: (model) => model.getBrandsData(),
|
||||||
|
builder: (_, model, wi) => AppScaffold(
|
||||||
|
appBarTitle: 'Brands page',
|
||||||
|
isShowAppBar: true,
|
||||||
|
isPharmacy: true,
|
||||||
|
isShowDecPage: false,
|
||||||
|
body: Container(
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
color: Colors.white,
|
||||||
|
alignment: languageID == 'ar'?
|
||||||
|
Alignment.topRight :
|
||||||
|
Alignment.topLeft,
|
||||||
|
padding: languageID == 'ar' ?
|
||||||
|
EdgeInsets.only(
|
||||||
|
right: 10.0,
|
||||||
|
top: 10.0
|
||||||
|
):
|
||||||
|
EdgeInsets.only(
|
||||||
|
left: 10.0,
|
||||||
|
top: 10.0
|
||||||
|
),
|
||||||
|
child: Text(
|
||||||
|
TranslationBase.of(context).topBrands,
|
||||||
|
style: TextStyle(
|
||||||
|
fontWeight: FontWeight.bold,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: 220,
|
||||||
|
width: double.infinity,
|
||||||
|
color: Colors.white,
|
||||||
|
child: topBrand(),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: MediaQuery.of(context).size.height * 0.056,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(5.0),
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
child: InkWell(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(8.0),
|
||||||
|
child: Row(
|
||||||
|
//crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Icon(Icons.search, size: 25.0),
|
||||||
|
SizedBox(
|
||||||
|
width: 15.0,
|
||||||
|
),
|
||||||
|
Texts(
|
||||||
|
TranslationBase.of(context).searchProductHere,
|
||||||
|
fontSize: 13,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) => SearchBrandsPage()),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 10,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: 230,
|
||||||
|
width: double.infinity,
|
||||||
|
color: Colors.white,
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: model.brandsListList.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return InkWell(
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.only(top: 50, left: 10),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
languageID == 'ar' ? Text(model.brandsListList[index].namen):Text(model.brandsListList[index].name),
|
||||||
|
SizedBox(
|
||||||
|
height: 3,
|
||||||
|
),
|
||||||
|
Divider(height: 1, color: Colors.grey)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: (){
|
||||||
|
print("ENAD");
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
topBrand() {
|
||||||
|
return BaseView<BrandsViewModel>(
|
||||||
|
onModelReady: (model) => model.getTopBrandsData(),
|
||||||
|
builder: (_, model, wi) => GridView.count(
|
||||||
|
crossAxisCount: 4,
|
||||||
|
children: List.generate(
|
||||||
|
model.topBrandsListList.length,
|
||||||
|
(index) => Column(
|
||||||
|
children: [
|
||||||
|
InkWell(
|
||||||
|
child: Container(
|
||||||
|
margin: EdgeInsets.fromLTRB(5.0, 10.0, 5.0, 0.0),
|
||||||
|
child: Container(
|
||||||
|
child: Container(
|
||||||
|
child: Container(
|
||||||
|
// padding: EdgeInsets.only(left: 5),
|
||||||
|
child: Container(
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 10.0, vertical: 10.0),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(10),
|
||||||
|
border: Border(
|
||||||
|
top: BorderSide(width: 1.0, color: Colors.grey),
|
||||||
|
left: BorderSide(width: 1.0, color: Colors.grey),
|
||||||
|
right: BorderSide(width: 1.0, color: Colors.grey),
|
||||||
|
bottom: BorderSide(width: 1.0, color: Colors.grey),
|
||||||
|
),
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
child: model.topBrandsListList[index].image != null ?Image.network(
|
||||||
|
model.topBrandsListList[index].image.src,
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
width: 60,
|
||||||
|
height: 40,
|
||||||
|
): Text(model.topBrandsListList[index].name)
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: (){
|
||||||
|
print("ENAD");
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
brandSearch() {
|
||||||
|
return Text('ENAD');
|
||||||
|
}
|
||||||
|
|
||||||
|
class SearchBar extends SearchDelegate<String> {
|
||||||
|
@override
|
||||||
|
List<Widget> buildActions(BuildContext context) {
|
||||||
|
return [
|
||||||
|
IconButton(
|
||||||
|
icon: Icon(Icons.clear),
|
||||||
|
onPressed: () {
|
||||||
|
query = "";
|
||||||
|
},
|
||||||
|
)
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget buildLeading(BuildContext context) {
|
||||||
|
return IconButton(
|
||||||
|
icon: AnimatedIcon(
|
||||||
|
icon: AnimatedIcons.menu_arrow,
|
||||||
|
progress: transitionAnimation,
|
||||||
|
),
|
||||||
|
onPressed: () {
|
||||||
|
close(context, null);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget buildResults(BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
height: 100,
|
||||||
|
width: 100,
|
||||||
|
child: Card(
|
||||||
|
color: Colors.red,
|
||||||
|
child: Center(
|
||||||
|
child: Text(query),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget buildSuggestions(BuildContext context) {
|
||||||
|
return ListView.builder(
|
||||||
|
itemCount: 5,
|
||||||
|
itemBuilder: (context, index) => ListTile(
|
||||||
|
leading: Icon(Icons.location_city),
|
||||||
|
title: Text("Enad"),
|
||||||
|
onTap: () {
|
||||||
|
showResults(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
getLanguageID() async {
|
||||||
|
languageID = await sharedPref.getString(APP_LANGUAGE);
|
||||||
|
}
|
||||||
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,145 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/brand_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class SearchBrandsPage extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_SearchBrandsPageState createState() => _SearchBrandsPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _SearchBrandsPageState extends State<SearchBrandsPage> {
|
||||||
|
final textController = TextEditingController();
|
||||||
|
final _formKey = GlobalKey<FormState>();
|
||||||
|
String msg = '';
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BaseView<BrandsViewModel>(
|
||||||
|
onModelReady: (model) => model.searchProducts(),
|
||||||
|
builder: (BuildContext context, model, Widget child) =>
|
||||||
|
PharmacyAppScaffold(
|
||||||
|
appBarTitle: 'Search',
|
||||||
|
isBottomBar: false,
|
||||||
|
isShowAppBar: true,
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
isShowDecPage: false,
|
||||||
|
//baseViewModel: model,
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: Container(
|
||||||
|
height: SizeConfig.screenHeight,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.all(8.0),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.79,
|
||||||
|
child: Form(
|
||||||
|
key: _formKey,
|
||||||
|
child: TextFields(
|
||||||
|
autoFocus: true,
|
||||||
|
hintText: 'Search',
|
||||||
|
fontSize: 19.0,
|
||||||
|
prefixIcon: Icon(Icons.search),
|
||||||
|
inputAction: TextInputAction.search,
|
||||||
|
onSaved: (value) {
|
||||||
|
//searchMedicine(model, context);
|
||||||
|
},
|
||||||
|
onSubmit: (value) {
|
||||||
|
searchMedicine(model, context);
|
||||||
|
msg = 'No Result Found';
|
||||||
|
},
|
||||||
|
controller: textController,
|
||||||
|
validator: (value) {
|
||||||
|
if (value.isEmpty) {
|
||||||
|
return 'please Enter Product Name';
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 10.0,
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
child: Texts(
|
||||||
|
'Cancel',
|
||||||
|
fontSize: 17.0,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
|
||||||
|
// child: Container(
|
||||||
|
// child: Button(
|
||||||
|
// backgroundColor: Colors.green,
|
||||||
|
// loading: model.state == ViewState.BusyLocal,
|
||||||
|
// label: 'Search',
|
||||||
|
// onTap: () {
|
||||||
|
// searchMedicine(model, context);
|
||||||
|
// }),
|
||||||
|
// width: MediaQuery.of(context).size.width * 0.09,
|
||||||
|
// ),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
model.searchList.length == 0
|
||||||
|
? Container(
|
||||||
|
child: Text(
|
||||||
|
'no data' + model.searchList.length.toString()),
|
||||||
|
)
|
||||||
|
: Expanded(
|
||||||
|
child: Container(
|
||||||
|
child: ListView.builder(
|
||||||
|
itemCount: model.searchList.length,
|
||||||
|
itemBuilder: (BuildContext ctx, index) {
|
||||||
|
return Padding(
|
||||||
|
padding:EdgeInsets.all(8.0),
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Container(
|
||||||
|
child: Text(
|
||||||
|
model.searchList[index].name,
|
||||||
|
style: TextStyle(fontSize: 20),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Divider(height: 1, color: Colors.grey)
|
||||||
|
],),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
searchMedicine(model, BuildContext context) {
|
||||||
|
Utils.hideKeyboard(context);
|
||||||
|
if (_formKey.currentState.validate())
|
||||||
|
model.searchProducts(productName: textController.text);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,238 @@
|
|||||||
|
import 'package:charts_flutter/flutter.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/landing/landing_page_pharmcy.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/parent_categorise_page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:barcode_scan/platform_wrapper.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
import 'base/base_view.dart';
|
||||||
|
import 'final_products_page.dart';
|
||||||
|
|
||||||
|
class PharmacyCategorisePage extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_PharmacyCategorisePageState createState() => _PharmacyCategorisePageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _PharmacyCategorisePageState extends State<PharmacyCategorisePage> {
|
||||||
|
String idCategorise;
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
ProjectViewModel projectViewModel = Provider.of(context);
|
||||||
|
return BaseView<PharmacyCategoriseViewModel>(
|
||||||
|
onModelReady: (model) => model.getCategorise(),
|
||||||
|
builder: (BuildContext context, PharmacyCategoriseViewModel model,
|
||||||
|
Widget child) =>
|
||||||
|
AppScaffold(
|
||||||
|
isShowDecPage: false,
|
||||||
|
baseViewModel: model,
|
||||||
|
body: Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
height: 400,
|
||||||
|
margin: EdgeInsets.only(bottom: 22),
|
||||||
|
child: GridView.builder(
|
||||||
|
gridDelegate: SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
crossAxisCount: 2,
|
||||||
|
crossAxisSpacing: 0.5,
|
||||||
|
mainAxisSpacing: 1.0,
|
||||||
|
childAspectRatio: 3.2,
|
||||||
|
),
|
||||||
|
itemCount: model.categorise.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return Padding(
|
||||||
|
padding: EdgeInsets.all(4.0),
|
||||||
|
child: InkWell(
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(5),
|
||||||
|
color: Colors.grey.withOpacity(0.24),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 10.0),
|
||||||
|
child: Texts(
|
||||||
|
projectViewModel.isArabic
|
||||||
|
? model.categorise[index].namen
|
||||||
|
: model.categorise[index].name,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
onTap: () => {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) =>
|
||||||
|
model.categorise[index].id != '12'
|
||||||
|
? ParentCategorisePage(
|
||||||
|
id: model.categorise[index].id,
|
||||||
|
titleName: model.categorise[index].name,
|
||||||
|
)
|
||||||
|
: FinalProductsPage(
|
||||||
|
id: model.categorise[index].id,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: 140,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Divider(
|
||||||
|
height: 2.0,
|
||||||
|
thickness: 1.0,
|
||||||
|
color: Colors.black12.withOpacity(0.14)),
|
||||||
|
SizedBox(
|
||||||
|
height: 10.0,
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(4.0),
|
||||||
|
child: Container(
|
||||||
|
height: 50.0,
|
||||||
|
width: 55.0,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.circular(5.0),
|
||||||
|
color: Colors.green.shade300.withOpacity(0.34),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 10.0),
|
||||||
|
child: Texts(
|
||||||
|
projectViewModel.isArabic
|
||||||
|
? 'الاكثر مبيعا'
|
||||||
|
: 'Best Sellers',
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(4.0),
|
||||||
|
child: Container(
|
||||||
|
height: 50.0,
|
||||||
|
width: 55.0,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.orangeAccent.shade200
|
||||||
|
.withOpacity(0.34),
|
||||||
|
borderRadius: BorderRadius.circular(5.0),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 10.0),
|
||||||
|
child: Texts(
|
||||||
|
projectViewModel.isArabic
|
||||||
|
? 'الاكثر مشاهدة'
|
||||||
|
: 'Most Viewed',
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(4.0),
|
||||||
|
child: Container(
|
||||||
|
height: 50.0,
|
||||||
|
width: 55.0,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Colors.blue.shade200.withOpacity(0.34),
|
||||||
|
borderRadius: BorderRadius.circular(5.0),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 10.0),
|
||||||
|
child: Texts(
|
||||||
|
projectViewModel.isArabic
|
||||||
|
? 'منتجات جديدة'
|
||||||
|
: 'New Products',
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(4.0),
|
||||||
|
child: InkWell(
|
||||||
|
onTap: () {
|
||||||
|
_scanQrAndGetPatient(context, model);
|
||||||
|
},
|
||||||
|
child: Container(
|
||||||
|
height: 50.0,
|
||||||
|
width: 55.0,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color:
|
||||||
|
Colors.purple.shade200.withOpacity(0.34),
|
||||||
|
borderRadius: BorderRadius.circular(5.0),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding:
|
||||||
|
EdgeInsets.symmetric(horizontal: 10.0),
|
||||||
|
child: Texts(
|
||||||
|
projectViewModel.isArabic
|
||||||
|
? 'شوهد مؤخرا'
|
||||||
|
: 'Recently Viewed',
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
)),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
_scanQrAndGetPatient(
|
||||||
|
BuildContext context,
|
||||||
|
PharmacyCategoriseViewModel model,
|
||||||
|
) async {
|
||||||
|
/// When give qr we will change this method to get data
|
||||||
|
/// var result = await BarcodeScanner.scan();
|
||||||
|
/// int patientID = get from qr result
|
||||||
|
var result = await BarcodeScanner.scan();
|
||||||
|
if (result.rawContent == "") {
|
||||||
|
List<String> listOfParams = result.rawContent.split(',');
|
||||||
|
// ScanQrRequestModel _scanQrRequestModel = ScanQrRequestModel(
|
||||||
|
// deliveryOrderID: int.parse(listOfParams[0]), groupID: 0);
|
||||||
|
String patientType = "1";
|
||||||
|
await model.scanQr();
|
||||||
|
if (model.state == ViewState.ErrorLocal) {
|
||||||
|
Utils.showErrorToast(model.error);
|
||||||
|
} else {
|
||||||
|
AppToast.showSuccessToast(message: model.scanList[0].id);
|
||||||
|
{
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(builder: (context) => LandingPagePharmacy()),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,287 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/utils.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/input/text_field.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'base/base_view.dart';
|
||||||
|
|
||||||
|
class SearchProductsPage extends StatefulWidget {
|
||||||
|
@override
|
||||||
|
_SearchProductsPageState createState() => _SearchProductsPageState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _SearchProductsPageState extends State<SearchProductsPage> {
|
||||||
|
final textController = TextEditingController();
|
||||||
|
final _formKey = GlobalKey<FormState>();
|
||||||
|
String msg = '';
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BaseView<PharmacyCategoriseViewModel>(
|
||||||
|
onModelReady: (model) => model.clearSearchList(),
|
||||||
|
builder: (BuildContext context, PharmacyCategoriseViewModel model,
|
||||||
|
Widget child) =>
|
||||||
|
PharmacyAppScaffold(
|
||||||
|
appBarTitle: 'Search',
|
||||||
|
isBottomBar: false,
|
||||||
|
isShowAppBar: true,
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
isShowDecPage: false,
|
||||||
|
//baseViewModel: model,
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: Container(
|
||||||
|
height: SizeConfig.screenHeight,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.all(8.0),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context).size.width * 0.79,
|
||||||
|
child: Form(
|
||||||
|
key: _formKey,
|
||||||
|
child: TextFields(
|
||||||
|
autoFocus: true,
|
||||||
|
hintText: 'Search',
|
||||||
|
fontSize: 19.0,
|
||||||
|
prefixIcon: Icon(Icons.search),
|
||||||
|
inputAction: TextInputAction.search,
|
||||||
|
onSaved: (value) {
|
||||||
|
//searchMedicine(model, context);
|
||||||
|
},
|
||||||
|
onSubmit: (value) {
|
||||||
|
searchMedicine(model, context);
|
||||||
|
msg = 'No Result Found';
|
||||||
|
},
|
||||||
|
controller: textController,
|
||||||
|
validator: (value) {
|
||||||
|
if (value.isEmpty) {
|
||||||
|
return 'please Enter Product Name';
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 10.0,
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
child: Texts(
|
||||||
|
'Cancel',
|
||||||
|
fontSize: 17.0,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
|
||||||
|
// child: Container(
|
||||||
|
// child: Button(
|
||||||
|
// backgroundColor: Colors.green,
|
||||||
|
// loading: model.state == ViewState.BusyLocal,
|
||||||
|
// label: 'Search',
|
||||||
|
// onTap: () {
|
||||||
|
// searchMedicine(model, context);
|
||||||
|
// }),
|
||||||
|
// width: MediaQuery.of(context).size.width * 0.09,
|
||||||
|
// ),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Center(
|
||||||
|
child: NetworkBaseView(
|
||||||
|
baseViewModel: model,
|
||||||
|
child: model.searchList.isNotEmpty
|
||||||
|
? Container(
|
||||||
|
height: MediaQuery.of(context).size.height * 0.80,
|
||||||
|
child: GridView.builder(
|
||||||
|
//physics: NeverScrollableScrollPhysics(),
|
||||||
|
gridDelegate:
|
||||||
|
SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
crossAxisCount: 2,
|
||||||
|
crossAxisSpacing: 0.5,
|
||||||
|
mainAxisSpacing: 2.0,
|
||||||
|
childAspectRatio: 1.0,
|
||||||
|
),
|
||||||
|
itemCount: model.searchList.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return Card(
|
||||||
|
color: model.searchList[index].discountName !=
|
||||||
|
null
|
||||||
|
? Color(0xffFFFF00)
|
||||||
|
: Colors.white,
|
||||||
|
elevation: 0,
|
||||||
|
shape: Border(
|
||||||
|
right: BorderSide(
|
||||||
|
color: Colors.grey.shade300,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
left: BorderSide(
|
||||||
|
color: Colors.grey.shade300,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
bottom: BorderSide(
|
||||||
|
color: Colors.grey.shade300,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
top: BorderSide(
|
||||||
|
color: Colors.grey.shade300,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
margin: EdgeInsets.symmetric(
|
||||||
|
horizontal: 8,
|
||||||
|
vertical: 4,
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(110.0),
|
||||||
|
),
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
padding:
|
||||||
|
EdgeInsets.symmetric(horizontal: 0),
|
||||||
|
width:
|
||||||
|
MediaQuery.of(context).size.width / 3,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Stack(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.fromLTRB(
|
||||||
|
0, 16, 0, 0),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Image.network(
|
||||||
|
model.searchList[index].images
|
||||||
|
.isNotEmpty
|
||||||
|
? model.searchList[index]
|
||||||
|
.images[0].thumb
|
||||||
|
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
height: 80,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: model.searchList[index]
|
||||||
|
.rxMessage !=
|
||||||
|
null
|
||||||
|
? MediaQuery.of(context)
|
||||||
|
.size
|
||||||
|
.width /
|
||||||
|
5
|
||||||
|
: 0,
|
||||||
|
padding: EdgeInsets.all(4),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xffb23838),
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft:
|
||||||
|
Radius.circular(6)),
|
||||||
|
),
|
||||||
|
child: Texts(
|
||||||
|
model.searchList[index]
|
||||||
|
.rxMessage !=
|
||||||
|
null
|
||||||
|
? model.searchList[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: [
|
||||||
|
Texts(
|
||||||
|
model.searchList[index].name,
|
||||||
|
regular: true,
|
||||||
|
fontSize: 12,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: const EdgeInsets.only(
|
||||||
|
top: 4, bottom: 4),
|
||||||
|
child: Texts(
|
||||||
|
"SAR ${model.searchList[index].price}",
|
||||||
|
bold: true,
|
||||||
|
fontSize: 14,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
StarRating(
|
||||||
|
totalAverage: model
|
||||||
|
.searchList[
|
||||||
|
index]
|
||||||
|
.approvedRatingSum >
|
||||||
|
0
|
||||||
|
? (model
|
||||||
|
.searchList[
|
||||||
|
index]
|
||||||
|
.approvedRatingSum
|
||||||
|
.toDouble() /
|
||||||
|
model
|
||||||
|
.searchList[
|
||||||
|
index]
|
||||||
|
.approvedRatingSum
|
||||||
|
.toDouble())
|
||||||
|
.toDouble()
|
||||||
|
: 0,
|
||||||
|
forceStars: true),
|
||||||
|
Texts(
|
||||||
|
"(${model.searchList[index].approvedTotalReviews})",
|
||||||
|
regular: true,
|
||||||
|
fontSize: 10,
|
||||||
|
fontWeight: FontWeight.w400,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Texts(msg),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
searchMedicine(PharmacyCategoriseViewModel model, BuildContext context) {
|
||||||
|
Utils.hideKeyboard(context);
|
||||||
|
if (_formKey.currentState.validate())
|
||||||
|
model.searchProducts(productName: textController.text);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,944 @@
|
|||||||
|
import 'package:diplomaticquarterapp/core/viewModels/pharmacy_categorise_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/buttons/button.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/StarRating.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_pharmacy_widget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/network_base_view.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
import 'base/base_view.dart';
|
||||||
|
import 'final_products_page.dart';
|
||||||
|
|
||||||
|
class SubCategorisePage extends StatefulWidget {
|
||||||
|
String id;
|
||||||
|
String title;
|
||||||
|
String parentId;
|
||||||
|
|
||||||
|
SubCategorisePage({this.id, this.parentId, this.title});
|
||||||
|
@override
|
||||||
|
_SubCategorisePageState createState() =>
|
||||||
|
_SubCategorisePageState(id: id, title: title, parentId: parentId);
|
||||||
|
}
|
||||||
|
|
||||||
|
class _SubCategorisePageState extends State<SubCategorisePage> {
|
||||||
|
bool checkedBrands = false;
|
||||||
|
bool checkedCategorise = false;
|
||||||
|
String id;
|
||||||
|
String title;
|
||||||
|
String parentId;
|
||||||
|
_SubCategorisePageState({this.title, this.parentId, this.id});
|
||||||
|
String categoriseName = "Personal Care";
|
||||||
|
bool styleOne = true;
|
||||||
|
bool styleTwo = false;
|
||||||
|
Icon styleIcon = Icon(
|
||||||
|
Icons.widgets_sharp,
|
||||||
|
color: Colors.blue,
|
||||||
|
size: 29.0,
|
||||||
|
);
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BaseView<PharmacyCategoriseViewModel>(
|
||||||
|
onModelReady: (model) => model.getSubCategorise(i: id),
|
||||||
|
builder: (BuildContext context, PharmacyCategoriseViewModel model,
|
||||||
|
Widget child) =>
|
||||||
|
PharmacyAppScaffold(
|
||||||
|
appBarTitle: title,
|
||||||
|
isBottomBar: false,
|
||||||
|
isShowAppBar: true,
|
||||||
|
backgroundColor: Colors.white,
|
||||||
|
isShowDecPage: false,
|
||||||
|
baseViewModel: model,
|
||||||
|
body: SingleChildScrollView(
|
||||||
|
child: Container(
|
||||||
|
height: MediaQuery.of(context).size.height * 5.97,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
child: Image.network(
|
||||||
|
parentId == '1'
|
||||||
|
? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089188_personal-care_2.png'
|
||||||
|
: parentId == '2'
|
||||||
|
? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089189_skin-care_2.png'
|
||||||
|
: parentId == '3'
|
||||||
|
? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089190_health-care_2.png'
|
||||||
|
: parentId == '4'
|
||||||
|
? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089191_sexual-health_2.png'
|
||||||
|
: parentId == '5'
|
||||||
|
? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089192_beauty_2.png'
|
||||||
|
: parentId == '6'
|
||||||
|
? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089193_baby-child_2.png'
|
||||||
|
: parentId == '7'
|
||||||
|
? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089194_vitamins-supplements_2.png'
|
||||||
|
: parentId == '8'
|
||||||
|
? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089195_diet-nutrition_2.png'
|
||||||
|
: parentId == '9'
|
||||||
|
? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089196_household_2.png'
|
||||||
|
: parentId ==
|
||||||
|
'10'
|
||||||
|
? 'https://uat.hmgwebservices.com/epharmacy/content/images/thumbs/0089197_home-care-appliances_2.png'
|
||||||
|
: '',
|
||||||
|
fit: BoxFit.fill,
|
||||||
|
height: 160.0,
|
||||||
|
width: double.infinity),
|
||||||
|
),
|
||||||
|
if (model.subCategorise.length > 8)
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
InkWell(
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.all(10.0),
|
||||||
|
child: Container(
|
||||||
|
child: Texts('View All Categories'),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Icon(Icons.arrow_forward)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
showModalBottomSheet<void>(
|
||||||
|
isScrollControlled: true,
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return Container(
|
||||||
|
height:
|
||||||
|
MediaQuery.of(context).size.height *
|
||||||
|
0.89,
|
||||||
|
color: Colors.white,
|
||||||
|
child: Center(
|
||||||
|
child: ListView.builder(
|
||||||
|
scrollDirection: Axis.vertical,
|
||||||
|
itemCount:
|
||||||
|
model.subCategorise.length,
|
||||||
|
itemBuilder: (BuildContext context,
|
||||||
|
int index) {
|
||||||
|
return Container(
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.all(8.0),
|
||||||
|
child: InkWell(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment
|
||||||
|
.start,
|
||||||
|
children: [
|
||||||
|
Texts(model
|
||||||
|
.subCategorise[
|
||||||
|
index]
|
||||||
|
.name),
|
||||||
|
Divider(
|
||||||
|
thickness: 0.6,
|
||||||
|
color: Colors.black12,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) =>
|
||||||
|
FinalProductsPage(
|
||||||
|
id: model
|
||||||
|
.subCategorise[
|
||||||
|
index]
|
||||||
|
.id,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
Divider(
|
||||||
|
thickness: 1.0,
|
||||||
|
color: Colors.grey.shade400,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
|
||||||
|
//Expanded widget heree if nassery
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.only(top: 35.0),
|
||||||
|
child: Container(
|
||||||
|
height: MediaQuery.of(context).size.height * 0.2,
|
||||||
|
child: Center(
|
||||||
|
child: ListView.builder(
|
||||||
|
scrollDirection: Axis.horizontal,
|
||||||
|
itemCount: model.subCategorise.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return Padding(
|
||||||
|
padding:
|
||||||
|
EdgeInsets.symmetric(horizontal: 8.0),
|
||||||
|
child: InkWell(
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.center,
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 13.0),
|
||||||
|
child: Container(
|
||||||
|
height: 60.0,
|
||||||
|
width: 65.0,
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
shape: BoxShape.circle,
|
||||||
|
color: Colors.orange.shade200
|
||||||
|
.withOpacity(0.45),
|
||||||
|
),
|
||||||
|
child: Center(
|
||||||
|
child: Icon(
|
||||||
|
Icons.apps_sharp,
|
||||||
|
size: 32.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: MediaQuery.of(context)
|
||||||
|
.size
|
||||||
|
.width *
|
||||||
|
0.17,
|
||||||
|
height: MediaQuery.of(context)
|
||||||
|
.size
|
||||||
|
.height *
|
||||||
|
0.10,
|
||||||
|
child: Center(
|
||||||
|
child: Texts(
|
||||||
|
model.subCategorise[index].name,
|
||||||
|
fontSize: 14,
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
maxLines: 2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(
|
||||||
|
builder: (context) =>
|
||||||
|
FinalProductsPage(
|
||||||
|
id: model.subCategorise[index].id,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
Divider(
|
||||||
|
thickness: 1.0,
|
||||||
|
color: Colors.grey.shade400,
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 8.0),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||||
|
children: [
|
||||||
|
InkWell(
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Icon(Icons.wrap_text),
|
||||||
|
SizedBox(
|
||||||
|
width: 10.0,
|
||||||
|
),
|
||||||
|
Texts(
|
||||||
|
'Refine',
|
||||||
|
fontWeight: FontWeight.w600,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
showModalBottomSheet<void>(
|
||||||
|
isScrollControlled: true,
|
||||||
|
context: context,
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return DraggableScrollableSheet(
|
||||||
|
initialChildSize: 0.95,
|
||||||
|
maxChildSize: 0.95,
|
||||||
|
minChildSize: 0.9,
|
||||||
|
builder: (BuildContext context,
|
||||||
|
ScrollController scrollController) {
|
||||||
|
return SingleChildScrollView(
|
||||||
|
controller: scrollController,
|
||||||
|
child: Container(
|
||||||
|
height: MediaQuery.of(context)
|
||||||
|
.size
|
||||||
|
.height *
|
||||||
|
1.95,
|
||||||
|
child: Column(
|
||||||
|
children: [
|
||||||
|
Padding(
|
||||||
|
padding:
|
||||||
|
EdgeInsets.all(8.0),
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Icon(
|
||||||
|
Icons.wrap_text,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 10.0,
|
||||||
|
),
|
||||||
|
Texts(
|
||||||
|
'Refine',
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w600,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 250.0,
|
||||||
|
),
|
||||||
|
InkWell(
|
||||||
|
child: Texts(
|
||||||
|
'Close',
|
||||||
|
color: Colors.red,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w600,
|
||||||
|
fontSize: 15.0,
|
||||||
|
),
|
||||||
|
onTap: () {
|
||||||
|
Navigator.pop(
|
||||||
|
context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Divider(
|
||||||
|
thickness: 1.0,
|
||||||
|
color: Colors.black12,
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
ExpansionTile(
|
||||||
|
title:
|
||||||
|
Texts('Categorise'),
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
height: 350,
|
||||||
|
child: ListView
|
||||||
|
.builder(
|
||||||
|
controller:
|
||||||
|
scrollController,
|
||||||
|
scrollDirection:
|
||||||
|
Axis
|
||||||
|
.vertical,
|
||||||
|
shrinkWrap:
|
||||||
|
true,
|
||||||
|
itemCount: model
|
||||||
|
.categoriseParent
|
||||||
|
.length,
|
||||||
|
itemBuilder:
|
||||||
|
(BuildContext
|
||||||
|
context,
|
||||||
|
int index) {
|
||||||
|
return CheckboxListTile(
|
||||||
|
tristate:
|
||||||
|
true,
|
||||||
|
title: Texts(model
|
||||||
|
.categoriseParent[index]
|
||||||
|
.name),
|
||||||
|
controlAffinity:
|
||||||
|
ListTileControlAffinity.leading,
|
||||||
|
value:
|
||||||
|
checkedCategorise,
|
||||||
|
onChanged:
|
||||||
|
(bool
|
||||||
|
value) {
|
||||||
|
setState(
|
||||||
|
() {
|
||||||
|
checkedCategorise =
|
||||||
|
value;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Divider(
|
||||||
|
thickness: 1.0,
|
||||||
|
color: Colors.black12,
|
||||||
|
),
|
||||||
|
ExpansionTile(
|
||||||
|
title: Texts('Brands'),
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
height: 350,
|
||||||
|
child: ListView
|
||||||
|
.builder(
|
||||||
|
scrollDirection:
|
||||||
|
Axis
|
||||||
|
.vertical,
|
||||||
|
shrinkWrap:
|
||||||
|
true,
|
||||||
|
itemCount: model
|
||||||
|
.brandsList
|
||||||
|
.length,
|
||||||
|
itemBuilder:
|
||||||
|
(BuildContext
|
||||||
|
context,
|
||||||
|
int index) {
|
||||||
|
return CheckboxListTile(
|
||||||
|
tristate:
|
||||||
|
true,
|
||||||
|
title: Texts(model
|
||||||
|
.brandsList[index]
|
||||||
|
.name),
|
||||||
|
controlAffinity:
|
||||||
|
ListTileControlAffinity.leading,
|
||||||
|
value:
|
||||||
|
checkedBrands,
|
||||||
|
onChanged:
|
||||||
|
(bool
|
||||||
|
value) {
|
||||||
|
setState(
|
||||||
|
() {
|
||||||
|
checkedBrands =
|
||||||
|
value;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
autofocus:
|
||||||
|
true,
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Divider(
|
||||||
|
thickness: 1.0,
|
||||||
|
color: Colors.black12,
|
||||||
|
),
|
||||||
|
ExpansionTile(
|
||||||
|
title: Texts('Price'),
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
color: Color(
|
||||||
|
0xffEEEEEE),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment
|
||||||
|
.spaceAround,
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment
|
||||||
|
.start,
|
||||||
|
children: [
|
||||||
|
Texts(
|
||||||
|
'Min'),
|
||||||
|
Container(
|
||||||
|
color: Colors
|
||||||
|
.white,
|
||||||
|
width:
|
||||||
|
200,
|
||||||
|
height:
|
||||||
|
40,
|
||||||
|
child:
|
||||||
|
TextFormField(
|
||||||
|
decoration:
|
||||||
|
InputDecoration(
|
||||||
|
border:
|
||||||
|
OutlineInputBorder(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment
|
||||||
|
.start,
|
||||||
|
children: [
|
||||||
|
Texts(
|
||||||
|
'Max'),
|
||||||
|
Container(
|
||||||
|
color: Colors
|
||||||
|
.white,
|
||||||
|
width:
|
||||||
|
200,
|
||||||
|
height:
|
||||||
|
40,
|
||||||
|
child:
|
||||||
|
TextFormField(
|
||||||
|
decoration:
|
||||||
|
InputDecoration(
|
||||||
|
border:
|
||||||
|
OutlineInputBorder(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Divider(
|
||||||
|
thickness: 1.0,
|
||||||
|
color: Colors.black12,
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: MediaQuery.of(
|
||||||
|
context)
|
||||||
|
.size
|
||||||
|
.height *
|
||||||
|
0.4,
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding:
|
||||||
|
EdgeInsets.all(8.0),
|
||||||
|
child: Row(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment
|
||||||
|
.spaceEvenly,
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: 100,
|
||||||
|
child: Button(
|
||||||
|
label: 'Reset',
|
||||||
|
backgroundColor:
|
||||||
|
Colors.red,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
width: 30,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: 200,
|
||||||
|
child: Button(
|
||||||
|
label: 'Apply',
|
||||||
|
backgroundColor:
|
||||||
|
Colors
|
||||||
|
.green,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
height: 44.0,
|
||||||
|
child: VerticalDivider(
|
||||||
|
color: Colors.black45,
|
||||||
|
thickness: 1.0,
|
||||||
|
//width: 0.3,
|
||||||
|
// indent: 0.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding: EdgeInsets.all(8.0),
|
||||||
|
child: InkWell(
|
||||||
|
child: styleIcon,
|
||||||
|
onTap: () {
|
||||||
|
setState(() {
|
||||||
|
if (styleOne == true) {
|
||||||
|
styleOne = false;
|
||||||
|
styleTwo = true;
|
||||||
|
styleIcon = Icon(
|
||||||
|
Icons.auto_awesome_mosaic,
|
||||||
|
color: Colors.blue,
|
||||||
|
size: 29.0,
|
||||||
|
);
|
||||||
|
} else {
|
||||||
|
styleOne = true;
|
||||||
|
styleTwo = false;
|
||||||
|
styleIcon = Icon(
|
||||||
|
Icons.widgets_sharp,
|
||||||
|
color: Colors.blue,
|
||||||
|
size: 29.0,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Divider(
|
||||||
|
thickness: 1.0,
|
||||||
|
color: Colors.grey.shade400,
|
||||||
|
),
|
||||||
|
styleOne == true
|
||||||
|
? Container(
|
||||||
|
height: MediaQuery.of(context).size.height * 3.85,
|
||||||
|
child: GridView.builder(
|
||||||
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
gridDelegate:
|
||||||
|
SliverGridDelegateWithFixedCrossAxisCount(
|
||||||
|
crossAxisCount: 2,
|
||||||
|
crossAxisSpacing: 0.5,
|
||||||
|
mainAxisSpacing: 2.0,
|
||||||
|
childAspectRatio: 1.0,
|
||||||
|
),
|
||||||
|
itemCount: model.subProducts.length,
|
||||||
|
itemBuilder: (BuildContext context, int index) {
|
||||||
|
return NetworkBaseView(
|
||||||
|
baseViewModel: model,
|
||||||
|
child: Card(
|
||||||
|
color: model.subProducts[index]
|
||||||
|
.discountName !=
|
||||||
|
null
|
||||||
|
? Color(0xffFFFF00)
|
||||||
|
: Colors.white,
|
||||||
|
elevation: 0,
|
||||||
|
shape: Border(
|
||||||
|
right: BorderSide(
|
||||||
|
color: Colors.grey.shade300,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
left: BorderSide(
|
||||||
|
color: Colors.grey.shade300,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
bottom: BorderSide(
|
||||||
|
color: Colors.grey.shade300,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
top: BorderSide(
|
||||||
|
color: Colors.grey.shade300,
|
||||||
|
width: 1,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
margin: EdgeInsets.symmetric(
|
||||||
|
horizontal: 8,
|
||||||
|
vertical: 4,
|
||||||
|
),
|
||||||
|
child: Container(
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
borderRadius: BorderRadius.only(
|
||||||
|
topLeft: Radius.circular(110.0),
|
||||||
|
),
|
||||||
|
color: Colors.white,
|
||||||
|
),
|
||||||
|
padding: EdgeInsets.symmetric(
|
||||||
|
horizontal: 0),
|
||||||
|
width: MediaQuery.of(context)
|
||||||
|
.size
|
||||||
|
.width /
|
||||||
|
3,
|
||||||
|
child: Column(
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
Stack(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.fromLTRB(
|
||||||
|
0, 16, 0, 0),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Image.network(
|
||||||
|
model.subProducts[index]
|
||||||
|
.images.isNotEmpty
|
||||||
|
? model
|
||||||
|
.subProducts[
|
||||||
|
index]
|
||||||
|
.images[0]
|
||||||
|
.thumb
|
||||||
|
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
|
||||||
|
fit: BoxFit.cover,
|
||||||
|
height: 80,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
width: model
|
||||||
|
.subProducts[
|
||||||
|
index]
|
||||||
|
.rxMessage !=
|
||||||
|
null
|
||||||
|
? MediaQuery.of(context)
|
||||||
|
.size
|
||||||
|
.width /
|
||||||
|
5
|
||||||
|
: 0,
|
||||||
|
padding: EdgeInsets.all(4),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xffb23838),
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.only(
|
||||||
|
topLeft: Radius
|
||||||
|
.circular(6)),
|
||||||
|
),
|
||||||
|
child: Texts(
|
||||||
|
model.subProducts[index]
|
||||||
|
.rxMessage !=
|
||||||
|
null
|
||||||
|
? model
|
||||||
|
.subProducts[
|
||||||
|
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: [
|
||||||
|
Texts(
|
||||||
|
model.subProducts[index]
|
||||||
|
.name,
|
||||||
|
regular: true,
|
||||||
|
fontSize: 12,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w400,
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.only(
|
||||||
|
top: 4,
|
||||||
|
bottom: 4),
|
||||||
|
child: Texts(
|
||||||
|
"SAR ${model.subProducts[index].price}",
|
||||||
|
bold: true,
|
||||||
|
fontSize: 14,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
StarRating(
|
||||||
|
totalAverage: model
|
||||||
|
.subProducts[
|
||||||
|
index]
|
||||||
|
.approvedRatingSum >
|
||||||
|
0
|
||||||
|
? (model.subProducts[index].approvedRatingSum
|
||||||
|
.toDouble() /
|
||||||
|
model
|
||||||
|
.subProducts[index]
|
||||||
|
.approvedRatingSum
|
||||||
|
.toDouble())
|
||||||
|
.toDouble()
|
||||||
|
: 0,
|
||||||
|
forceStars: true),
|
||||||
|
Texts(
|
||||||
|
"(${model.subProducts[index].approvedTotalReviews})",
|
||||||
|
regular: true,
|
||||||
|
fontSize: 10,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w400,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
},
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: Container(
|
||||||
|
height: MediaQuery.of(context).size.height * 5.0,
|
||||||
|
child: ListView.builder(
|
||||||
|
physics: NeverScrollableScrollPhysics(),
|
||||||
|
itemCount: model.subProducts.length,
|
||||||
|
itemBuilder:
|
||||||
|
(BuildContext context, int index) {
|
||||||
|
return Card(
|
||||||
|
child: Row(
|
||||||
|
children: [
|
||||||
|
Stack(
|
||||||
|
children: [
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
decoration: BoxDecoration(),
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.only(
|
||||||
|
left: 9.0,
|
||||||
|
top: 8.0,
|
||||||
|
right: 10.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
margin: EdgeInsets.fromLTRB(
|
||||||
|
0, 0, 0, 0),
|
||||||
|
alignment: Alignment.center,
|
||||||
|
child: Image.network(
|
||||||
|
model.subProducts[index]
|
||||||
|
.images.isNotEmpty
|
||||||
|
? model
|
||||||
|
.subProducts[
|
||||||
|
index]
|
||||||
|
.images[0]
|
||||||
|
.thumb
|
||||||
|
: 'https://upload.wikimedia.org/wikipedia/commons/thumb/6/6c/No_image_3x4.svg/1200px-No_image_3x4.svg.png',
|
||||||
|
fit: BoxFit.contain,
|
||||||
|
height: 80,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Column(
|
||||||
|
children: [
|
||||||
|
Container(
|
||||||
|
width: model
|
||||||
|
.subProducts[
|
||||||
|
index]
|
||||||
|
.rxMessage !=
|
||||||
|
null
|
||||||
|
? MediaQuery.of(context)
|
||||||
|
.size
|
||||||
|
.width /
|
||||||
|
5
|
||||||
|
: 0,
|
||||||
|
padding: EdgeInsets.all(4),
|
||||||
|
decoration: BoxDecoration(
|
||||||
|
color: Color(0xffb23838),
|
||||||
|
borderRadius:
|
||||||
|
BorderRadius.only(
|
||||||
|
topLeft: Radius
|
||||||
|
.circular(6)),
|
||||||
|
),
|
||||||
|
child: Texts(
|
||||||
|
model.subProducts[index]
|
||||||
|
.rxMessage !=
|
||||||
|
null
|
||||||
|
? model
|
||||||
|
.subProducts[
|
||||||
|
index]
|
||||||
|
.rxMessage
|
||||||
|
: "",
|
||||||
|
color: Colors.white,
|
||||||
|
regular: true,
|
||||||
|
fontSize: 10,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w400,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: 100.0,
|
||||||
|
margin: EdgeInsets.symmetric(
|
||||||
|
horizontal: 6,
|
||||||
|
vertical: 0,
|
||||||
|
),
|
||||||
|
child: Column(
|
||||||
|
mainAxisAlignment:
|
||||||
|
MainAxisAlignment.spaceAround,
|
||||||
|
crossAxisAlignment:
|
||||||
|
CrossAxisAlignment.start,
|
||||||
|
children: [
|
||||||
|
SizedBox(
|
||||||
|
height: 4.0,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
height: 35.0,
|
||||||
|
width: 250.0,
|
||||||
|
child: Texts(
|
||||||
|
model.subProducts[index]
|
||||||
|
.name,
|
||||||
|
regular: true,
|
||||||
|
fontSize: 13.2,
|
||||||
|
fontWeight: FontWeight.w500,
|
||||||
|
maxLines: 2,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 8.0,
|
||||||
|
),
|
||||||
|
Padding(
|
||||||
|
padding:
|
||||||
|
const EdgeInsets.only(
|
||||||
|
top: 4, bottom: 4),
|
||||||
|
child: Texts(
|
||||||
|
"SAR ${model.subProducts[index].price}",
|
||||||
|
bold: true,
|
||||||
|
fontSize: 14,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
StarRating(
|
||||||
|
totalAverage: model
|
||||||
|
.subProducts[
|
||||||
|
index]
|
||||||
|
.approvedRatingSum >
|
||||||
|
0
|
||||||
|
? (model
|
||||||
|
.subProducts[
|
||||||
|
index]
|
||||||
|
.approvedRatingSum
|
||||||
|
.toDouble() /
|
||||||
|
model
|
||||||
|
.parentProducts[
|
||||||
|
index]
|
||||||
|
.approvedRatingSum
|
||||||
|
.toDouble())
|
||||||
|
.toDouble()
|
||||||
|
: 0,
|
||||||
|
forceStars: true),
|
||||||
|
Texts(
|
||||||
|
"(${model.subProducts[index].approvedTotalReviews})",
|
||||||
|
regular: true,
|
||||||
|
fontSize: 10,
|
||||||
|
fontWeight:
|
||||||
|
FontWeight.w400,
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,73 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/pharmacy/brandModel.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/pharmacy/topBrandsModel.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||||
|
|
||||||
|
class BrandsService extends BaseService {
|
||||||
|
AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||||
|
bool isLogin = false;
|
||||||
|
|
||||||
|
List<Brand> _brandsList = List();
|
||||||
|
List<Brand> get brandsList => _brandsList;
|
||||||
|
|
||||||
|
List<TopBrand> _topBrandsList = List();
|
||||||
|
List<TopBrand> get topBrandsList => _topBrandsList;
|
||||||
|
|
||||||
|
List<Brand> _searchList = List();
|
||||||
|
List<Brand> get searchList => _searchList;
|
||||||
|
|
||||||
|
clearSearchList() {
|
||||||
|
_searchList.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getBrands() async {
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.getPharmacy(GET_BRANDS,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
_brandsList.clear();
|
||||||
|
response['manufacturer'].forEach((item) {
|
||||||
|
_brandsList.add(Brand.fromJson(item));
|
||||||
|
});
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getTopBrands() async {
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.getPharmacy(GET_TOP_BRANDS,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
_topBrandsList.clear();
|
||||||
|
response['manufacturer'].forEach((item) {
|
||||||
|
_topBrandsList.add(TopBrand.fromJson(item));
|
||||||
|
});
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future searchProducts({String productName}) async {
|
||||||
|
RegExp exp = new RegExp(productName.toUpperCase());
|
||||||
|
hasError = false;
|
||||||
|
_searchList.clear();
|
||||||
|
await baseAppClient.getPharmacy(
|
||||||
|
GET_BRANDS,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
response['manufacturer'].forEach((item) {
|
||||||
|
if(exp.hasMatch(item['name'])){
|
||||||
|
_searchList.add(Brand.fromJson(item));
|
||||||
|
}else{
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
|
onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
},
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,39 @@
|
|||||||
|
|
||||||
|
import 'package:diplomaticquarterapp/config/config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/model/pharmacies/order_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
||||||
|
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
|
||||||
|
class CancelOrderService extends BaseService{
|
||||||
|
AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||||
|
AppGlobal appGlobal = new AppGlobal();
|
||||||
|
|
||||||
|
AuthenticatedUser authUser = new AuthenticatedUser();
|
||||||
|
AuthProvider authProvider = new AuthProvider();
|
||||||
|
|
||||||
|
List<OrderModel> get orderDetails => orderDetails;
|
||||||
|
List<OrderModel> _orderList = List();
|
||||||
|
List<OrderModel> get orderList => _orderList;
|
||||||
|
String url ="";
|
||||||
|
|
||||||
|
|
||||||
|
Future cancelOrderDetail(order) async {
|
||||||
|
print("step 1");
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.getPharmacy(GET_Cancel_ORDER+order,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
_orderList.clear();
|
||||||
|
response['orders'].forEach((item) {
|
||||||
|
_orderList.add(OrderModel.fromJson(item));
|
||||||
|
});
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,178 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/pharmacy/Wishlist.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/pharmacy/addToCartModel.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/pharmacy/locationModel.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/pharmacy/productDetailModel.dart';
|
||||||
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/app_toast.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/pharmacy/specification.dart';
|
||||||
|
|
||||||
|
class ProductDetailService extends BaseService {
|
||||||
|
bool isLogin = false;
|
||||||
|
|
||||||
|
List<ProductDetail> _productDetailList = List();
|
||||||
|
List<ProductDetail> get productDetailList => _productDetailList;
|
||||||
|
|
||||||
|
List<LocationModel> _productLocationList = List();
|
||||||
|
List<LocationModel> get productLocationList => _productLocationList;
|
||||||
|
|
||||||
|
List<Wishlist> _addToCartModel = List();
|
||||||
|
List<Wishlist> get addToCartModel => _addToCartModel;
|
||||||
|
|
||||||
|
List<Wishlist> _wishListProducts = List();
|
||||||
|
List<Wishlist> get wishListProducts => _wishListProducts;
|
||||||
|
|
||||||
|
List<SpecificationModel> _productSpecification = List();
|
||||||
|
List<SpecificationModel> get productSpecification => _productSpecification;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
Future getProductReviews(productID) async {
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.getPharmacy(GET_PRODUCT_DETAIL+productID+"?fields=reviews",
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
_productDetailList.clear();
|
||||||
|
response['products'].forEach((item) {
|
||||||
|
_productDetailList.add(ProductDetail.fromJson(item));
|
||||||
|
print(response);
|
||||||
|
});
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getProductAvailabiltyDetail() async {
|
||||||
|
hasError = false;
|
||||||
|
Map<String, dynamic> request;
|
||||||
|
|
||||||
|
request = {
|
||||||
|
"Channel": 3,
|
||||||
|
"DeviceTypeID": 2,
|
||||||
|
"IPAdress": "10.20.10.20",
|
||||||
|
"LanguageID": 2,
|
||||||
|
"PatientOutSA": 0,
|
||||||
|
"SKU": "6720020025",
|
||||||
|
"SessionID": null,
|
||||||
|
"VersionID": 5.6,
|
||||||
|
"generalid": "Cs2020@2016\$2958",
|
||||||
|
"isDentalAllowedBackend": false
|
||||||
|
};
|
||||||
|
await baseAppClient.post(GET_LOCATION,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
_productLocationList.clear();
|
||||||
|
response['PharmList'].forEach((item) {
|
||||||
|
_productLocationList.add(LocationModel.fromJson(item));
|
||||||
|
print(_productLocationList);
|
||||||
|
print(response);
|
||||||
|
});
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
}, body: request);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future addToCart(quantity, itemID) async {
|
||||||
|
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
|
||||||
|
hasError = false;
|
||||||
|
Map<String, dynamic> request;
|
||||||
|
|
||||||
|
request = {
|
||||||
|
"shopping_cart_item":
|
||||||
|
{
|
||||||
|
"quantity": quantity,
|
||||||
|
"shopping_cart_type": "1",
|
||||||
|
"product_id": itemID,
|
||||||
|
"customer_id": customerId,
|
||||||
|
"language_id": 1
|
||||||
|
}
|
||||||
|
};
|
||||||
|
await baseAppClient.post(GET_SHOPPING_CART,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
_addToCartModel.clear();
|
||||||
|
response['shopping_carts'].forEach((item) {
|
||||||
|
_addToCartModel.add(Wishlist.fromJson(item));
|
||||||
|
});
|
||||||
|
AppToast.showSuccessToast(message: 'You have added a product to the cart');
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
AppToast.showErrorToast(message: 'something went wrong please try again');
|
||||||
|
}, body: request);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future addToWishlist(itemID) async {
|
||||||
|
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
|
||||||
|
hasError = false;
|
||||||
|
Map<String, dynamic> request;
|
||||||
|
|
||||||
|
request = {
|
||||||
|
"shopping_cart_item":
|
||||||
|
{
|
||||||
|
"quantity": 1,
|
||||||
|
"shopping_cart_type": "Wishlist",
|
||||||
|
"product_id": itemID,
|
||||||
|
"customer_id": customerId,
|
||||||
|
"language_id": 1
|
||||||
|
}
|
||||||
|
};
|
||||||
|
await baseAppClient.post(GET_SHOPPING_CART,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
_wishListProducts.clear();
|
||||||
|
response['shopping_carts'].forEach((item) {
|
||||||
|
_wishListProducts.add(Wishlist.fromJson(item));
|
||||||
|
AppToast.showSuccessToast(message: 'You have added a product to the Wishlist');
|
||||||
|
});
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
AppToast.showErrorToast(message: 'something went wrong please try again');
|
||||||
|
}, body: request);
|
||||||
|
}
|
||||||
|
|
||||||
|
Future getWishlistItems() async {
|
||||||
|
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.getPharmacy(GET_WISHLIST+customerId+"?shopping_cart_type=2",
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
_wishListProducts.clear();
|
||||||
|
response['shopping_carts'].forEach((item) {
|
||||||
|
_wishListProducts.add(Wishlist.fromJson(item));
|
||||||
|
});
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
Future delteItemFromWishlist(itemID) async {
|
||||||
|
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.getPharmacy(DELETE_WISHLIST+customerId+"+&product_id="+itemID+"&cart_type=Wishlist",
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
_wishListProducts.clear();
|
||||||
|
response['shopping_carts'].forEach((item) {
|
||||||
|
_wishListProducts.add(Wishlist.fromJson(item));
|
||||||
|
});
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
Future productSpecificationData(itemID) async {
|
||||||
|
hasError = false;
|
||||||
|
|
||||||
|
await baseAppClient.getPharmacy(GET_SPECIFICATION+itemID,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
_productSpecification.clear();
|
||||||
|
response['specification'].forEach((item) {
|
||||||
|
_productSpecification.add(SpecificationModel.fromJson(item));
|
||||||
|
});
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,38 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/Authentication/authenticated_user.dart';
|
||||||
|
import 'package:diplomaticquarterapp/models/pharmacy/reviewModel.dart';
|
||||||
|
import 'package:diplomaticquarterapp/services/authentication/auth_provider.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||||
|
import 'package:diplomaticquarterapp/config/shared_pref_kay.dart';
|
||||||
|
|
||||||
|
|
||||||
|
class ReviewService extends BaseService {
|
||||||
|
AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||||
|
|
||||||
|
AuthenticatedUser authUser = new AuthenticatedUser();
|
||||||
|
AuthProvider authProvider = new AuthProvider();
|
||||||
|
|
||||||
|
bool isLogin = false;
|
||||||
|
List<Review> _reviewList = List();
|
||||||
|
List<Review> get reviewList => _reviewList;
|
||||||
|
|
||||||
|
|
||||||
|
Future getReview() async {
|
||||||
|
|
||||||
|
var customerId = await sharedPref.getString(PHARMACY_CUSTOMER_ID);
|
||||||
|
|
||||||
|
hasError = false;
|
||||||
|
await baseAppClient.getPharmacy(GET_REVIEW+customerId,
|
||||||
|
onSuccess: (dynamic response, int statusCode) {
|
||||||
|
_reviewList.clear();
|
||||||
|
response['reviews'].forEach((item) {
|
||||||
|
_reviewList.add(Review.fromJson(item));
|
||||||
|
});
|
||||||
|
}, onFailure: (String error, int statusCode) {
|
||||||
|
hasError = true;
|
||||||
|
super.error = error;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@ -0,0 +1,114 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/routes.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/robo-search/robosearch.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/robo-search/search.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
import '../../locator.dart';
|
||||||
|
import 'floating_button_search.dart';
|
||||||
|
import '../progress_indicator/app_loader_widget.dart';
|
||||||
|
import 'arrow_back.dart';
|
||||||
|
import 'network_base_view.dart';
|
||||||
|
import 'not_auh_page.dart';
|
||||||
|
|
||||||
|
class PharmacyAppScaffold extends StatelessWidget {
|
||||||
|
final String appBarTitle;
|
||||||
|
final Widget body;
|
||||||
|
final Widget bottomSheet;
|
||||||
|
final bool isLoading;
|
||||||
|
final bool isShowAppBar;
|
||||||
|
final bool hasAppBarParam;
|
||||||
|
final BaseViewModel baseViewModel;
|
||||||
|
final bool isBottomBar;
|
||||||
|
final Widget floatingActionButton;
|
||||||
|
final String title;
|
||||||
|
final String description;
|
||||||
|
final bool isShowDecPage;
|
||||||
|
final Color backgroundColor;
|
||||||
|
|
||||||
|
AuthenticatedUserObject authenticatedUserObject =
|
||||||
|
locator<AuthenticatedUserObject>();
|
||||||
|
|
||||||
|
PharmacyAppScaffold(
|
||||||
|
{@required this.body,
|
||||||
|
this.appBarTitle = '',
|
||||||
|
this.isLoading = false,
|
||||||
|
this.isShowAppBar = false,
|
||||||
|
this.hasAppBarParam,
|
||||||
|
this.bottomSheet,
|
||||||
|
this.baseViewModel,
|
||||||
|
this.floatingActionButton,
|
||||||
|
this.title,
|
||||||
|
this.description,
|
||||||
|
this.isShowDecPage = true,
|
||||||
|
this.isBottomBar,
|
||||||
|
this.backgroundColor});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
AppGlobal.context = context;
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor:
|
||||||
|
backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
|
||||||
|
appBar: isShowAppBar
|
||||||
|
? AppBar(
|
||||||
|
elevation: 0,
|
||||||
|
backgroundColor: Color(0xff5AB145),
|
||||||
|
textTheme: TextTheme(
|
||||||
|
headline6:
|
||||||
|
TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
title: Text(authenticatedUserObject.isLogin
|
||||||
|
? appBarTitle.toUpperCase()
|
||||||
|
: TranslationBase.of(context).serviceInformationTitle),
|
||||||
|
leading: Builder(
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return ArrowBack();
|
||||||
|
},
|
||||||
|
),
|
||||||
|
centerTitle: true,
|
||||||
|
actions: <Widget>[],
|
||||||
|
)
|
||||||
|
: null,
|
||||||
|
body: (!authenticatedUserObject.isLogin && isShowDecPage)
|
||||||
|
? NotAutPage(
|
||||||
|
title: appBarTitle,
|
||||||
|
description: description,
|
||||||
|
)
|
||||||
|
: baseViewModel != null
|
||||||
|
? NetworkBaseView(
|
||||||
|
child: buildBodyWidget(),
|
||||||
|
baseViewModel: baseViewModel,
|
||||||
|
)
|
||||||
|
: buildBodyWidget(),
|
||||||
|
bottomSheet: bottomSheet,
|
||||||
|
floatingActionButton: floatingActionButton ?? floatingActionButton,
|
||||||
|
// bottomNavigationBar:
|
||||||
|
// this.isBottomBar == true ? BottomBarSearch() : SizedBox()
|
||||||
|
// floatingActionButton: FloatingSearchButton(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
buildAppLoaderWidget(bool isLoading) {
|
||||||
|
return isLoading ? AppLoaderWidget() : Container();
|
||||||
|
}
|
||||||
|
|
||||||
|
buildBodyWidget() {
|
||||||
|
// return body; //Stack(children: <Widget>[body, buildAppLoaderWidget(isLoading)]);
|
||||||
|
return Stack(children: <Widget>[
|
||||||
|
body, /*FloatingSearchButton()*/
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,241 @@
|
|||||||
|
import 'package:diplomaticquarterapp/config/config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/config/size_config.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/service/AuthenticatedUserObject.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/core/viewModels/project_view_model.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/insurance/insurance_update_screen.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/routes.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/others/bottom_bar.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/progress_indicator/app_loader_widget.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/transitions/fade_page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/robo-search/robosearch.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/robo-search/search.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
import 'package:flutter_svg/flutter_svg.dart';
|
||||||
|
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||||
|
import 'package:provider/provider.dart';
|
||||||
|
|
||||||
|
import '../../locator.dart';
|
||||||
|
import 'floating_button_search.dart';
|
||||||
|
import '../progress_indicator/app_loader_widget.dart';
|
||||||
|
import 'arrow_back.dart';
|
||||||
|
import 'network_base_view.dart';
|
||||||
|
import 'not_auh_page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/pharmacies/product_detail.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/pharmacies/screens/cart-order-page.dart';
|
||||||
|
|
||||||
|
class DetailPageScafold extends StatefulWidget {
|
||||||
|
final String appBarTitle;
|
||||||
|
final Widget body;
|
||||||
|
final Widget bottomSheet;
|
||||||
|
final bool isLoading;
|
||||||
|
final bool isShowAppBar;
|
||||||
|
final bool hasAppBarParam;
|
||||||
|
final BaseViewModel baseViewModel;
|
||||||
|
final bool isBottomBar;
|
||||||
|
final Widget floatingActionButton;
|
||||||
|
final bool isPharmacy;
|
||||||
|
final String title;
|
||||||
|
final String description;
|
||||||
|
final String image;
|
||||||
|
final bool isShowDecPage;
|
||||||
|
final List<String> infoList;
|
||||||
|
final Color backgroundColor;
|
||||||
|
final double preferredSize;
|
||||||
|
final List<Widget> appBarIcons;
|
||||||
|
final PreferredSizeWidget appBarWidget;
|
||||||
|
|
||||||
|
|
||||||
|
DetailPageScafold(
|
||||||
|
{@required this.body,
|
||||||
|
this.appBarTitle = '',
|
||||||
|
this.isLoading = false,
|
||||||
|
this.isShowAppBar = false,
|
||||||
|
this.hasAppBarParam,
|
||||||
|
this.bottomSheet,
|
||||||
|
this.baseViewModel,
|
||||||
|
this.floatingActionButton,
|
||||||
|
this.isPharmacy = false,
|
||||||
|
this.title,
|
||||||
|
this.description,
|
||||||
|
this.isShowDecPage = true,
|
||||||
|
this.isBottomBar,
|
||||||
|
this.backgroundColor,
|
||||||
|
this.preferredSize = 0.0,
|
||||||
|
this.appBarIcons,
|
||||||
|
this.appBarWidget,
|
||||||
|
this.image,
|
||||||
|
this.infoList});
|
||||||
|
|
||||||
|
@override
|
||||||
|
_DetailPageScafoldState createState() => _DetailPageScafoldState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _DetailPageScafoldState extends State<DetailPageScafold> {
|
||||||
|
AuthenticatedUserObject authenticatedUserObject =
|
||||||
|
locator<AuthenticatedUserObject>();
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
AppGlobal.context = context;
|
||||||
|
PreferredSizeWidget appBar;
|
||||||
|
|
||||||
|
if (this.widget.appBarWidget == null) {
|
||||||
|
PreferredSizeWidget appBarWidget = AppBarWidget(
|
||||||
|
widget.appBarTitle,
|
||||||
|
widget.appBarIcons,
|
||||||
|
widget.isShowAppBar,
|
||||||
|
isPharmacy: widget.isPharmacy,
|
||||||
|
isShowDecPage: widget.isShowDecPage,
|
||||||
|
image: widget.image,
|
||||||
|
);
|
||||||
|
appBar = widget.preferredSize == 0
|
||||||
|
? appBarWidget
|
||||||
|
: PreferredSize(
|
||||||
|
child: appBarWidget,
|
||||||
|
preferredSize: Size.fromHeight(widget.preferredSize));
|
||||||
|
} else {
|
||||||
|
appBar = this.widget.appBarWidget;
|
||||||
|
}
|
||||||
|
|
||||||
|
return Scaffold(
|
||||||
|
backgroundColor:
|
||||||
|
widget.backgroundColor ?? Theme.of(context).scaffoldBackgroundColor,
|
||||||
|
appBar: appBar,
|
||||||
|
body: (!Provider.of<ProjectViewModel>(context, listen: false).isLogin &&
|
||||||
|
widget.isShowDecPage)
|
||||||
|
? NotAutPage(
|
||||||
|
title: widget.appBarTitle,
|
||||||
|
description: widget.description,
|
||||||
|
infoList: widget.infoList,
|
||||||
|
)
|
||||||
|
: widget.baseViewModel != null
|
||||||
|
? NetworkBaseView(
|
||||||
|
child: buildBodyWidget(),
|
||||||
|
baseViewModel: widget.baseViewModel,
|
||||||
|
)
|
||||||
|
: buildBodyWidget(),
|
||||||
|
bottomSheet: widget.bottomSheet,
|
||||||
|
//floatingActionButton: floatingActionButton ?? floatingActionButton,
|
||||||
|
// bottomNavigationBar:
|
||||||
|
// this.isBottomBar == true ? BottomBarSearch() : SizedBox()
|
||||||
|
// floatingActionButton: FloatingSearchButton(),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
buildAppLoaderWidget(bool isLoading) {
|
||||||
|
return isLoading ? AppLoaderWidget() : Container();
|
||||||
|
}
|
||||||
|
|
||||||
|
buildBodyWidget() {
|
||||||
|
// return body; //Stack(children: <Widget>[body, buildAppLoaderWidget(isLoading)]);
|
||||||
|
return Stack(children: <Widget>[
|
||||||
|
widget.body, /*FloatingSearchButton()*/
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class AppBarWidget extends StatelessWidget with PreferredSizeWidget {
|
||||||
|
final AuthenticatedUserObject authenticatedUserObject =
|
||||||
|
locator<AuthenticatedUserObject>();
|
||||||
|
|
||||||
|
final String appBarTitle;
|
||||||
|
final List<Widget> appBarIcons;
|
||||||
|
final bool isShowAppBar;
|
||||||
|
final bool isPharmacy;
|
||||||
|
final bool isShowDecPage;
|
||||||
|
final String image;
|
||||||
|
|
||||||
|
AppBarWidget(this.appBarTitle, this.appBarIcons, this.isShowAppBar,
|
||||||
|
{this.isPharmacy = true, this.isShowDecPage = true, this.image});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return buildAppBar(context);
|
||||||
|
}
|
||||||
|
|
||||||
|
Widget buildAppBar(BuildContext context) {
|
||||||
|
return isShowAppBar
|
||||||
|
? AppBar(
|
||||||
|
elevation: 0,
|
||||||
|
backgroundColor:Colors.white,
|
||||||
|
// isPharmacy ? Colors.green : Theme.of(context).appBarTheme.color,
|
||||||
|
textTheme: TextTheme(
|
||||||
|
headline6:
|
||||||
|
TextStyle(color: Colors.white, fontWeight: FontWeight.bold),
|
||||||
|
),
|
||||||
|
title: Texts(
|
||||||
|
authenticatedUserObject.isLogin || !isShowDecPage
|
||||||
|
? appBarTitle.toUpperCase()
|
||||||
|
: TranslationBase.of(context).serviceInformationTitle,
|
||||||
|
color: Colors.white,
|
||||||
|
bold: true,
|
||||||
|
),
|
||||||
|
leading: Builder(
|
||||||
|
builder: (BuildContext context) {
|
||||||
|
return GestureDetector(
|
||||||
|
|
||||||
|
behavior: HitTestBehavior.opaque,
|
||||||
|
onTap:()=> Navigator.pop(context),
|
||||||
|
child: Icon(Icons.arrow_back_ios, color: Colors.grey),
|
||||||
|
);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
centerTitle: true,
|
||||||
|
actions: <Widget>[
|
||||||
|
isPharmacy
|
||||||
|
? IconButton(
|
||||||
|
icon: Icon(Icons.shopping_cart),
|
||||||
|
color: Colors.grey,
|
||||||
|
onPressed: () {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(builder: (context) => CartOrderPage()),
|
||||||
|
);
|
||||||
|
// Navigator.of(context)
|
||||||
|
// .popUntil(ModalRoute.withName('/'));
|
||||||
|
})
|
||||||
|
: Container(),
|
||||||
|
image != null
|
||||||
|
? InkWell(
|
||||||
|
onTap: () => Navigator.push(
|
||||||
|
context,
|
||||||
|
FadePage(
|
||||||
|
page: InsuranceUpdate(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
child: Padding(
|
||||||
|
padding: const EdgeInsets.all(8.0),
|
||||||
|
child: Image.asset(
|
||||||
|
image,
|
||||||
|
height: SizeConfig.heightMultiplier * 5,
|
||||||
|
width: SizeConfig.heightMultiplier * 5,
|
||||||
|
color: Colors.grey,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
)
|
||||||
|
: IconButton(
|
||||||
|
icon: Icon(FontAwesomeIcons.ellipsisV),
|
||||||
|
color: Colors.grey,
|
||||||
|
onPressed: () {
|
||||||
|
settingModalBottomSheet(context);
|
||||||
|
},
|
||||||
|
),
|
||||||
|
if (appBarIcons != null) ...appBarIcons
|
||||||
|
],
|
||||||
|
)
|
||||||
|
: Container(
|
||||||
|
height: 0,
|
||||||
|
width: 0,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Size get preferredSize => Size(double.maxFinite, 60);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -0,0 +1,108 @@
|
|||||||
|
import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/uitl/translations_delegate_base.dart';
|
||||||
|
import 'package:eva_icons_flutter/eva_icons_flutter.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import 'bottom_nav_pharmacy_home_item.dart';
|
||||||
|
import 'bottom_nav_pharmacy_item.dart';
|
||||||
|
|
||||||
|
class BottomNavPharmacyBar extends StatefulWidget {
|
||||||
|
final ValueChanged<int> changeIndex;
|
||||||
|
final int index;
|
||||||
|
BottomNavPharmacyBar({Key key, this.changeIndex, this.index})
|
||||||
|
: super(key: key);
|
||||||
|
|
||||||
|
@override
|
||||||
|
_BottomNavPharmacyBarState createState() => _BottomNavPharmacyBarState();
|
||||||
|
}
|
||||||
|
|
||||||
|
class _BottomNavPharmacyBarState extends State<BottomNavPharmacyBar> {
|
||||||
|
int _index = 0;
|
||||||
|
|
||||||
|
_changeIndex(int index) {
|
||||||
|
widget.changeIndex(index);
|
||||||
|
}
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return BottomAppBar(
|
||||||
|
elevation: 4,
|
||||||
|
shape: CircularNotchedRectangle(),
|
||||||
|
color: Colors.white,
|
||||||
|
child: Padding(
|
||||||
|
padding: EdgeInsets.symmetric(horizontal: 18),
|
||||||
|
child: Row(
|
||||||
|
mainAxisSize: MainAxisSize.max,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.spaceAround,
|
||||||
|
children: [
|
||||||
|
BottomNavHomeItem(
|
||||||
|
icon: EvaIcons.image,
|
||||||
|
activeIcon: EvaIcons.image,
|
||||||
|
changeIndex: _changeIndex,
|
||||||
|
index: widget.index,
|
||||||
|
currentIndex: 0,
|
||||||
|
),
|
||||||
|
|
||||||
|
Container(
|
||||||
|
height: 65.0,
|
||||||
|
child: Center(
|
||||||
|
child: VerticalDivider(
|
||||||
|
color: Colors.grey,
|
||||||
|
thickness: 0.5,
|
||||||
|
width: 0.3,
|
||||||
|
indent: 25.5,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
|
||||||
|
BottomNavPharmacyItem(
|
||||||
|
icon: EvaIcons.list,
|
||||||
|
activeIcon: EvaIcons.list,
|
||||||
|
changeIndex: _changeIndex,
|
||||||
|
index: widget.index,
|
||||||
|
currentIndex: 1,
|
||||||
|
title: TranslationBase.of(context).categorise,
|
||||||
|
),
|
||||||
|
// Expanded(
|
||||||
|
// child: SizedBox(
|
||||||
|
// height: 50,
|
||||||
|
// child: Column(
|
||||||
|
// mainAxisSize: MainAxisSize.min,
|
||||||
|
// mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
// children: <Widget>[
|
||||||
|
// SizedBox(height: 22),
|
||||||
|
// ],
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
// ),
|
||||||
|
|
||||||
|
// Added Calendar Icon to access book appointment flow
|
||||||
|
BottomNavPharmacyItem(
|
||||||
|
icon: EvaIcons.heart,
|
||||||
|
activeIcon: EvaIcons.heart,
|
||||||
|
changeIndex: _changeIndex,
|
||||||
|
index: widget.index,
|
||||||
|
currentIndex: 2,
|
||||||
|
title: TranslationBase.of(context).wishList),
|
||||||
|
|
||||||
|
BottomNavPharmacyItem(
|
||||||
|
icon: EvaIcons.person,
|
||||||
|
activeIcon: EvaIcons.person,
|
||||||
|
changeIndex: _changeIndex,
|
||||||
|
index: widget.index,
|
||||||
|
currentIndex: 3,
|
||||||
|
title: TranslationBase.of(context).myAccount,
|
||||||
|
),
|
||||||
|
BottomNavPharmacyItem(
|
||||||
|
icon: EvaIcons.shoppingCart,
|
||||||
|
activeIcon: EvaIcons.shoppingCart,
|
||||||
|
changeIndex: _changeIndex,
|
||||||
|
index: widget.index,
|
||||||
|
currentIndex: 4,
|
||||||
|
title: TranslationBase.of(context).cart)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,74 @@
|
|||||||
|
import 'package:diplomaticquarterapp/pages/landing/home_page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/pages/landing/landing_page.dart';
|
||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class BottomNavHomeItem extends StatelessWidget {
|
||||||
|
final IconData icon;
|
||||||
|
final Image image;
|
||||||
|
|
||||||
|
final ValueChanged<int> changeIndex;
|
||||||
|
final int index;
|
||||||
|
final int currentIndex;
|
||||||
|
final Function onTap;
|
||||||
|
final IconData activeIcon;
|
||||||
|
|
||||||
|
BottomNavHomeItem(
|
||||||
|
{this.icon,
|
||||||
|
this.changeIndex,
|
||||||
|
this.index,
|
||||||
|
this.currentIndex,
|
||||||
|
this.activeIcon,
|
||||||
|
this.onTap,
|
||||||
|
this.image});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Expanded(
|
||||||
|
child: SizedBox(
|
||||||
|
// height: 72.0,
|
||||||
|
child: Material(
|
||||||
|
type: MaterialType.transparency,
|
||||||
|
child: InkWell(
|
||||||
|
highlightColor: Colors.transparent,
|
||||||
|
splashColor: Colors.transparent,
|
||||||
|
onTap: () => {
|
||||||
|
Navigator.push(
|
||||||
|
context,
|
||||||
|
MaterialPageRoute(builder: (context) => LandingPage()),
|
||||||
|
),
|
||||||
|
},
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
SizedBox(
|
||||||
|
height: 15,
|
||||||
|
),
|
||||||
|
currentIndex == index
|
||||||
|
? Divider(
|
||||||
|
// color: Color(0xff5AB145),
|
||||||
|
thickness: 0.5,
|
||||||
|
)
|
||||||
|
: Divider(
|
||||||
|
thickness: 0,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: Image.asset(
|
||||||
|
'assets/images/habib-logo.png',
|
||||||
|
height: 35.0,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 11,
|
||||||
|
),
|
||||||
|
|
||||||
|
// Added TextAlign Property
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -0,0 +1,76 @@
|
|||||||
|
import 'package:diplomaticquarterapp/widgets/data_display/text.dart';
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class BottomNavPharmacyItem extends StatelessWidget {
|
||||||
|
final String title;
|
||||||
|
final IconData icon;
|
||||||
|
|
||||||
|
final ValueChanged<int> changeIndex;
|
||||||
|
final int index;
|
||||||
|
final int currentIndex;
|
||||||
|
final Function onTap;
|
||||||
|
|
||||||
|
final IconData activeIcon;
|
||||||
|
BottomNavPharmacyItem(
|
||||||
|
{this.icon,
|
||||||
|
this.changeIndex,
|
||||||
|
this.index,
|
||||||
|
this.currentIndex,
|
||||||
|
this.activeIcon,
|
||||||
|
this.title,
|
||||||
|
this.onTap});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return Expanded(
|
||||||
|
child: SizedBox(
|
||||||
|
// height: 72.0,
|
||||||
|
child: Material(
|
||||||
|
type: MaterialType.transparency,
|
||||||
|
child: InkWell(
|
||||||
|
highlightColor: Colors.transparent,
|
||||||
|
splashColor: Colors.transparent,
|
||||||
|
onTap: () => changeIndex(currentIndex),
|
||||||
|
child: Column(
|
||||||
|
mainAxisSize: MainAxisSize.min,
|
||||||
|
mainAxisAlignment: MainAxisAlignment.center,
|
||||||
|
children: <Widget>[
|
||||||
|
SizedBox(
|
||||||
|
height: 15,
|
||||||
|
),
|
||||||
|
currentIndex == index
|
||||||
|
? Divider(
|
||||||
|
color: Color(0xff5AB145),
|
||||||
|
thickness: 3.5,
|
||||||
|
)
|
||||||
|
: Divider(
|
||||||
|
thickness: 0,
|
||||||
|
),
|
||||||
|
Container(
|
||||||
|
child: Icon(currentIndex == index ? activeIcon : icon,
|
||||||
|
color: currentIndex == index
|
||||||
|
? Theme.of(context).primaryColor
|
||||||
|
: Theme.of(context).primaryColor,
|
||||||
|
size: 22.0),
|
||||||
|
),
|
||||||
|
SizedBox(
|
||||||
|
height: 11,
|
||||||
|
),
|
||||||
|
|
||||||
|
// Added TextAlign Property
|
||||||
|
Texts(
|
||||||
|
title,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
color: currentIndex == index
|
||||||
|
? Theme.of(context).primaryColor
|
||||||
|
: Theme.of(context).primaryColor,
|
||||||
|
fontSize: 11,
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue