parser logic added

This commit is contained in:
davmar
2026-08-30 12:24:29 +02:00
parent 35d5c90d81
commit 3b698a3667
28 changed files with 3018 additions and 346 deletions
+9 -1
View File
@@ -3,7 +3,7 @@ library;
import 'dart:convert';
const int kBackupVersion = 1;
const int kBackupVersion = 2;
class BackupDocument {
const BackupDocument({
@@ -14,6 +14,8 @@ class BackupDocument {
required this.products,
required this.shops,
required this.shopItems,
required this.shoppingLists,
required this.shoppingListItems,
required this.images,
});
@@ -24,6 +26,8 @@ class BackupDocument {
final List<Map<String, Object?>> products;
final List<Map<String, Object?>> shops;
final List<Map<String, Object?>> shopItems;
final List<Map<String, Object?>> shoppingLists;
final List<Map<String, Object?>> shoppingListItems;
final Map<String, String> images;
Map<String, Object?> toJson() => {
@@ -35,6 +39,8 @@ class BackupDocument {
'products': products,
'shops': shops,
'shopItems': shopItems,
'shoppingLists': shoppingLists,
'shoppingListItems': shoppingListItems,
'images': images,
};
@@ -60,6 +66,8 @@ class BackupDocument {
products: _maps(decoded['products']),
shops: _maps(decoded['shops']),
shopItems: _maps(decoded['shopItems']),
shoppingLists: _maps(decoded['shoppingLists']),
shoppingListItems: _maps(decoded['shoppingListItems']),
images: _strings(decoded['images']),
);
}