Last updated:
0 purchases
flutter nos
flutter_nos #
Flutter 版的网易数帆对象存储直传 SDK,支持 Android & iOS。
开始使用 #
添加依赖:
dependencies:
flutter_nos: ^{latest_version}
copied to clipboard
用法 #
第一步,初始化:
final _nosUploader = FlutterNos();
@override
void initState() {
_nosUploader.init();
}
copied to clipboard
第二步,设置上传成功后的回调:
_nosUploader.setOnSuccess((message) {
// 上传成功
print('flutter_nos: ==============> upload success, message = $message');
});
copied to clipboard
第三步,调用上传接口:
// 先调用后端接口获取 token 数据
var nosToken = await getTokenRequest();
var bucketName = nosToken.bucketName ?? '';
var objName = nosToken.objName ?? '';
var uploadToken = nosToken.uploadToken ?? '';
var imagePath = _chosenPic;
// 开始上传图片
_nosUploader.uploadImage(bucketName, objName, uploadToken, imagePath);
copied to clipboard
具体示例请移步项目下的 example 文件夹。
欢迎提交 issue 和 PR 帮助完善该项目。
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.