saveToFile method
Saves on a file (which path is fileFolder/fileName) the content in fileContent.
Before writing onto the file checks whether the file exists or not.
Implementation
Future<void> saveToFile(
final String fileFolder,
final String fileName,
final dynamic fileContent, {
final bool append = false,
final bool byteMode = false,
}) async {
final _file = await _openFile(fileFolder, fileName);
if (byteMode) {
await _file.writeAsBytes(fileContent as Uint8List);
} else if (append) {
await _file.writeAsString(fileContent, mode: FileMode.append);
} else {
await _file.writeAsString(fileContent);
}
}