Flutter Downloader

pub package

A plugin for creating and managing download tasks. Supports iOS and Android.

This plugin is based on WorkManager in Android and NSURLSessionDownloadTask in iOS to run download task in background mode.

iOS integration

  • Open Xcode. Enable background mode.
  • Add following code to your AppDelegate (this method will be called when an URL session finished its work while your app is not running):
- (void)application:(UIApplication *)application handleEventsForBackgroundURLSession:(NSString *)identifier completionHandler:(void (^)(void))completionHandler {

Note: If you want to download file with HTTP request, you need to disable Apple Transport Security (ATS) feature.

  • Disable ATS for a specific domain only: (add following codes to the end of your Info.plist file)
      <!-- add this key to enable subdomains such as sub.yourserver.com -->
      <!-- add this key to allow standard HTTP requests, thus negating the ATS -->
      <!-- add this key to specify the minimum TLS version to accept -->
  • Completely disable ATS: (add following codes to the end of your Info.plist file)


import 'package:flutter_downloader/flutter_downloader.dart';

To create new download task:

final taskId = await FlutterDownloader.enqueue(
  url: 'your download link', 
  savedDir: 'the path of directory where you want to save downloaded files', 
  showNotification: true // show download progress in status bar (for Android)

To update download progress:

FlutterDownloader.registerCallback((id, status, progress) {
  // code to update your UI

To load the status of download tasks:

final tasks = await FlutterDownloader.loadTasks();

To cancel a task:

FlutterDownloader.cancel(taskId: taskId);

To cancel all tasks: