shareImage static method
分享图片
path 与 bytes 二选一,不符合则抛出 FormatException 异常
name图片名称
path图片路径
bytes图片字节
text分享内容
subject分享主题
Implementation
static Future<bool> shareImage({
required String name,
String? path,
Uint8List? bytes,
String? text,
String? subject,
}) async {
XFile file = await _createFile(name, path, bytes);
final files = <XFile>[file];
ShareResult result = await Share.shareXFiles(files, text: text, subject: subject);
return result.status == ShareResultStatus.success;
}