add structure
This commit is contained in:
38
lib/vo/storage.dart
Normal file
38
lib/vo/storage.dart
Normal file
@@ -0,0 +1,38 @@
|
||||
import 'product.dart';
|
||||
|
||||
class Storage {
|
||||
String accountID;
|
||||
String id;
|
||||
String name;
|
||||
bool productsLoaded;
|
||||
|
||||
List<Product> products = [];
|
||||
|
||||
Storage(
|
||||
{this.accountID,
|
||||
this.id,
|
||||
this.name,
|
||||
this.products,
|
||||
this.productsLoaded = false});
|
||||
|
||||
factory Storage.fromMap(Map<String, dynamic> map, String id) {
|
||||
return Storage(
|
||||
id: id,
|
||||
accountID: map['account_id'],
|
||||
name: map['name'],
|
||||
);
|
||||
}
|
||||
|
||||
Map<String, dynamic> toMap() {
|
||||
return {
|
||||
'account_id': accountID,
|
||||
'id': id,
|
||||
'name': name,
|
||||
};
|
||||
}
|
||||
|
||||
@override
|
||||
String toString() {
|
||||
return 'Storage{id:$id,name:$name}';
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user