20 lines
551 B
Dart
20 lines
551 B
Dart
import 'dart:io';
|
|
|
|
import 'package:qiniu_flutter_sdk/qiniu_flutter_sdk.dart';
|
|
|
|
class QiniuUtils {
|
|
static Future putFile(String path, String token) async {
|
|
var storage = Storage();
|
|
var putController = PutController();
|
|
putController.addStatusListener((StorageStatus status) {});
|
|
await storage
|
|
.putFile(File(path), token,
|
|
options: PutOptions(
|
|
forceBySingle: true,
|
|
controller: putController,
|
|
))
|
|
.then((PutResponse response) {})
|
|
.catchError((onError) {});
|
|
}
|
|
}
|