Created
July 18, 2019 06:29
-
-
Save ShivamGoyal1899/5242c30b17dd2a64894be6f94b32bea4 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/foundation.dart'; | |
enum Category { | |
all, | |
accessories, | |
clothing, | |
home, | |
} | |
class Product { | |
const Product({ | |
@required this.category, | |
@required this.id, | |
@required this.isFeatured, | |
@required this.name, | |
@required this.price, | |
}) : assert(category != null), | |
assert(id != null), | |
assert(isFeatured != null), | |
assert(name != null), | |
assert(price != null); | |
final Category category; | |
final int id; | |
final bool isFeatured; | |
final String name; | |
final int price; | |
String get assetName => '$id-0.jpg'; | |
String get assetPackage => 'shrine_images'; | |
@override | |
String toString() => '$name (id=$id)'; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment