Skip to content

Commit

Permalink
fix: PathNotFoundException when save akashi_schedule.json (#321)
Browse files Browse the repository at this point in the history
  • Loading branch information
andychucs authored Aug 23, 2024
1 parent ae08f0b commit 6daaff3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/providers/generatable/kancolle_item_data_provider.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@ class KancolleItemData extends _$KancolleItemData {

Future<void> _saveLocalData(AkashiSchedule akashiSchedule) async {
final file = await _localJsonFile;
final directory = file.parent;
if (!directory.existsSync()) {
directory.createSync(recursive: true);
}
await file.writeAsString(jsonEncode(akashiSchedule.toJson()));
}

Expand Down

0 comments on commit 6daaff3

Please sign in to comment.