cancelDownload static method
to cancel a download request by it's id
downloadId
the download task id to be canceled
Implementation
static Future<bool> cancelDownload(final int downloadId) async {
try {
final result = await _platform.invokeMethod('cancelDownload', {
'id': '$downloadId',
});
return result as bool;
} catch (e) {
debugPrint('downloadFile error: $e');
}
return false;
}