fluttercommunity / fluttercommunity/flutter_downloader
`background_downloader` – alternative to this plugin
- Dominant language
- Kotlin
- Stars
- 940
- Forks
- 561
- Avg merge
- 1h 18m
- Merged PRs (30d)
- 1
Description
I've used flutter_downloader and contributed a few improvements, but have found the plugin as a whole has too many issues that make it difficult to use. I've written an alternative, [background_downloader](https://pub.dev/packages/background_downloader), and would like this community's feedback on:
1. The background_downloader plugin functionality
2. Whether we could consider the background_downloader as V2.0 of the flutter_downloader. I have no strong preference for this, as I am happily using it myself, but I see lots of issues posted for flutter_downloader, and because it is the top result when searching on Pub Dev for a downloader, I could see others benefiting from a reliable V2.0.
Here's what I believe background_downloader has over flutter_downloader:
1. Supports **more platforms** (iOS, Android, MacOS, WIndows, Linux) fixing #391 #617 #651
2. Is **consistent in behavior** across all platforms, so no need at all for platform-specific code like `if (Platform.isAndoid)`
3. Is **thoroughly tested**: currently ~~53~~ 71 integration tests pass on all platforms (versus flutter_downloader currently looking at 275 open issues, of which 46 are bugs, many due to the complexity and inconsistency of the code and API)
4. Offer **downloads, uploads and HTTP requests** using a simple API, fixing #410
5. Offers **three ways to monitor a task**: 1) anonymous callback when you make a `download` or `upload` call, 2) listen to a single `updates` stream where all tasks can be monitored centrally, or 3) register callbacks for all tasks or by group of tasks. In all cases, you can choose to monitor status (e.g. `failed`) and/or progress (% of file downloaded)
6. Offers **batch downloads and uploads** with batch progress monitoring
7. Has a **built-in retries** (if you want those), waiting for WiFi availability, headers, url query parameters, support for POST requests, and metadata
8. Has solid **queue management** (query queue to get list of running task, cancelling tasks, etc), without needing a SQL database in each platform
9. Has a **clean and consistent API**: no need for initialization, no `@pragma-vm` or isolate voodoo
10. Is **fast and reliable**. I use it to download >1000 files in one queue, and also to download multiple 50Mb files in parallel in the background and have no issues. Feedback from other users so far has been positive.
11. Is well **documented**
Here's what it doesn't do that flutter_downloader does, and why I chose not to:
1. ~~Android **notification** while downloading. This is Android-specific functionality (violates benefit 2 above), adds tremendous complexity (see all the issues!) and it's trivial to implement a progress indicator in Flutter that shows when your app is in the foreground (see the example app)~~ Notifications for Android and iOS are now supported in version 5.3.0, and work with Android 13
2. ~~Storing in Android **external Files directory**. Again this is Android specific (violates benefit 2 above) and is trivial to implement if you really need it by simply moving the file to that destination upon completion of the download~~ Scoped storage on Android implemented in version 5.4.0 and platform-dependent on other platforms
3. ~~**Opening a file** from the notification. I consider that not a download functionality but a 'what do you do with a downloaded file' functionality, and it therefore does not belong in a downloader. If you need this, I think we could develop a separate package that does that (it may already exist)~~ Implemented in V5.6.0
4. ~~**Database**. I believe one should monitor tasks via callbacks, and use queue management (which is available) in exceptional cases (e.g. upon start-up). Losing a complex SQL database (implemented on every platform) that is the cause of many issues in flutter_downloader is an advantage~~ Database is now supported in version 4.1.0
5. ~~**Pause** a task, or do partial download and **resume**. These are edge cases, add complexity and have disadvantages, so I don't think they are worth implementing~~ Pause/resume is now supported in version 5.0.0
I may have missed a few differences. Point is that if this were to become V2.0 there would be a significant improvement in functionality (IMHO), but also some regression that I don't believe we should fix (e.g. we should not try to implement notifications, external files directory etc. or we'll end up with a rather messy API and inconsistent implementations across platforms again). Some users may be disappointed (though they could continue to use the V1 branch of flutter_downloader).
Again, not trying to push this onto the community, just looking for feedback and offering this as an option. Looking forward to your thoughts.
@bartekpacia thanks for taking over as the maintainer of flutter_downloader: I know it's a lot of work!
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing the proposal in issue #823 and the 22-comment discussion, then compare the listed background_downloader capabilities and trade-offs with flutter_downloader. No source file or test entry point is named; done would require an explicit community or maintainer decision on whether this should become a V2.0 direction.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, ios, kotlin
- Domain
- desktop-dev, mobile-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100