2021-09-19 12:59:45 +02:00
|
|
|
abstract class FileDownloader {
|
|
|
|
/// Download a file
|
|
|
|
///
|
|
|
|
/// The return data depends on the platform
|
|
|
|
/// - web: null
|
|
|
|
/// - android: Uri to the downloaded file
|
|
|
|
///
|
2021-09-29 16:34:56 +02:00
|
|
|
/// [parentDir] is a hint that set the parent directory where the files are
|
|
|
|
/// saved. Whether this is supported or not is implementation specific
|
|
|
|
///
|
2021-09-19 12:59:45 +02:00
|
|
|
/// [shouldNotify] is a hint that suggest whether to notify user about the
|
|
|
|
/// progress. The actual decision is made by the underlying platform code and
|
|
|
|
/// is not guaranteed to respect this flag
|
|
|
|
Future<dynamic> downloadUrl({
|
|
|
|
required String url,
|
|
|
|
Map<String, String>? headers,
|
|
|
|
String? mimeType,
|
|
|
|
required String filename,
|
2021-09-29 16:34:56 +02:00
|
|
|
String? parentDir,
|
2021-09-19 12:59:45 +02:00
|
|
|
bool? shouldNotify,
|
|
|
|
});
|
|
|
|
}
|