writeTo method

Future<File> writeTo(
  1. String path
)
override

Writes the contents of the file to file at path

Implementation

Future<File> writeTo(String path) async {
  final file = File(path);
  IOSink sink = file.openWrite();
  await for (List<int> item in value) {
    sink.add(item);
  }
  await sink.flush();
  await sink.close();
  return file;
}