copyUrlToLocalStorageWithProgress method
Downloads the file at url to targetName, emitting download progress
as integers from 0 to 100.
Implementation
@override
Stream<int> copyUrlToLocalStorageWithProgress(String url, String targetName) {
_getLocalFilePath(targetName).then(
(targetPath) => methodChannel.invokeMethod('copyUrlToLocalWithProgress', {
'url': url,
'targetPath': targetPath,
}),
);
return progressChannel
.receiveBroadcastStream()
.map((event) => event as int);
}