shareImage method
分享 - 图片
Implementation
@override
Future<void> shareImage({
String? text,
Uint8List? imageData,
Uri? imageUri,
}) {
assert(text == null || text.length <= 1024);
assert((imageData != null && imageData.lengthInBytes <= 2 * 1024 * 1024) ||
(imageUri != null &&
imageUri.isScheme('file') &&
imageUri.toFilePath().length <= 512 &&
File.fromUri(imageUri).lengthSync() <= 10 * 1024 * 1024));
return methodChannel.invokeMethod<void>(
'shareImage',
<String, dynamic>{
if (text != null && text.isNotEmpty) 'text': text,
if (imageData != null) 'imageData': imageData,
if (imageUri != null) 'imageUri': imageUri.toString(),
},
);
}