flutter_android_downloader 1.0.0 icon indicating copy to clipboard operation
flutter_android_downloader: ^1.0.0 copied to clipboard

PlatformAndroid

A plugin that uses the Android download manager

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:flutter_android_downloader/flutter_android_downloader.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    FlutterAndroidDownloader.listen((data) {
      print("success $data");
      // to do something
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        body: Center(
          child: IconButton(
            icon: Icon(Icons.file_download),
            onPressed: () {
              download();
            },
          ),
        ),
      ),
    );
  }

  void download() async {
    int id = await FlutterAndroidDownloader.download(
      "https://dl.hdslb.com/mobile/latest/iBiliPlayer-bili.apk?t=1582264529000",
      "/storage/emulated/0/Download",
      "bilibili.apk",
      'test',
      {},
    );
    print("ID => $id");
  }
}
8
likes
120
pub points
55%
popularity

Publisher

verified publisher iconbzqll.com

A plugin that uses the Android download manager

Repository (GitHub)

Documentation

API reference

License

Icon for licenses.MulanPSL-2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_android_downloader