shareText function

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

Opens the system share sheet; origin anchors it so the iPad popover doesn't crash.

Implementation

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