computeFileHash method
Computes SHA256 hash of a file by reading it in chunks Returns stream updates with progress and a final event containing FileHashProgress.hash
Implementation
@override
Stream<FileHashProgress> computeFileHash(String filePath) async* {
final file = File(filePath);
if (!await file.exists()) {
throw PathNotFoundException(
'Cannot open file',
OSError('No such file or directory', 2),
filePath,
);
}
yield* IsolateManager.instance
.runInComputeIsolateStream<String, FileHashProgress>(
_computeFileHashTask,
filePath,
);
}