share method
Summons the platform's share sheet to share text.
Implementation
@override
Future<ShareResult> share(
String text, {
String? subject,
Rect? sharePositionOrigin,
}) async {
assert(text.isNotEmpty);
final params = <String, dynamic>{
'text': text,
'subject': subject,
};
if (sharePositionOrigin != null) {
params['originX'] = sharePositionOrigin.left;
params['originY'] = sharePositionOrigin.top;
params['originWidth'] = sharePositionOrigin.width;
params['originHeight'] = sharePositionOrigin.height;
}
final result = await channel.invokeMethod<String>('share', params) ??
'dev.fluttercommunity.plus/share/unavailable';
return ShareResult(result, _statusFromResult(result));
}