【发布时间】:2020-06-01 14:26:34
【问题描述】:
所以我需要使用 Flutter 将图像共享给另一个应用程序,我使用 esys_flutter_share 1.0.2 插件
Future<void> _shareImage(int index) async {
final filename = _imageList[index].split("/")[2];
try {
final ByteData bytes = await rootBundle.load(_imageList[index]);
await Share.file(
'esys image', 'esys.png', bytes.buffer.asUint8List(), 'image/png',
text: '$filename');
} catch (e) {
print('error: $e');
}
}
这是来自示例页面的相同代码,将我的图像从我的应用程序共享到另一个应用程序 Android/Ios 无法识别作为图像并作为文本共享的 mimeType 的唯一问题(在 Ios 模拟器和即使在真正的 ios 手机上)
Screenshot of the problem Screenshot how i need it
试过 'image/png' 、 'image/jpg' ecc,总是像文本文件一样共享文件。
【问题讨论】:
标签: flutter dart mime-types