readFile method
Retrieves binary data stream from storage at the specified file path
filePath
- Path of the file to read
Returns a stream of binary data
Implementation
@override
Stream<Uint8List> readFile(String filePath, {String? mediaType}) async* {
final file = _fileFor(filePath);
if (!await file.exists()) {
throw FileSystemException('File does not exist', filePath);
}
final source = file.openRead();
await for (final chunk in source) {
yield chunk is Uint8List ? chunk : Uint8List.fromList(chunk);
}
}