defaultOnShare static method

void defaultOnShare(
  1. BuildContext context,
  2. BrowserController controller
)

Default value of onShare.

This function displays a platform-specific URL sharing dialog.

Implementation

static void defaultOnShare(
    BuildContext context, BrowserController controller) {
  if (kIsWeb) {
    final browser = Browser.of(context);
    browser.isBottomShareDialogOpen = !browser.isBottomShareDialogOpen;
    return;
  }
  final box = context.findRenderObject() as RenderBox?;
  share_plus.Share.share(
    controller.uriString,
    sharePositionOrigin: box!.localToGlobal(Offset.zero) & box.size,
  );
}