enqueueDownload<T> method
- Future<
T> action()
Implementation
Future<T> enqueueDownload<T>(Future<T> Function() action) {
final completer = Completer<T>();
_serialDownloadTail = _serialDownloadTail.catchError((_) {}).then(
(_) async {
try {
completer.complete(await action());
} catch (error, stackTrace) {
completer.completeError(error, stackTrace);
}
},
);
return completer.future;
}