second draft
This commit is contained in:
@@ -3,12 +3,14 @@ class Liste {
|
||||
String title;
|
||||
final String owner;
|
||||
List<String> members;
|
||||
String? layoutId;
|
||||
|
||||
Liste({
|
||||
required this.id,
|
||||
required this.title,
|
||||
required this.owner,
|
||||
required this.members,
|
||||
this.layoutId,
|
||||
});
|
||||
|
||||
factory Liste.fromJson(Map<String, dynamic> json) {
|
||||
@@ -17,6 +19,7 @@ class Liste {
|
||||
title: json['title'] as String,
|
||||
owner: json['owner'] as String? ?? '',
|
||||
members: List<String>.from(json['members'] as List? ?? []),
|
||||
layoutId: json['layout'] as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -26,12 +29,14 @@ class Item {
|
||||
String name;
|
||||
bool checked;
|
||||
int position;
|
||||
String? sectionId;
|
||||
|
||||
Item({
|
||||
required this.id,
|
||||
required this.name,
|
||||
this.checked = false,
|
||||
this.position = 0,
|
||||
this.sectionId,
|
||||
});
|
||||
|
||||
factory Item.fromJson(Map<String, dynamic> json) {
|
||||
@@ -42,6 +47,7 @@ class Item {
|
||||
position: (json['position'] is int)
|
||||
? json['position']
|
||||
: int.tryParse(json['position'].toString()) ?? 0,
|
||||
sectionId: json['section'] as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -90,14 +96,12 @@ class StoreSection {
|
||||
final String layoutId;
|
||||
String name;
|
||||
int position;
|
||||
String? category;
|
||||
|
||||
StoreSection({
|
||||
required this.id,
|
||||
required this.layoutId,
|
||||
required this.name,
|
||||
this.position = 0,
|
||||
this.category,
|
||||
});
|
||||
|
||||
factory StoreSection.fromJson(Map<String, dynamic> json) {
|
||||
@@ -111,7 +115,6 @@ class StoreSection {
|
||||
layoutId: json['layout'] as String? ?? '',
|
||||
name: json['name'] as String? ?? '',
|
||||
position: parsePosition(json['position']),
|
||||
category: json['category'] as String?,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user