backup. before shop update

This commit is contained in:
2021-08-31 13:28:33 -04:00
parent c378a6203c
commit 808ffa3211
292 changed files with 51551 additions and 695 deletions

View File

@@ -0,0 +1,66 @@
import 'dart:convert';
import 'package:flutter_wisetronic/models/product_attribute.dart';
class Subproduct {
int id;
SimpleProduct product;
double quantity;
Subproduct.fromJson(Map<String, dynamic> json) :
id = json['id'],
product = SimpleProduct.fromJson(json['product']),
quantity = double.parse(json['quantity'].toString());
Map<String, dynamic> toJson() => {
'id': id,
'product': product,
'quantity': quantity,
};
@override
String toString() {
return json.encode(this);
}
}
class SimpleProduct {
int id;
String name;
String sku;
double price;
String description;
String image;
List<ProductAttribute> productAttributes;
double customerLastPrice;
String extraData;
SimpleProduct.fromJson(Map<String, dynamic> json) :
id = json['id'],
name = json['name'],
sku = json['sku'],
price = double.parse(json['price'].toString()),
description = json['description'],
image = json['image'],
productAttributes = (json['productattributes'] as List).map((i) => ProductAttribute.fromJson(i)).toList(),
customerLastPrice = double.parse(json['customer_last_price'].toString()),
extraData = json['extra_data'];
Map<String, dynamic> toJson() => {
'id': id,
'name': name,
'sku': sku,
'price': price,
'description': description,
'image': image,
'productattributes': productAttributes,
'customer_last_price': customerLastPrice,
'extra_data': extraData,
};
@override
String toString() {
return json.encode(this);
}
}