diff --git a/lib/app/data/db/service_tokens_dao.dart b/lib/app/data/db/service_tokens_dao.dart index a94a108..4db1cb8 100644 --- a/lib/app/data/db/service_tokens_dao.dart +++ b/lib/app/data/db/service_tokens_dao.dart @@ -21,6 +21,21 @@ class ServiceTokensDao { service_provider_id TEXT ); '''); + + // format data + final string = await rootBundle.loadString( + 'assets/files/service_tokens.json', + ); + final List list = json.decode(utf8.decode(base64.decode(string))); + final Batch batch = db.batch(); + for (final map in list) { + batch.insert( + table, + map, + conflictAlgorithm: ConflictAlgorithm.ignore, + ); + } + await batch.commit(); } static Future onUpgrade( diff --git a/lib/app/data/db/service_vendors_dao.dart b/lib/app/data/db/service_vendors_dao.dart index 9525c9f..960c5b6 100644 --- a/lib/app/data/db/service_vendors_dao.dart +++ b/lib/app/data/db/service_vendors_dao.dart @@ -29,6 +29,19 @@ class ServiceVendorsDao { block INTEGER DEFAULT 0 ); '''); + + // format data + final string = await rootBundle.loadString( + 'assets/files/service_vendors.json', + ); + final List list = json.decode(utf8.decode(base64.decode(string))); + for (final map in list) { + await db.insert( + table, + map, + conflictAlgorithm: ConflictAlgorithm.ignore, + ); + } } static Future onUpgrade( diff --git a/pubspec.yaml b/pubspec.yaml index 49496de..204012c 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,5 +1,5 @@ name: answer -version: 1.1.0+12 +version: 1.1.1+16 publish_to: none description: A new Flutter project. environment: