Skip to content

Instantly share code, notes, and snippets.

@ShivamGoyal1899
Created July 18, 2019 06:29
Show Gist options
  • Save ShivamGoyal1899/5242c30b17dd2a64894be6f94b32bea4 to your computer and use it in GitHub Desktop.
Save ShivamGoyal1899/5242c30b17dd2a64894be6f94b32bea4 to your computer and use it in GitHub Desktop.
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