fetchBytes method
Silent download into memory. Not listed, not persisted, not resumable across restarts.
Implementation
Future<Uint8List> fetchBytes(
String url, {
Map<String, String> headers = const <String, String>{},
void Function(double progress)? onProgress,
int connections = 1,
}) async {
final UDownloadTask task = await enqueue(
UDownloadRequest(
url: url,
headers: headers,
destination: const UDownloadDestination.memory(),
visible: false,
persistent: false,
priority: UDownloadPriority.high,
connections: connections,
),
);
return _await(task, onProgress, (UDownloadTask t) => t.bytes!);
}