startDownload abstract method

Future<String> startDownload({
  1. required String fileUrl,
  2. required String savePath,
  3. Map<String, String>? headers,
})

Starts a file download operation in the background.

The download continues even if the app moves to the background. Progress can be tracked using getDownloadProgress.

Parameters:

  • fileUrl: The URL of the file to download
  • savePath: Local path where the downloaded file should be saved
  • headers: Optional HTTP headers to include in the request

Returns a task ID string that can be used to track progress or cancel the task.

Throws an Exception if the download fails to start.

Implementation

Future<String> startDownload({
  required String fileUrl,
  required String savePath,
  Map<String, String>? headers,
});