Closed KorionCN closed 5 years ago
when I call setItem to save my Json, throw NoSuchMethodError in _flush(), because _file is null. so, I modified my code like:
local_storage.ready.then((_){ local_storage.setItem(); })
It work normal, but finally I modified source code instead:
Future<void> _flush() async { final serialized = json.encode(_data); try { await ready; //just add this line await _file.writeAsString(serialized); ... }
I think it is more reasonable to do so.
when I call setItem to save my Json, throw NoSuchMethodError in _flush(), because _file is null. so, I modified my code like:
It work normal, but finally I modified source code instead:
I think it is more reasonable to do so.