-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmodels.dart
52 lines (35 loc) · 801 Bytes
/
models.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
class User{
String? name;
String? email;
User(this.name, this.email);
factory User.fromJson(Map<String, dynamic> i) {
return User(
i['name'], i['email']
);
}
}
class Products{
String? productName;
int? productPrice;
int? productQuantity;
bool? isFav;
Products(this.productName, this.productPrice, this.productQuantity, this.isFav);
factory Products.fromJson(Map<String, dynamic> i) {
return Products(
i['productName'], i['productPrices'], i['productQuantity'], false,
);
}
}
class Fav{
int? favId;
Products? product;
String? userName;
Fav(this.favId, this.product, this.userName);
factory Fav.fromJson(Map<String, dynamic> i) {
return Fav(
i['favId'],
Products.fromJson(i),
i['userName']
);
}
}