shareText function

Future<void> shareText(
  1. String text, {
  2. Rect? origin,
})

origin anchors the sheet so iPad's popover-based presentation doesn't crash.

Implementation

Future<void> shareText(String text, {Rect? origin}) async {
  await SharePlus.instance.share(
    ShareParams(text: text, sharePositionOrigin: origin),
  );
}