f0ckapp/lib/model/item.dart

23 lines
366 B
Dart
Raw Normal View History

2022-05-13 15:57:28 +00:00
class Item {
2022-05-29 12:12:05 +00:00
int id;
String mime;
int tagId;
2022-05-30 00:29:52 +00:00
String dest;
2022-05-29 12:12:05 +00:00
2022-05-13 15:57:28 +00:00
Item({
required this.id,
required this.mime,
2022-05-30 00:29:52 +00:00
this.tagId = 0,
this.dest = ''
2022-05-13 15:57:28 +00:00
});
factory Item.fromJson(Map<String, dynamic> data) {
return Item(
2022-05-29 12:12:05 +00:00
id: data['id'],
mime: data['mime'],
2022-05-30 00:29:52 +00:00
tagId: data['tag_id'] ?? 0,
dest: data['dest'] ?? ''
2022-05-13 15:57:28 +00:00
);
}
}