A flutter plugin for Qiniu object storage sdk. Support the flexible configuration, progress and complete the callback.
Note: This plugin is still under development, and some APIs might not be available yet. Feedback welcome and Pull Requests are most welcome!
- Android
- iOS
- Android:
qiniu-android-sdk:7.3.15
- iOS:
First, add flutter_qiniu_sdk
as a dependency in your pubspec.yaml file.
- Configuration
import 'package:flutter_qiniu_sdk/flutter_qiniu_sdk.dart';
var conf = ConfigBuilder()
..enableRecord = true // enable breakpoint resume
..zone = Zone.autoZone // select zone service
..useHttps = true; // enable https
Qiniu.config(conf.build);
- Upload file
Qiniu.put(key, token, filepath, onProgress: (String key, double percent) {
debugPrint("onProgress: $key, $percent");
}, onComplete: (String key, ResponseInfo info, String response) {
debugPrint("onComplete: $key, $info, $response");
});
- Cancel upload task
Qiniu.cancel(key);