fix: ultra-fake orders
This commit is contained in:
@@ -31,6 +31,8 @@ class GymItem {
|
||||
final double price;
|
||||
final String categoryId;
|
||||
final List<GymImage> images;
|
||||
final String supplierId;
|
||||
final String supplierName;
|
||||
int localCount = 0;
|
||||
|
||||
GymItem({
|
||||
@@ -42,23 +44,31 @@ class GymItem {
|
||||
required this.price,
|
||||
required this.categoryId,
|
||||
required this.images,
|
||||
required this.supplierId,
|
||||
required this.supplierName,
|
||||
});
|
||||
|
||||
factory GymItem.fromRawJson(String str) => GymItem.fromJson(json.decode(str));
|
||||
|
||||
String toRawJson() => json.encode(toJson());
|
||||
|
||||
factory GymItem.fromJson(Map<String, dynamic> json) => GymItem(
|
||||
id: json["id"],
|
||||
externalId: json["ExternalId"],
|
||||
title: json["title"],
|
||||
description: json["description"],
|
||||
count: json["count"],
|
||||
price: json["price"] / 100,
|
||||
categoryId: json["categoryId"],
|
||||
images: List<GymImage>.from(
|
||||
json["images"].map((x) => GymImage.fromJson(x))),
|
||||
);
|
||||
factory GymItem.fromJson(Map<String, dynamic> json) {
|
||||
return GymItem(
|
||||
id: json["id"],
|
||||
externalId: json["ExternalId"],
|
||||
title: json["title"],
|
||||
description: json["description"],
|
||||
count: json["count"],
|
||||
price: json["price"] / 100,
|
||||
categoryId: json["categoryId"],
|
||||
images:
|
||||
List<GymImage>.from(json["images"].map((x) => GymImage.fromJson(x))),
|
||||
supplierId: json["supplier"] == null ? '' : json["supplier"]["id"] ?? '',
|
||||
supplierName: json["supplier"] == null
|
||||
? ''
|
||||
: json["supplier"]["title"] ?? "Поставщик",
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
@@ -69,6 +79,8 @@ class GymItem {
|
||||
"price": price,
|
||||
"categoryId": categoryId,
|
||||
"images": List<dynamic>.from(images.map((x) => x.toJson())),
|
||||
"supplier":
|
||||
supplierId == '' ? null : {"id": supplierId, "title": supplierName},
|
||||
};
|
||||
}
|
||||
|
||||
@@ -183,7 +195,7 @@ class GymHistoryItem {
|
||||
}
|
||||
|
||||
class GymHistoryItemDetail {
|
||||
final String id;
|
||||
String id;
|
||||
final String date;
|
||||
final String sum;
|
||||
String? payUrl;
|
||||
@@ -236,7 +248,7 @@ class GymHistoryItemDetail {
|
||||
class GymHistoryItemDetailProvider {
|
||||
final String id;
|
||||
final String name;
|
||||
final String status;
|
||||
String status;
|
||||
final List<GymHistoryItemDetailItem> items;
|
||||
|
||||
GymHistoryItemDetailProvider({
|
||||
@@ -251,14 +263,15 @@ class GymHistoryItemDetailProvider {
|
||||
|
||||
String toRawJson() => json.encode(toJson());
|
||||
|
||||
factory GymHistoryItemDetailProvider.fromJson(Map<String, dynamic> json) =>
|
||||
GymHistoryItemDetailProvider(
|
||||
id: json["id"],
|
||||
name: json["name"],
|
||||
status: json["status"],
|
||||
items: List<GymHistoryItemDetailItem>.from(
|
||||
json["items"].map((x) => GymHistoryItemDetailItem.fromJson(x))),
|
||||
);
|
||||
factory GymHistoryItemDetailProvider.fromJson(Map<String, dynamic> json) {
|
||||
return GymHistoryItemDetailProvider(
|
||||
id: json["id"],
|
||||
name: json["name"],
|
||||
status: json["status"],
|
||||
items: List<GymHistoryItemDetailItem>.from(
|
||||
json["items"].map((x) => GymHistoryItemDetailItem.fromJson(x))),
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
@@ -272,6 +285,7 @@ class GymHistoryItemDetailItem {
|
||||
final String photo;
|
||||
final String id;
|
||||
final int count;
|
||||
final String name;
|
||||
final String price;
|
||||
|
||||
GymHistoryItemDetailItem({
|
||||
@@ -279,6 +293,7 @@ class GymHistoryItemDetailItem {
|
||||
required this.id,
|
||||
required this.count,
|
||||
required this.price,
|
||||
required this.name,
|
||||
});
|
||||
|
||||
factory GymHistoryItemDetailItem.fromRawJson(String str) =>
|
||||
@@ -292,6 +307,7 @@ class GymHistoryItemDetailItem {
|
||||
id: json["id"],
|
||||
count: json["count"],
|
||||
price: json["price"],
|
||||
name: json["name"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
@@ -299,5 +315,6 @@ class GymHistoryItemDetailItem {
|
||||
"id": id,
|
||||
"count": count,
|
||||
"price": price,
|
||||
"name": name,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user