Merge branch 'pharmacy' into pharmacy-Fatima
# Conflicts: # lib/widgets/pharmacy/product_tile.dartmerge-requests/206/head
commit
c0920e7099
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
Binary file not shown.
After Width: | Height: | Size: 2.6 KiB |
@ -0,0 +1,41 @@
|
||||
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;
|
||||
|
||||
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);
|
||||
}
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
import 'package:diplomaticquarterapp/core/enum/viewstate.dart';
|
||||
import 'package:diplomaticquarterapp/core/viewModels/base_view_model.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 '../../../locator.dart';
|
||||
|
||||
class ProductDetailViewModel extends BaseViewModel{
|
||||
ProductDetailService _productDetailService = locator<ProductDetailService>();
|
||||
|
||||
List<ProductDetail> get productDetailService => _productDetailService.productDetailList;
|
||||
|
||||
List<LocationModel> get productLocationService => _productDetailService.productLocationList;
|
||||
|
||||
bool hasError = false;
|
||||
|
||||
|
||||
Future getProductReviewsData() async {
|
||||
hasError = false;
|
||||
setState(ViewState.Busy);
|
||||
await _productDetailService.getProductReviews();
|
||||
if (_productDetailService.hasError) {
|
||||
error = _productDetailService.error;
|
||||
setState(ViewState.ErrorLocal);
|
||||
} else
|
||||
setState(ViewState.Idle);
|
||||
}
|
||||
|
||||
Future getProductLocationData() async {
|
||||
hasError = false;
|
||||
setState(ViewState.Busy);
|
||||
await _productDetailService.getProductAvailabiltyDetail();
|
||||
if (_productDetailService.hasError) {
|
||||
error = _productDetailService.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,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,157 @@
|
||||
// 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;
|
||||
PageSizeOptions 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: pageSizeOptionsValues.map[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": pageSizeOptionsValues.reverse[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,
|
||||
};
|
||||
}
|
||||
|
||||
enum PageSizeOptions { THE_2460100 }
|
||||
|
||||
final pageSizeOptionsValues = EnumValues({
|
||||
"24, 60, 100": PageSizeOptions.THE_2460100
|
||||
});
|
||||
|
||||
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,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,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;
|
||||
dynamic 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"],
|
||||
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: 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,
|
||||
"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.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,55 @@
|
||||
import 'package:diplomaticquarterapp/widgets/pharmacy/product_tile.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
class ProductCheckTypeWidget extends StatelessWidget {
|
||||
final List<dynamic> wishlist;
|
||||
final bool isTrue;
|
||||
|
||||
ProductCheckTypeWidget(this.isTrue, this.wishlist);
|
||||
|
||||
@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: wishlist[index].product.name,
|
||||
productPrice: wishlist[index].subtotal,
|
||||
productRate:
|
||||
double.parse(wishlist[index].subtotalVatRate),
|
||||
productImage: wishlist[index].product.images[0].src,
|
||||
showLine: isTrue,
|
||||
)
|
||||
: 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,
|
||||
),
|
||||
),
|
||||
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,
|
||||
)),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,597 @@
|
||||
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';
|
||||
|
||||
void main() => runApp(ComparePage());
|
||||
|
||||
class ComparePage extends StatefulWidget {
|
||||
@override
|
||||
_ComparePageState createState() => _ComparePageState();
|
||||
}
|
||||
|
||||
class _ComparePageState extends State<ComparePage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: 'Reviews page',
|
||||
isShowAppBar: true,
|
||||
isPharmacy: true,
|
||||
body: Container(
|
||||
child: compareList(),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
compareList() {
|
||||
return CarouselSlider(
|
||||
options: CarouselOptions(
|
||||
height: 800.0, viewportFraction: 0.95, enableInfiniteScroll: false),
|
||||
items: [1, 2].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: slideDetail(),
|
||||
),
|
||||
);
|
||||
},
|
||||
);
|
||||
}).toList(),
|
||||
);
|
||||
}
|
||||
|
||||
slideDetail() {
|
||||
return ListView(
|
||||
children: [
|
||||
Row(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Container(
|
||||
height: 800,
|
||||
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: Icon(FontAwesomeIcons.trashAlt, size: 15)),
|
||||
),
|
||||
SizedBox(height: 20,),
|
||||
Image(
|
||||
image: AssetImage(
|
||||
'assets/images/al-habib_onlne_pharmacy_bg.png'),
|
||||
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: 'SAR 999.99',
|
||||
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:
|
||||
'ENAD test',
|
||||
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: 'Primary Unit Of Measure',
|
||||
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:
|
||||
'Each',
|
||||
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: 'Primary Unit Of Measure',
|
||||
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:
|
||||
'Each',
|
||||
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: 'Primary Unit Of Measure',
|
||||
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:
|
||||
'Each',
|
||||
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: 'Primary Unit Of Measure',
|
||||
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:
|
||||
'Each',
|
||||
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: 'Primary Unit Of Measure',
|
||||
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:
|
||||
'Each',
|
||||
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(
|
||||
height: 800,
|
||||
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: Icon(FontAwesomeIcons.trashAlt, size: 15)),
|
||||
),
|
||||
SizedBox(height: 20,),
|
||||
Image(
|
||||
image: AssetImage(
|
||||
'assets/images/al-habib_onlne_pharmacy_bg.png'),
|
||||
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: 'SAR 999.99',
|
||||
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:
|
||||
'ENAD test',
|
||||
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: 'Primary Unit Of Measure',
|
||||
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:
|
||||
'Each',
|
||||
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: 'Primary Unit Of Measure',
|
||||
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:
|
||||
'Each',
|
||||
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: 'Primary Unit Of Measure',
|
||||
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:
|
||||
'Each',
|
||||
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: 'Primary Unit Of Measure',
|
||||
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:
|
||||
'Each',
|
||||
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: 'Primary Unit Of Measure',
|
||||
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:
|
||||
'Each',
|
||||
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,),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
@ -0,0 +1,194 @@
|
||||
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';
|
||||
|
||||
void main() => runApp(MyReviewsPage());
|
||||
|
||||
class MyReviewsPage extends StatefulWidget {
|
||||
@override
|
||||
_MyReviewsPageState createState() => _MyReviewsPageState();
|
||||
}
|
||||
|
||||
class _MyReviewsPageState extends State<MyReviewsPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<ReviewViewModel>(
|
||||
onModelReady: (model) => model.getReviewData(),
|
||||
builder: (_, model, wi) => AppScaffold(
|
||||
appBarTitle: 'Wishlist page',
|
||||
isShowAppBar: true,
|
||||
isPharmacy: true,
|
||||
body: 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: const 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: 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: Alignment.topLeft,
|
||||
child: RichText(
|
||||
text: TextSpan(
|
||||
text: data.product.name,
|
||||
style: TextStyle(
|
||||
color: Colors.black54,
|
||||
fontSize: 13,
|
||||
fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
Container(
|
||||
margin: EdgeInsets.all(5),
|
||||
child: Align(
|
||||
alignment: 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: 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: EdgeInsets.only(left: 10),
|
||||
child: Text(data.createdOnUtc.toString())),
|
||||
],
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.end,
|
||||
mainAxisAlignment: MainAxisAlignment.end,
|
||||
children: [
|
||||
Container(
|
||||
padding: 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: 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;
|
||||
}
|
@ -0,0 +1,284 @@
|
||||
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';
|
||||
|
||||
void main() => runApp(ProductBrandsPage());
|
||||
|
||||
class ProductBrandsPage extends StatefulWidget {
|
||||
@override
|
||||
_ProductBrandsPageState createState() => _ProductBrandsPageState();
|
||||
}
|
||||
|
||||
class _ProductBrandsPageState extends State<ProductBrandsPage> {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return BaseView<BrandsViewModel>(
|
||||
onModelReady: (model) => model.getTopBrandsData(),
|
||||
builder: (_, model, wi) => AppScaffold(
|
||||
appBarTitle: 'Brands page',
|
||||
isShowAppBar: true,
|
||||
isPharmacy: true,
|
||||
body: Container(
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
color: Colors.white,
|
||||
alignment: Alignment.topLeft,
|
||||
padding: EdgeInsets.only(left: 10.0, top: 10.0),
|
||||
child: Text(
|
||||
'Top Brands',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold
|
||||
),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
height: 220,
|
||||
width: double.infinity,
|
||||
color: Colors.white,
|
||||
child: topBrand(),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
height: 100,
|
||||
width: double.infinity,
|
||||
color: Colors.white,
|
||||
child: IconButton(
|
||||
icon: Icon(Icons.search),
|
||||
onPressed: () {
|
||||
showSearch(context: context, delegate: SearchBar());
|
||||
},
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
height: 280,
|
||||
width: double.infinity,
|
||||
color: Colors.white,
|
||||
child: ListView.builder(
|
||||
itemCount: model.brandsListList.length,
|
||||
itemBuilder: (BuildContext ctxt, int index) {
|
||||
return Container(
|
||||
margin: EdgeInsets.only(top: 50, left: 10),
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Text(model.brandsListList[index].name),
|
||||
SizedBox(
|
||||
height: 3,
|
||||
),
|
||||
Divider(height: 1, color: Colors.grey)
|
||||
],
|
||||
),
|
||||
);
|
||||
}),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
//topBrand() {
|
||||
// return BaseView<BrandsViewModel>(
|
||||
// onModelReady: (model) => model.getBrandsData(),
|
||||
// builder: (_, model, wi) => Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
// children: [
|
||||
// Container(
|
||||
// padding: EdgeInsets.all(10),
|
||||
// child: Text(
|
||||
// 'Top Brands',
|
||||
// ),
|
||||
// ),
|
||||
// Row(
|
||||
// children: [
|
||||
// Container(
|
||||
// margin: EdgeInsets.fromLTRB(10.0, 10.0, 0.0, 0.0),
|
||||
// child: Container(
|
||||
// margin: EdgeInsets.only(bottom: 10.0),
|
||||
// child: Container(
|
||||
// margin: EdgeInsets.only(bottom: 10.0),
|
||||
// child: Container(
|
||||
// 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: Image(
|
||||
// image: AssetImage(
|
||||
// 'assets/images/al-habib_onlne_pharmacy_bg.png'),
|
||||
// fit: BoxFit.cover,
|
||||
// width: 60,
|
||||
// height: 40,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// Row(
|
||||
// children: [
|
||||
// Container(
|
||||
// margin: EdgeInsets.fromLTRB(10.0, 10.0, 0.0, 0.0),
|
||||
// child: Container(
|
||||
// margin: EdgeInsets.only(bottom: 10.0),
|
||||
// child: Container(
|
||||
// margin: EdgeInsets.only(bottom: 10.0),
|
||||
// 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: Image(
|
||||
// image: AssetImage(
|
||||
// 'assets/images/al-habib_onlne_pharmacy_bg.png'),
|
||||
// fit: BoxFit.cover,
|
||||
// width: 60,
|
||||
// height: 40,
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// ],
|
||||
// ),
|
||||
// );
|
||||
//}
|
||||
|
||||
topBrand() {
|
||||
return BaseView<BrandsViewModel>(
|
||||
onModelReady: (model) => model.getTopBrandsData(),
|
||||
builder: (_, model, wi) => GridView.count(
|
||||
crossAxisCount: 4,
|
||||
children: List.generate(
|
||||
model.topBrandsListList.length,
|
||||
(index) => Column(
|
||||
children: [
|
||||
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: Image.network(
|
||||
model.topBrandsListList[index].image.src.trim(),
|
||||
fit: BoxFit.cover,
|
||||
width: 60,
|
||||
height: 40,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
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);
|
||||
},
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
@ -0,0 +1,888 @@
|
||||
import 'package:diplomaticquarterapp/core/viewModels/pharmacyModule/product_detail_view_model.dart';
|
||||
import 'package:diplomaticquarterapp/pages/base/base_view.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:diplomaticquarterapp/widgets/others/app_scaffold_widget.dart';
|
||||
import 'package:font_awesome_flutter/font_awesome_flutter.dart';
|
||||
import 'package:rating_bar/rating_bar.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
int price = 0;
|
||||
void main() => runApp(ProductDetailPage());
|
||||
|
||||
class ProductDetailPage extends StatefulWidget {
|
||||
@override
|
||||
__ProductDetailPageState createState() => __ProductDetailPageState();
|
||||
}
|
||||
|
||||
class __ProductDetailPageState extends State<ProductDetailPage> {
|
||||
bool isTrue = true;
|
||||
bool isDetails = true;
|
||||
bool isReviews = false;
|
||||
bool isAvailabilty = false;
|
||||
|
||||
Widget build(BuildContext context) {
|
||||
return AppScaffold(
|
||||
appBarTitle: 'product detail page',
|
||||
isShowAppBar: true,
|
||||
isPharmacy: true,
|
||||
body: SingleChildScrollView(
|
||||
child: Column(
|
||||
children: [
|
||||
Container(
|
||||
width: double.infinity,
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
children: [
|
||||
Image(
|
||||
image: AssetImage('assets/images/timeline_bg.png'),
|
||||
),
|
||||
Container(
|
||||
width: double.infinity,
|
||||
height: 50,
|
||||
color: Colors.yellowAccent,
|
||||
child: Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Container(
|
||||
alignment: Alignment.centerRight,
|
||||
child: Text(
|
||||
"Discount on Second item",
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold, fontSize: 17),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
flex: 0,
|
||||
child: Container(
|
||||
child: Image(
|
||||
image: AssetImage('assets/images/offer.png'),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 4,
|
||||
),
|
||||
Container(
|
||||
width: 500,
|
||||
height: 150,
|
||||
color: Colors.white,
|
||||
child: productNameAndPrice(),
|
||||
),
|
||||
SizedBox(
|
||||
height: 6,
|
||||
),
|
||||
Container(
|
||||
width: 500,
|
||||
height: 120,
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
child: Text(
|
||||
"Specificaion",
|
||||
style: TextStyle(fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
),
|
||||
Divider(color: Colors.grey)
|
||||
],
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 6,
|
||||
),
|
||||
Container(
|
||||
width: 500,
|
||||
margin: EdgeInsets.only(bottom: 100),
|
||||
// height: 350,
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
children: [
|
||||
Column(
|
||||
children: [
|
||||
FlatButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
isDetails = true;
|
||||
isReviews = false;
|
||||
isAvailabilty = false;
|
||||
});
|
||||
},
|
||||
child: Text(
|
||||
'DETAILS',
|
||||
style: TextStyle(
|
||||
fontSize: 16, fontWeight: FontWeight.bold),
|
||||
),
|
||||
color: Colors.white,
|
||||
),
|
||||
isDetails
|
||||
? Container(
|
||||
width: 100,
|
||||
height: 5,
|
||||
color: Colors.green,
|
||||
)
|
||||
: Container()
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
FlatButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
isDetails = false;
|
||||
isReviews = true;
|
||||
isAvailabilty = false;
|
||||
});
|
||||
},
|
||||
child: Text(
|
||||
'REVIEWS',
|
||||
style: TextStyle(
|
||||
fontSize: 16, fontWeight: FontWeight.bold),
|
||||
),
|
||||
color: Colors.white,
|
||||
),
|
||||
isReviews
|
||||
? Container(
|
||||
width: 100,
|
||||
height: 5,
|
||||
color: Colors.green,
|
||||
)
|
||||
: Container(),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
width: 20,
|
||||
),
|
||||
Column(
|
||||
children: [
|
||||
FlatButton(
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
isDetails = false;
|
||||
isReviews = false;
|
||||
isAvailabilty = true;
|
||||
});
|
||||
},
|
||||
child: Text(
|
||||
'AVAILABILTY',
|
||||
style: TextStyle(
|
||||
fontSize: 16, fontWeight: FontWeight.bold),
|
||||
),
|
||||
color: Colors.white,
|
||||
),
|
||||
isAvailabilty
|
||||
? Container(
|
||||
width: 100,
|
||||
height: 5,
|
||||
color: Colors.green,
|
||||
)
|
||||
: Container(),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
isDetails
|
||||
? Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
child: Text(
|
||||
'Description',
|
||||
style: TextStyle(
|
||||
fontSize: 17,
|
||||
color: Colors.grey,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 10,
|
||||
),
|
||||
Container(
|
||||
child: Text(
|
||||
'Body Mosturizing and nourishing lotion',
|
||||
style: TextStyle(fontSize: 20),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
: isReviews
|
||||
? BaseView<ProductDetailViewModel>(
|
||||
onModelReady: (model) =>
|
||||
model.getProductReviewsData(),
|
||||
builder: (_, model, wi) => ListView.builder(
|
||||
physics: const ScrollPhysics(),
|
||||
itemCount: model.productDetailService[0].reviews.length,
|
||||
scrollDirection: Axis.vertical,
|
||||
shrinkWrap: true,
|
||||
itemBuilder: (BuildContext context, int index){
|
||||
return Padding(
|
||||
padding: EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
child: Row(
|
||||
children: [
|
||||
Container(
|
||||
child: Text(
|
||||
model.productDetailService[0]
|
||||
.reviews[index].id
|
||||
.toString(),
|
||||
style: TextStyle(
|
||||
fontSize: 17,
|
||||
color: Colors.grey,
|
||||
fontWeight: FontWeight.w600),
|
||||
),
|
||||
),
|
||||
Container(
|
||||
margin: EdgeInsets.only(left: 232),
|
||||
child: RatingBar.readOnly(
|
||||
initialRating: model
|
||||
.productDetailService[0]
|
||||
.reviews[index]
|
||||
.rating
|
||||
.toDouble(),
|
||||
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: 10,
|
||||
),
|
||||
Container(
|
||||
child: Text(
|
||||
model.productDetailService[0].reviews[index]
|
||||
.reviewText,
|
||||
style: TextStyle(fontSize: 20),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
height: 50,
|
||||
),
|
||||
Divider(height: 1, color: Colors.grey),
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
),
|
||||
)
|
||||
: isAvailabilty
|
||||
? BaseView<ProductDetailViewModel>(
|
||||
onModelReady: (model) =>
|
||||
model.getProductLocationData(),
|
||||
builder: (_, model, wi) => ListView.builder(
|
||||
physics: const ScrollPhysics(),
|
||||
scrollDirection: Axis.vertical,
|
||||
shrinkWrap: true,
|
||||
itemCount: model.productLocationService.length,
|
||||
itemBuilder: (BuildContext context, int index){
|
||||
return Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
// mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Row(
|
||||
// crossAxisAlignment: CrossAxisAlignment.start,
|
||||
mainAxisAlignment:
|
||||
MainAxisAlignment.start,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Image.network(model
|
||||
.productLocationService[index]
|
||||
.projectImageUrl),
|
||||
),
|
||||
SizedBox(
|
||||
width: 10,
|
||||
),
|
||||
Expanded(
|
||||
flex: 4,
|
||||
child: Text(
|
||||
model.productLocationService[index]
|
||||
.locationDescription +
|
||||
"\n" +
|
||||
fixingString(model
|
||||
.productLocationService[
|
||||
0]
|
||||
.cityName
|
||||
.toString()),
|
||||
style: TextStyle(fontSize: 12),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: IconButton(
|
||||
icon: Icon(Icons.location_on),
|
||||
color: Colors.red,
|
||||
onPressed: () {},
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: IconButton(
|
||||
icon: Icon(Icons.phone),
|
||||
color: Colors.red,
|
||||
onPressed: () {},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
Divider(height: 1.2, color: Colors.grey)
|
||||
],
|
||||
),
|
||||
);
|
||||
},
|
||||
|
||||
),
|
||||
)
|
||||
: Container(),
|
||||
],
|
||||
),
|
||||
),
|
||||
// ListView(scrollDirection: Axis.vertical, shrinkWrap: true, children: [Text('ENAD')]),
|
||||
],
|
||||
),
|
||||
),
|
||||
bottomSheet: footerWidget(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
class footerWidget extends StatefulWidget {
|
||||
@override
|
||||
_footerWidgetState createState() => _footerWidgetState();
|
||||
}
|
||||
|
||||
class _footerWidgetState extends State<footerWidget> {
|
||||
double quantityUI = 70;
|
||||
bool showUI = false;
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Container(
|
||||
width: double.infinity,
|
||||
height: quantityUI,
|
||||
color: Colors.white,
|
||||
child: Column(
|
||||
children: [
|
||||
showUI
|
||||
? Container(
|
||||
width: double.infinity,
|
||||
height: 90,
|
||||
color: Colors.white,
|
||||
child: Container(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Text(
|
||||
'Quantity',
|
||||
style: TextStyle(
|
||||
fontSize: 15, fontWeight: FontWeight.bold),
|
||||
),
|
||||
),
|
||||
// ListView(
|
||||
// scrollDirection: Axis.horizontal,
|
||||
// children: [
|
||||
// itemQuantity(),
|
||||
// ],
|
||||
// ),
|
||||
Container(
|
||||
// margin: EdgeInsets.symmetric(vertical: 20.0),
|
||||
height: 50.0,
|
||||
child: ListView(
|
||||
scrollDirection: Axis.horizontal,
|
||||
children: <Widget>[
|
||||
InkWell(
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: 50.0,
|
||||
color: Colors.white,
|
||||
child: Text(
|
||||
'1',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
price = 1;
|
||||
return price;
|
||||
});
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
InkWell(
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: 50.0,
|
||||
color: Colors.white,
|
||||
child: Text(
|
||||
'2',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
price = 2;
|
||||
// return price;
|
||||
});
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
InkWell(
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: 50.0,
|
||||
color: Colors.white,
|
||||
child: Text(
|
||||
'3',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
price = 3;
|
||||
return price;
|
||||
});
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
InkWell(
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: 50.0,
|
||||
color: Colors.white,
|
||||
child: Text(
|
||||
'4',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
price = 4;
|
||||
return price;
|
||||
});
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
InkWell(
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: 50.0,
|
||||
color: Colors.white,
|
||||
child: Text(
|
||||
'5',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
price = 5;
|
||||
return price;
|
||||
});
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
InkWell(
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: 50.0,
|
||||
color: Colors.white,
|
||||
child: Text(
|
||||
'6',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
price = 6;
|
||||
return price;
|
||||
});
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
InkWell(
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: 50.0,
|
||||
color: Colors.white,
|
||||
child: Text(
|
||||
'7',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
price = 7;
|
||||
return price;
|
||||
});
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
InkWell(
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: 50.0,
|
||||
color: Colors.white,
|
||||
child: Text(
|
||||
'8',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
price = 8;
|
||||
return price;
|
||||
});
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
InkWell(
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: 50.0,
|
||||
color: Colors.white,
|
||||
child: Text(
|
||||
'9',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
price = 9;
|
||||
return price;
|
||||
});
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
InkWell(
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: 50.0,
|
||||
color: Colors.white,
|
||||
child: Text(
|
||||
'10',
|
||||
style: TextStyle(
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 20),
|
||||
),
|
||||
),
|
||||
onTap: () {
|
||||
setState(() {
|
||||
price = 10;
|
||||
return price;
|
||||
});
|
||||
},
|
||||
),
|
||||
SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
Container(
|
||||
width: 50.0,
|
||||
child: TextField(
|
||||
decoration:
|
||||
InputDecoration(labelText: 'quantity #'),
|
||||
onChanged: (text) {
|
||||
if (int.tryParse(text) == null) {
|
||||
text = '';
|
||||
} else {
|
||||
setState(() {
|
||||
price = int.parse(text);
|
||||
});
|
||||
}
|
||||
},
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
)
|
||||
],
|
||||
),
|
||||
),
|
||||
)
|
||||
: Container(
|
||||
height: 20,
|
||||
),
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Container(
|
||||
width: 70,
|
||||
height: 50,
|
||||
child: FlatButton(
|
||||
child: Column(
|
||||
mainAxisAlignment: MainAxisAlignment.center,
|
||||
crossAxisAlignment: CrossAxisAlignment.center,
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 4,
|
||||
child: Text(
|
||||
price.toString(),
|
||||
style: TextStyle(fontSize: 20),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 5,
|
||||
child: Text(
|
||||
"QTY",
|
||||
style: TextStyle(fontSize: 16),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
onPressed: () {
|
||||
setState(() {
|
||||
if (showUI) {
|
||||
quantityUI = 70;
|
||||
showUI = false;
|
||||
} else {
|
||||
quantityUI = 150;
|
||||
showUI = true;
|
||||
}
|
||||
});
|
||||
},
|
||||
),
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: 190,
|
||||
height: 46,
|
||||
color: Colors.green,
|
||||
child: Text(
|
||||
'Add to Cart',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 15),
|
||||
),
|
||||
),
|
||||
),
|
||||
SizedBox(
|
||||
width: 5,
|
||||
),
|
||||
InkWell(
|
||||
onTap: () {},
|
||||
child: Container(
|
||||
alignment: Alignment.center,
|
||||
width: 120,
|
||||
height: 46,
|
||||
color: Colors.blue,
|
||||
child: Text(
|
||||
'Buy Now',
|
||||
style: TextStyle(
|
||||
color: Colors.white,
|
||||
fontWeight: FontWeight.bold,
|
||||
fontSize: 15),
|
||||
),
|
||||
),
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
productNameAndPrice() {
|
||||
return Column(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Row(
|
||||
children: [
|
||||
Text(
|
||||
"22 SR",
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 30),
|
||||
),
|
||||
SizedBox(
|
||||
width: 100,
|
||||
),
|
||||
Text(
|
||||
"Out Of Stock",
|
||||
style: TextStyle(fontWeight: FontWeight.bold, color: Colors.red),
|
||||
),
|
||||
SizedBox(width: 30),
|
||||
Text(
|
||||
"notify me ",
|
||||
style: TextStyle(
|
||||
color: Colors.blue,
|
||||
decoration: TextDecoration.underline,
|
||||
),
|
||||
),
|
||||
Icon(
|
||||
FontAwesomeIcons.bell,
|
||||
color: Colors.blue,
|
||||
size: 15.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(left: 5),
|
||||
child: Text(
|
||||
"Johnson And Jonson Vita-Rich Smoothing Body Cream - With Papaya Extract 200 ML",
|
||||
style: TextStyle(fontWeight: FontWeight.bold, fontSize: 15),
|
||||
),
|
||||
),
|
||||
),
|
||||
Row(
|
||||
children: [
|
||||
Expanded(
|
||||
flex: 2,
|
||||
child: Container(
|
||||
margin: EdgeInsets.only(right: 150),
|
||||
child: Align(
|
||||
alignment: Alignment.bottomLeft,
|
||||
child: RatingBar.readOnly(
|
||||
initialRating: 3,
|
||||
size: 15.0,
|
||||
filledColor: Colors.yellow[700],
|
||||
emptyColor: Colors.grey[500],
|
||||
isHalfAllowed: true,
|
||||
halfFilledIcon: Icons.star_half,
|
||||
filledIcon: Icons.star,
|
||||
emptyIcon: Icons.star,
|
||||
),
|
||||
),
|
||||
),
|
||||
),
|
||||
Expanded(
|
||||
flex: 1,
|
||||
child: Container(
|
||||
child: Text(
|
||||
'Prescription attachment required',
|
||||
style: TextStyle(color: Colors.red, fontSize: 10),
|
||||
),
|
||||
),
|
||||
),
|
||||
Icon(
|
||||
FontAwesomeIcons.questionCircle,
|
||||
color: Colors.red,
|
||||
size: 15.0,
|
||||
),
|
||||
],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
slideDetail() {
|
||||
return Row(
|
||||
mainAxisAlignment: MainAxisAlignment.start,
|
||||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
Padding(
|
||||
padding: const EdgeInsets.all(8.0),
|
||||
child: Container(
|
||||
padding: const EdgeInsets.symmetric(horizontal: 14.0, vertical: 15.0),
|
||||
decoration: const BoxDecoration(
|
||||
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: const Text('1',
|
||||
textAlign: TextAlign.center,
|
||||
style: TextStyle(color: Color(0xFF000000))),
|
||||
),
|
||||
)
|
||||
],
|
||||
);
|
||||
}
|
||||
|
||||
fixingString(txt) {
|
||||
String stringTxt;
|
||||
String newTxt;
|
||||
stringTxt = txt.toString();
|
||||
newTxt = stringTxt.split('.')[1];
|
||||
|
||||
return newTxt;
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
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;
|
||||
|
||||
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;
|
||||
});
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
||||
import 'package:diplomaticquarterapp/models/pharmacy/locationModel.dart';
|
||||
import 'package:diplomaticquarterapp/models/pharmacy/productDetailModel.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||
|
||||
class ProductDetailService extends BaseService {
|
||||
AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||
bool isLogin = false;
|
||||
|
||||
List<ProductDetail> _productDetailList = List();
|
||||
List<ProductDetail> get productDetailList => _productDetailList;
|
||||
|
||||
List<LocationModel> _productLocationList = List();
|
||||
List<LocationModel> get productLocationList => _productLocationList;
|
||||
|
||||
|
||||
Future getProductReviews() async {
|
||||
hasError = false;
|
||||
await baseAppClient.getPharmacy(GET_PRODUCT_DETAIL+"1480?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));
|
||||
});
|
||||
}, onFailure: (String error, int statusCode) {
|
||||
hasError = true;
|
||||
super.error = error;
|
||||
}, body: request);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
import 'package:diplomaticquarterapp/config/config.dart';
|
||||
import 'package:diplomaticquarterapp/core/service/base_service.dart';
|
||||
import 'package:diplomaticquarterapp/models/pharmacy/reviewModel.dart';
|
||||
import 'package:diplomaticquarterapp/uitl/app_shared_preferences.dart';
|
||||
|
||||
|
||||
class ReviewService extends BaseService {
|
||||
AppSharedPreferences sharedPref = AppSharedPreferences();
|
||||
bool isLogin = false;
|
||||
List<Review> _reviewList = List();
|
||||
List<Review> get reviewList => _reviewList;
|
||||
|
||||
|
||||
Future getReview() async {
|
||||
hasError = false;
|
||||
await baseAppClient.getPharmacy(GET_REVIEW+"1367368",
|
||||
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;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue