saveFile method
Saves binary data stream to storage at the specified file path
filePath
- Path where the file will be stored
data
- List of binary data to store
Returns the total size of the written data in bytes
Implementation
@override
Future<int> saveFile(String filePath, Stream<List<int>> data) async {
final file = _fileFor(filePath);
await file.parent.create(recursive: true);
return (await data.pipe(_LengthTrackingSink(file.openWrite()))) as int;
}