Initial commit
This commit is contained in:
27
app_code/lib/models/common/category_info.dart
Normal file
27
app_code/lib/models/common/category_info.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
class CategoryInfo {
|
||||
var id;
|
||||
String name;
|
||||
var products;
|
||||
String thumbnailImage;
|
||||
|
||||
CategoryInfo({
|
||||
required this.id,
|
||||
required this.name,
|
||||
required this.products,
|
||||
required this.thumbnailImage,
|
||||
});
|
||||
|
||||
factory CategoryInfo.fromJson(Map<String, dynamic> json) => CategoryInfo(
|
||||
id: json["id"],
|
||||
name: json["name"],
|
||||
products: json["products"],
|
||||
thumbnailImage: json["thumbnail_image"],
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"id": id,
|
||||
"name": name,
|
||||
"products": products,
|
||||
"thumbnail_image": thumbnailImage,
|
||||
};
|
||||
}
|
||||
39
app_code/lib/models/common/user_info.dart
Normal file
39
app_code/lib/models/common/user_info.dart
Normal file
@@ -0,0 +1,39 @@
|
||||
class UserInfo {
|
||||
String name;
|
||||
String? email;
|
||||
String phone;
|
||||
var balance;
|
||||
String avatar;
|
||||
|
||||
UserInfo({
|
||||
required this.name,
|
||||
this.email,
|
||||
required this.phone,
|
||||
required this.balance,
|
||||
required this.avatar,
|
||||
});
|
||||
|
||||
factory UserInfo.fromJson(Map<String, dynamic> json) => UserInfo(
|
||||
name: json["name"],
|
||||
email: json["email"],
|
||||
phone: json["phone"],
|
||||
balance: json["balance"],
|
||||
avatar: json["avatar"],
|
||||
);
|
||||
|
||||
factory UserInfo.init() => UserInfo(
|
||||
name: '',
|
||||
email: '',
|
||||
phone: '',
|
||||
balance:'',
|
||||
avatar: ''
|
||||
);
|
||||
|
||||
Map<String, dynamic> toJson() => {
|
||||
"name": name,
|
||||
"email": email,
|
||||
"phone": phone,
|
||||
"balance": balance,
|
||||
"avatar": avatar,
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user