save method
Saves the given simple object as JSON. If the file exists, it will be overwritten.
Implementation
Future<File> save(Object? simpleObj) async {
_checkIfFileSystemIsTheSame();
Uint8List encoded = encodeJson(simpleObj);
File file = _file ?? await this.file();
await file.create(recursive: true);
return file.writeAsBytes(
encoded,
flush: true,
mode: FileMode.writeOnly,
);
}