From 9ee071cc26835b2ffa7d49dd338411fe9aed3fbc Mon Sep 17 00:00:00 2001 From: Tobe O Date: Thu, 21 Dec 2017 01:38:49 -0500 Subject: [PATCH] +1 --- CHANGELOG.md | 3 +++ analysis_options.yaml | 2 ++ lib/angel_file_service.dart | 4 ++-- pubspec.yaml | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) create mode 100644 analysis_options.yaml diff --git a/CHANGELOG.md b/CHANGELOG.md index fdc5dc8b..35e1653b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 1.1.0+1 +* Analyzer nitpick for pana + # 1.1.0 * Updated to framework v1.1.x * Use `package:file` diff --git a/analysis_options.yaml b/analysis_options.yaml new file mode 100644 index 00000000..518eb901 --- /dev/null +++ b/analysis_options.yaml @@ -0,0 +1,2 @@ +analyzer: + strong-mode: true \ No newline at end of file diff --git a/lib/angel_file_service.dart b/lib/angel_file_service.dart index 9f744eef..68cf130c 100644 --- a/lib/angel_file_service.dart +++ b/lib/angel_file_service.dart @@ -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({}, (out, k) => out..[k] = _safeForJson(map[k])); } -_revive(x) { +dynamic _revive(x) { if (x is Map) { return x.keys.fold({}, (out, k) => out..[k] = _revive(x[k])); } else if (x is Iterable) diff --git a/pubspec.yaml b/pubspec.yaml index 563a5fad..539c8d34 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -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 homepage: https://github.com/angel-dart/file_service