This commit is contained in:
Tobe O 2017-12-21 01:38:49 -05:00
parent 39f48b3323
commit 9ee071cc26
4 changed files with 8 additions and 3 deletions

View file

@ -1,3 +1,6 @@
# 1.1.0+1
* Analyzer nitpick for pana
# 1.1.0
* Updated to framework v1.1.x
* Use `package:file`

2
analysis_options.yaml Normal file
View file

@ -0,0 +1,2 @@
analyzer:
strong-mode: true

View file

@ -32,7 +32,7 @@ class JsonFileService extends Service {
var contents = await file.readAsString();
try {
var list = JSON.decode(contents) as List;
var list = JSON.decode(contents);
_store.items.clear(); // Clear exist in-memory copy
_store.items.addAll(list.map(_revive)); // Insert all new entries
} catch (e) {
@ -110,7 +110,7 @@ Map _jsonify(Map map) {
return map.keys.fold<Map>({}, (out, k) => out..[k] = _safeForJson(map[k]));
}
_revive(x) {
dynamic _revive(x) {
if (x is Map) {
return x.keys.fold<Map>({}, (out, k) => out..[k] = _revive(x[k]));
} else if (x is Iterable)

View file

@ -1,5 +1,5 @@
name: angel_file_service
version: 1.1.0
version: 1.1.0+1
description: Angel service that persists data to a file on disk.
author: Tobe O <thosakwe@gmail.com>
homepage: https://github.com/angel-dart/file_service