saveFile function
Saves a file
from data
string using encoding
.
encoding
If null uses UTF-8.
Implementation
Future<File> saveFile(File file, String data,
[Encoding encoding = utf8]) async {
return file.writeAsString(data, encoding: encoding, flush: true);
}