writeTo method
Writes the contents of the file to file at path
Implementation
Future<File> writeTo(String path, {Encoding encoding = utf8}) async {
final file = File(path);
IOSink sink = file.openWrite(encoding: encoding);
await for (String item in value) {
sink.write(item);
}
await sink.flush();
await sink.close();
return file;
}