|
|
|
@ -1,7 +1,3 @@
|
|
|
|
|
// 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)));
|
|
|
|
@ -16,12 +12,12 @@ class ProductDetail {
|
|
|
|
|
List<Review> reviews;
|
|
|
|
|
|
|
|
|
|
factory ProductDetail.fromJson(Map<String, dynamic> json) => ProductDetail(
|
|
|
|
|
reviews: List<Review>.from(json["reviews"].map((x) => Review.fromJson(x))),
|
|
|
|
|
);
|
|
|
|
|
reviews: List<Review>.from(json["reviews"].map((x) => Review.fromJson(x))),
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
Map<String, dynamic> toJson() => {
|
|
|
|
|
"reviews": List<dynamic>.from(reviews.map((x) => x.toJson())),
|
|
|
|
|
};
|
|
|
|
|
"reviews": List<dynamic>.from(reviews.map((x) => x.toJson())),
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class Review {
|
|
|
|
@ -62,42 +58,42 @@ class Review {
|
|
|
|
|
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"],
|
|
|
|
|
);
|
|
|
|
|
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,
|
|
|
|
|
};
|
|
|
|
|
"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 {
|
|
|
|
@ -164,75 +160,73 @@ class Customer {
|
|
|
|
|
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"],
|
|
|
|
|
);
|
|
|
|
|
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,
|
|
|
|
|
};
|
|
|
|
|
"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
|
|
|
|
|
});
|
|
|
|
|
final emailValues = EnumValues({"steve_gates@nopCommerce.com": Email.STEVE_GATES_NOP_COMMERCE_COM});
|
|
|
|
|
|
|
|
|
|
class EnumValues<T> {
|
|
|
|
|
Map<String, T> map;
|
|
|
|
|