+1
This commit is contained in:
parent
39f48b3323
commit
9ee071cc26
4 changed files with 8 additions and 3 deletions
|
@ -1,3 +1,6 @@
|
||||||
|
# 1.1.0+1
|
||||||
|
* Analyzer nitpick for pana
|
||||||
|
|
||||||
# 1.1.0
|
# 1.1.0
|
||||||
* Updated to framework v1.1.x
|
* Updated to framework v1.1.x
|
||||||
* Use `package:file`
|
* Use `package:file`
|
||||||
|
|
2
analysis_options.yaml
Normal file
2
analysis_options.yaml
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
analyzer:
|
||||||
|
strong-mode: true
|
|
@ -32,7 +32,7 @@ class JsonFileService extends Service {
|
||||||
var contents = await file.readAsString();
|
var contents = await file.readAsString();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
var list = JSON.decode(contents) as List;
|
var list = JSON.decode(contents);
|
||||||
_store.items.clear(); // Clear exist in-memory copy
|
_store.items.clear(); // Clear exist in-memory copy
|
||||||
_store.items.addAll(list.map(_revive)); // Insert all new entries
|
_store.items.addAll(list.map(_revive)); // Insert all new entries
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
@ -110,7 +110,7 @@ Map _jsonify(Map map) {
|
||||||
return map.keys.fold<Map>({}, (out, k) => out..[k] = _safeForJson(map[k]));
|
return map.keys.fold<Map>({}, (out, k) => out..[k] = _safeForJson(map[k]));
|
||||||
}
|
}
|
||||||
|
|
||||||
_revive(x) {
|
dynamic _revive(x) {
|
||||||
if (x is Map) {
|
if (x is Map) {
|
||||||
return x.keys.fold<Map>({}, (out, k) => out..[k] = _revive(x[k]));
|
return x.keys.fold<Map>({}, (out, k) => out..[k] = _revive(x[k]));
|
||||||
} else if (x is Iterable)
|
} else if (x is Iterable)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
name: angel_file_service
|
name: angel_file_service
|
||||||
version: 1.1.0
|
version: 1.1.0+1
|
||||||
description: Angel service that persists data to a file on disk.
|
description: Angel service that persists data to a file on disk.
|
||||||
author: Tobe O <thosakwe@gmail.com>
|
author: Tobe O <thosakwe@gmail.com>
|
||||||
homepage: https://github.com/angel-dart/file_service
|
homepage: https://github.com/angel-dart/file_service
|
||||||
|
|
Loading…
Reference in a new issue