shareUri method
Shares a uri
via a method channel which opens the platform-specific
interface.
Implementation
@override
Future<ShareResult> shareUri(Uri uri, {String? subject, Rect? shareOrigin}) async {
final result = (await methodChannel.invokeMethod<Map<dynamic, dynamic>>(
'shareUri',
{
'uri': uri.toString(),
'subject': subject,
if (shareOrigin != null) 'shareOriginX': shareOrigin.left,
if (shareOrigin != null) 'shareOriginY': shareOrigin.top,
if (shareOrigin != null) 'shareOriginW': shareOrigin.width,
if (shareOrigin != null) 'shareOriginH': shareOrigin.height,
},
))!;
return ShareResult(
result["success"],
result["uri"] != null ? Uri.tryParse(result["uri"]) ?? uri : uri,
target: result["target"],
);
}