Skip to content

Commit

Permalink
V9.1.0 release prep
Browse files Browse the repository at this point in the history
  • Loading branch information
781flyingdutchman committed Mar 2, 2025
1 parent 79cfa8b commit 63b2989
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## 9.1.0
* Adds `pauseAll`, `cancelAll` and `resumeAll`
* Improves handling `enqueuAll` to not starve the UI thread
* Fixes compilation bug in when compiling with XCode 16.2

## 9.0.0
* Introduces URI operations, including file/photo/video/directory pickers, under the `uri` property, and `UriDownloadTask` and `UriUploadTask`. See [Working with URIs](doc/URI.md).
* [Breaking] removes references to `asAndroidUri` - use the new methods on the `uri` property instead
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,8 @@ Parallel downloads do not support the use of URIs.
To enable pausing, set the `allowPause` field of the `Task` to `true`. This may also cause the task to `pause` un-commanded. For example, the OS may choose to pause the task if someone walks out of WiFi coverage.

To cancel, pause or resume a task, call:
* `cancel` to cancel a task
* `cancelAll` to cancel all tasks currently running, a specific list of tasks, or all tasks in a `group`.
* `cancelTaskWithId` to cancel the tasks with that taskId
* `cancelTasksWithIds` to cancel all tasks with a `taskId` in the provided list of taskIds
* `pause` to attempt to pause a task. Pausing is only possible for download GET requests, only if the `Task.allowPause` field is true, and only if the server supports pause/resume. Soon after the task is running (`TaskStatus.running`) you can call `taskCanResume` which will return a Future that resolves to `true` if the server appears capable of pause & resume. If it is not, then `pause` will have no effect and return false
Expand Down
1 change: 0 additions & 1 deletion example/integration_test/load_test.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
// ignore_for_file: avoid_print, empty_catches

import 'dart:io';
import 'dart:math';

import 'package:background_downloader/background_downloader.dart';
import 'package:flutter_test/flutter_test.dart';
Expand Down
6 changes: 6 additions & 0 deletions lib/src/file_downloader.dart
Original file line number Diff line number Diff line change
Expand Up @@ -500,6 +500,12 @@ interface class FileDownloader {
/// the registered callback, if requested
Future<bool> cancelTaskWithId(String taskId) => cancelTasksWithIds([taskId]);

/// Cancel this task
///
/// The task will emit a [TaskStatus.canceled] update to
/// the registered callback, if requested
Future<bool> cancel(Task task) => cancelTasksWithIds([task.taskId]);

/// Cancels all tasks, or those in [tasks], or all tasks in group [group]
///
/// Returns true if all cancellations were successful
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: background_downloader
description: A multi-platform background file downloader and uploader. Define the task, enqueue and monitor progress

version: 9.0.0
version: 9.1.0
repository: https://github.com/781flyingdutchman/background_downloader

environment:
Expand Down

0 comments on commit 63b2989

Please sign in to comment.