download method

  1. @override
Future<int> download(
  1. Uri url,
  2. File destination
)
override

Downloads url into destination and returns the number of bytes written.

Throws DioException on an HTTP error status or a network failure.

Implementation

@override
Future<int> download(final Uri url, final File destination) async {
  await _dio.downloadUri(url, destination.path);

  return destination.length();
}