initial commit to gitea

This commit is contained in:
2022-03-10 00:47:26 -05:00
parent 808ffa3211
commit f504e213a0
93 changed files with 4394 additions and 1539 deletions

22
lib/models/group.dart Normal file
View File

@@ -0,0 +1,22 @@
import 'dart:convert';
class Group {
int id;
String name;
Group.fromJson(Map<String, dynamic> json) :
id = json['id'],
name = json['name'];
Map<String, dynamic> toJson() => {
'id': id,
'name': name
};
@override
String toString() {
return json.encode(this);
}
}

View File

@@ -14,6 +14,7 @@ class Product {
String description;
String detailDescription;
String imagePath;
String secondImagePath;
double monthSales;
int rate;
double leftNum;
@@ -30,26 +31,28 @@ class Product {
this.price = price;
this.description = description;
this.imagePath = imagePath;
this.secondImagePath = secondImagePath;
this.productAttributes = productAttributes;
}
Product.fromJson(Map<String, dynamic> json)
: id = json['id'],
businessId = json['business_id'],
categoryId = json['category_id'],
name = json['name'],
price = double.parse(json['price'].toString()),
regularPrice = double.parse(json['regular_price'].toString()),
description = json['description'],
detailDescription = json['detail_description'],
imagePath = json['image_path'],
monthSales = json['month_sales'] != null ? double.parse(json['month_sales'].toString()) : 0.0,
rate = json['rate'],
leftNum = json['left_num'] != null ? double.parse(json['left_num'].toString()) : 0.0,
productAttributes = json['productattributes'] != null ? (json['productattributes'] as List).map((i) => ProductAttribute.fromJson(i)).toList() : [],
nonInventory = json['non_inventory'],
extraData = json['extra_data'],
subproducts = json['subproducts'] != null ? (json['subproducts'] as List).map((e) => Subproduct.fromJson(e)).toList() : [];
: id = json['id'],
businessId = json['business_id'],
categoryId = json['category_id'],
name = json['name'],
price = double.parse(json['price'].toString()),
regularPrice = double.parse(json['regular_price'].toString()),
description = json['description'],
detailDescription = json['detail_description'],
imagePath = json['image_path'],
secondImagePath = json['second_image_path'],
monthSales = json['month_sales'] != null ? double.parse(json['month_sales'].toString()) : 0.0,
rate = json['rate'],
leftNum = json['left_num'] != null ? double.parse(json['left_num'].toString()) : 0.0,
productAttributes = json['productattributes'] != null ? (json['productattributes'] as List).map((i) => ProductAttribute.fromJson(i)).toList() : [],
nonInventory = json['non_inventory'],
extraData = json['extra_data'],
subproducts = json['subproducts'] != null ? (json['subproducts'] as List).map((e) => Subproduct.fromJson(e)).toList() : [];
Map<String, dynamic> toJson() => {
'id': id,
@@ -61,6 +64,7 @@ class Product {
'description': description,
'detail_description': detailDescription,
'image_path': imagePath,
'second_image_path': secondImagePath,
'month_sales': monthSales,
'rate': rate,
'left_num': leftNum,