dreampad/lib/app/shared/utils/qiniu_utils.dart

20 lines
551 B
Dart
Raw Normal View History

2023-11-28 10:44:58 +08:00
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) {});
}
}