【发布时间】:2021-10-27 17:14:09
【问题描述】:
我正在将我的图片上传到 cloudinary
final res = await cloudinary.uploadFile(
CloudinaryFile.fromFile(
_pickedFile.path,
folder: 'hello-folder',
context: {
'alt': 'Hello',
'caption': 'An example image',
},
),
);
print('my res *** $res');
上传图片后,它的打印分辨率 结果
my res *** {asset_id: adasdasdasdasd, public_id: hello-folder/asdasdasd, created_at: 2021-08-27 20:04:45.000Z, url: http://res.cloudinary.com/dqunmzmqo/image/upload/v1630094685/hello-folder/d2eoasynxhj5llhb1p9e.jpg, secure_url: https://res.cloudinary.com/dqunmzmqo/image/upload/v1630094685/hello-folder/d2eoasynxhj5llhb1p9e.jpg, original_filename: 6b81c53d-7602-4bea-9ea1-1eaef1491144, tags: [], context: {custom: {alt: Hello, caption: An example image}}}
我想从 res 变量中获取 url
【问题讨论】:
-
我认为回复会像
{"asset_id": "adasdasdasdasd",.......}。缺少双引号?
标签: flutter dart cloudinary