Detail page with actual data from db

This commit is contained in:
marcoabat
2023-08-05 17:11:16 +02:00
parent ce57940c21
commit 6f8ee1a6ab
3 changed files with 31 additions and 9 deletions

View File

@@ -73,7 +73,19 @@ class DbHelper {
}
static Future<Checklist> getChecklistById(int id) async {
return ed.checklists.first;
final res = await _client
.from(checklistsTableName)
.select<Map<String, dynamic>>()
.eq('id', id)
.single();
return Checklist(
res['id'],
res['ownerId'],
res['title'],
res['description'],
DateTime.parse(res['createdTime']),
[],
);
}
static Future<void> addOrUpdateItem(