dreampad/lib/app/shared/utils/qiniu_utils.dart
2023-11-28 10:45:09 +08:00

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) {});
}
}