flutter_qiniu 0.1.3
flutter_qiniu: ^0.1.3

Flutter Android iOS

A flutter plugin for uploading files to Qiniu,support single image or multiple image uploads.

flutter_qiniu #

A new flutter plugin project for Qiniu.

Getting Started #

/// 单个文件上传
///
/// [file] 文件
/// [key] 保存在服务器上的资源唯一标识
/// [token] 服务器分配的 token
Future<String> _onUpload(File file, String key, String token) async {

    final qiniu = FlutterQiniu(zone: QNFixedZone.zone2);

    qiniu.onProgressChanged().listen((dynamic percent) {
        // 上传进度
        double p = percent;
    });

    String resultKey = await qiniu.upload(file.path, key, token);

    return resultKey;
}

/// 多个文件上传
Future<List<String>> _onUploadFiles(List<FilePathEntity> entities) async {
    final qiniu = FlutterQiniu(zone: QNFixedZone.zone1);
    List<String> resultKeys = await qiniu.uploadFiles(entities);

    return resultKeys;
}
4
likes
90
pub points
65%
popularity

A flutter plugin for uploading files to Qiniu,support single image or multiple image uploads.

Repository (GitHub)
View/report issues

Documentation

API reference

Uploader

icodd.cn@gmail.com

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_qiniu