Project Name | Stars | Downloads | Repos Using This | Packages Using This | Most Recent Commit | Total Releases | Latest Release | Open Issues | License | Language |
---|---|---|---|---|---|---|---|---|---|---|
Youtube Music | 3,141 | 2 days ago | 259 | mit | JavaScript | |||||
YouTube Music Desktop App bundled with custom plugins (and built-in ad blocker / downloader) | ||||||||||
Flutter_downloader | 814 | 22 | 1 | 19 days ago | 53 | May 26, 2022 | 280 | bsd-3-clause | Kotlin | |
Flutter Downloader - A plugin for creating and managing download tasks. Maintainer: @bartekpacia | ||||||||||
Happypandax | 743 | 3 days ago | 85 | lgpl-3.0 | JavaScript | |||||
A cross-platform server and client application for managing and reading manga and doujinshi | ||||||||||
Gradle Download Task | 602 | 64 | 11 | 3 days ago | 34 | May 04, 2022 | 4 | apache-2.0 | Java | |
📥 Adds a download task to Gradle that displays progress information | ||||||||||
Fanficfare | 587 | 6 days ago | 107 | June 01, 2022 | 27 | other | Python | |||
FanFicFare is a tool for making eBooks from stories on fanfiction and other web sites. | ||||||||||
Keepass Yet Another Favicon Downloader | 396 | a year ago | 9 | mit | C# | |||||
Yet Another Favicon Downloader for KeePass 2.x | ||||||||||
Mangaripper | 159 | 2 years ago | 21 | mit | C# | |||||
This software helps you download manga (Japanese Comic) from several websites for your offline viewing. | ||||||||||
Mymanga | 66 | 5 years ago | 12 | gpl-3.0 | C# | |||||
Manga downloader and reader for Windows 7/8.1/10. Written in C# with a clean and simple WPF interface. | ||||||||||
Cordova Plugin Apkupdater | 62 | 4 months ago | 24 | December 10, 2021 | mit | Java | ||||
This plugin allows your Android app to download and install compressed updates without the Google Play Store. | ||||||||||
Mindl | 44 | 6 years ago | 5 | December 21, 2016 | 11 | agpl-3.0 | Go | |||
A downloader for various sites and services. |
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.
Note: following steps requires to open your ios
project in Xcode.
sqlite
library.
AppDelegate
:Objective-C:
/// AppDelegate.h
#import <Flutter/Flutter.h>
#import <UIKit/UIKit.h>
@interface AppDelegate : FlutterAppDelegate
@end
// AppDelegate.m
#include "AppDelegate.h"
#include "GeneratedPluginRegistrant.h"
#include "FlutterDownloaderPlugin.h"
@implementation AppDelegate
void registerPlugins(NSObject<FlutterPluginRegistry>* registry) {
if (![registry hasPlugin:@"FlutterDownloaderPlugin"]) {
[FlutterDownloaderPlugin registerWithRegistrar:[registry registrarForPlugin:@"FlutterDownloaderPlugin"]];
}
}
- (BOOL)application:(UIApplication *)application
didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[GeneratedPluginRegistrant registerWithRegistry:self];
[FlutterDownloaderPlugin setPluginRegistrantCallback:registerPlugins];
// Override point for customization after application launch.
return [super application:application didFinishLaunchingWithOptions:launchOptions];
}
@end
Or Swift:
import UIKit
import Flutter
import multi_downloader
@UIApplicationMain
@objc class AppDelegate: FlutterAppDelegate {
override func application(
_ application: UIApplication,
didFinishLaunchingWithOptions launchOptions: [UIApplication.LaunchOptionsKey: Any]?
) -> Bool {
GeneratedPluginRegistrant.register(with: self)
FlutterDownloaderPlugin.setPluginRegistrantCallback(registerPlugins)
return super.application(application, didFinishLaunchingWithOptions: launchOptions)
}
}
private func registerPlugins(registry: FlutterPluginRegistry) {
if (!registry.hasPlugin("FlutterDownloaderPlugin")) {
FlutterDownloaderPlugin.register(with: registry.registrar(forPlugin: "FlutterDownloaderPlugin"))
}
}
Info.plist
file)<key>NSAppTransportSecurity</key>
<dict>
<key>NSExceptionDomains</key>
<dict>
<key>www.yourserver.com</key>
<dict>
<!-- add this key to enable subdomains such as sub.yourserver.com -->
<key>NSIncludesSubdomains</key>
<true/>
<!-- add this key to allow standard HTTP requests, thus negating the ATS -->
<key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
<true/>
<!-- add this key to specify the minimum TLS version to accept -->
<key>NSTemporaryExceptionMinimumTLSVersion</key>
<string>TLSv1.1</string>
</dict>
</dict>
</dict>
Info.plist
file)<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key><true/>
</dict>
Info.plist
file.<!-- changes this number to configure the maximum number of concurrent tasks -->
<key>FDMaximumConcurrentTasks</key>
<integer>5</integer>
Info.plist
file. (you can find the detail of Info.plist
localization in this link)<key>FDAllFilesDownloadedMessage</key>
<string>All files have been downloaded</string>
Note:
NSDocumentDirectory
If your project is running on Flutter versions prior v1.12, have a look at this document to configure your Android project.
From Flutter v1.12 with Android v2 embedding there's no additional configurations required to work with background isolation in Android (but you need to setup your project properly. See upgrading pre 1.12 Android projects)
In order to handle click action on notification to open the downloaded file on Android, you need to add some additional configurations. Add the following codes to your AndroidManifest.xml
:
<provider
android:name="vn.hunghd.flutterdownloader.DownloadedFileProvider"
android:authorities="${applicationId}.multi_downloader.provider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="@xml/provider_paths"/>
</provider>
Note:
WorkManager
library and WorkManager
depends on the number of available processor to configure the maximum number of tasks running at a moment. You can setup a fixed number for this configuration by adding following codes to your AndroidManifest.xml
: <provider
android:name="androidx.work.impl.WorkManagerInitializer"
android:authorities="${applicationId}.workmanager-init"
android:enabled="false"
android:exported="false" />
<provider
android:name="vn.hunghd.flutterdownloader.FlutterDownloaderInitializer"
android:authorities="${applicationId}.flutter-downloader-init"
android:exported="false">
<!-- changes this number to configure the maximum number of concurrent tasks -->
<meta-data
android:name="vn.hunghd.flutterdownloader.MAX_CONCURRENT_TASKS"
android:value="5" />
</provider>
<string name="multi_downloader_notification_started">Download started</string>
<string name="multi_downloader_notification_in_progress">Download in progress</string>
<string name="multi_downloader_notification_canceled">Download canceled</string>
<string name="multi_downloader_notification_failed">Download failed</string>
<string name="multi_downloader_notification_complete">Download complete</string>
<string name="multi_downloader_notification_paused">Download paused</string>
REQUEST_INSTALL_PACKAGES
permission. Add following codes in your AndroidManifest.xml
:<uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES" />
import 'package:multi_downloader/multi_downloader.dart';
WidgetsFlutterBinding.ensureInitialized();
await FlutterDownloader.initialize();
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)
openFileFromNotification: true, // click on notification to open downloaded file (for Android)
);
FlutterDownloader.registerCallback(callback); // callback is a top-level or static function
Important note: your UI is rendered in the main isolate, while download events come from a background isolate (in other words, codes in callback
are run in the background isolate), so you have to handle the communication between two isolates. For example:
ReceivePort _port = ReceivePort();
@override
void initState() {
super.initState();
IsolateNameServer.registerPortWithName(_port.sendPort, 'downloader_send_port');
_port.listen((dynamic data) {
String id = data[0];
DownloadTaskStatus status = data[1];
int progress = data[2];
setState((){ });
});
FlutterDownloader.registerCallback(downloadCallback);
}
@override
void dispose() {
IsolateNameServer.removePortNameMapping('downloader_send_port');
super.dispose();
}
static void downloadCallback(String id, DownloadTaskStatus status, int progress) {
final SendPort send = IsolateNameServer.lookupPortByName('downloader_send_port');
send.send([id, status, progress]);
}
final tasks = await FlutterDownloader.loadTasks();
final tasks = await FlutterDownloader.loadTasksWithRawQuery(query: query);
DownloadTask
object successfully, you should load data with all fields from DB (in the other word, use: SELECT *
). For example:SELECT * FROM task WHERE status=3
task
table where this plugin stores tasks informationCREATE TABLE `task` (
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
`task_id` VARCHAR ( 256 ),
`url` TEXT,
`status` INTEGER DEFAULT 0,
`progress` INTEGER DEFAULT 0,
`file_name` TEXT,
`saved_dir` TEXT,
`resumable` TINYINT DEFAULT 0,
`headers` TEXT,
`show_notification` TINYINT DEFAULT 0,
`open_file_from_notification` TINYINT DEFAULT 0,
`time_created` INTEGER DEFAULT 0
);
FlutterDownloader.cancel(taskId: taskId);
FlutterDownloader.cancelAll();
FlutterDownloader.pause(taskId: taskId);
FlutterDownloader.resume(taskId: taskId);
resume()
will return a new taskId
corresponding to a new background task that is created to continue the download process. You should replace the original taskId
(that is marked as paused
status) by this new taskId
to continue tracking the download progress.FlutterDownloader.retry(taskId: taskId);
retry()
will return a new taskId
(like resume()
)FlutterDownloader.remove(taskId: taskId, shouldDeleteContent:false);
FlutterDownloader.open(taskId: taskId);
If you encounter any problems feel free to open an issue. If you feel the library is missing a feature, please raise a ticket on Github. Pull request are also welcome.