Task: Add sample client sdk
This commit is contained in:
6
lib/sdk/models/CategoryModel.dart
Normal file
6
lib/sdk/models/CategoryModel.dart
Normal file
@@ -0,0 +1,6 @@
|
||||
class Category {
|
||||
int id;
|
||||
String name;
|
||||
|
||||
Category(this.id, this.name);
|
||||
}
|
||||
20
lib/sdk/models/ProductModel.dart
Normal file
20
lib/sdk/models/ProductModel.dart
Normal file
@@ -0,0 +1,20 @@
|
||||
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);
|
||||
}
|
||||
Reference in New Issue
Block a user