writeFileStream method
Writes a stream of bytes to a file at the given path Creates the file if it doesn't exist, overwrites if it does
Implementation
@override
Future<void> writeFileStream(
String filePath, Stream<Uint8List> dataStream) async {
final file = File(filePath);
await file.create(recursive: true);
final sink = file.openWrite();
await for (final chunk in dataStream) {
sink.add(chunk);
}
await sink.flush();
await sink.close();
}