load method

Future<void> load()

Implementation

Future<void> load() async {
  if (_loaded) return;
  _loaded = true;
  try {
    final File? file = await _file();
    if (file == null || !file.existsSync()) return;
    final Object? decoded = jsonDecode(await file.readAsString());
    if (decoded is! Map<String, Object?>) return;
    decoded.forEach((String key, Object? value) {
      if (value is Map<String, Object?>) _entries[key] = UDocProgress.fromJson(value);
    });
    notifyListeners();
  } on Object {
    return;
  }
}