Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 878ae97

Browse files
Add product model class
1 parent cc42da9 commit 878ae97

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

‎lib/models/product.dart‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
class Product {
2+
final String name;
3+
final String brand;
4+
final String imageURL;
5+
final int price;
6+
7+
Product(this.name, this.brand, this.imageURL, this.price);
8+
9+
factory Product.fromJson(Map<String, dynamic> json) {
10+
return new Product(
11+
json["name"],
12+
json["brand"],
13+
json["imageURL"],
14+
json["price"]
15+
);
16+
}
17+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /