downloadFile method

  1. @override
Future<FileInfo> downloadFile(
  1. String url, {
  2. String? key,
  3. Map<String, String>? authHeaders,
  4. bool force = false,
})
inherited

Download the file and add to cache

Implementation

@override
Future<FileInfo> downloadFile(String url,
    {String? key,
    Map<String, String>? authHeaders,
    bool force = false}) async {
  key ??= url;
  final fileResponse = await _webHelper
      .downloadFile(
        url,
        key: key,
        authHeaders: authHeaders,
        ignoreMemCache: force,
      )
      .firstWhere((r) => r is FileInfo);
  return fileResponse as FileInfo;
}