flutter_android_downloader 1.0.0
flutter_android_downloader: ^1.0.0 copied to clipboard

A plugin that uses the Android download manager

Flutter Android Downloader #

Pub

flutter_android_downloader 一个调用安卓系统下载管理器的插件

添加依赖 #

dependencies:
  flutter_android_downloader: ^1.0.0

创建下载 #

int downloadId = FlutterAndroidDownloader.download("url", "path", "fileName","originName","headers");

参数说明

参数参数类型说明
urlString下载地址
pathString下载路径,Android10及以上默认下载到内置存储目录的Download文件夹
fileNameString保存的文件名称
originNameString下载来源名称
headersMap<String,String>请求头,参数可选

监听下载完成回调信息 #

FlutterAndroidDownloader.listen((id) {
  print("success $id");
  // to do something
});

完整使用示例 #

FlutterAndroidDownloader.listen((id) {
  print("success $id");
});

void download() async {
    int id = await FlutterAndroidDownloader.download(
        "https://qd.myapp.com/myapp/qqteam/AndroidQQ/mobileqq_android.apk",
        "/ABC",
        "qq.apk",
        "QQ",
        {}
    );
    print("ID => $id");
}

6
likes
90
pub points
67%
popularity

Publisher

bzqll.com

A plugin that uses the Android download manager

Repository (GitHub)
View/report issues

Documentation

API reference

License

LICENSE

Dependencies

flutter

More

Packages that depend on flutter_android_downloader