39 lines
647 B
Dart
39 lines
647 B
Dart
|
|
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}';
|
||
|
|
}
|
||
|
|
}
|