21 lines
329 B
Dart
21 lines
329 B
Dart
|
class Product {
|
||
|
int id;
|
||
|
String name;
|
||
|
double price;
|
||
|
|
||
|
Product(this.id, this.name, this.price);
|
||
|
|
||
|
static Product fromJson(dynamic json) => Product(
|
||
|
json['id'],
|
||
|
json['name'],
|
||
|
json['price'],
|
||
|
);
|
||
|
}
|
||
|
|
||
|
class ProductRequest {
|
||
|
String name;
|
||
|
double price;
|
||
|
|
||
|
ProductRequest(this.name, this.price);
|
||
|
}
|