Sharing Content in Flutter with share_plus
Share text, links, and files from your Flutter app with share_plus — SharePlus.instance.share, result statuses, iPad positioning, and web fallback.
Published on • November 4, 2026
AI Assistant

“Share” is one of the most common mobile actions, and share_plus (v13.3.1 on pub.dev) covers Android, iOS, macOS, Windows, Linux, and Web through one API. This follows the package’s current interface: call SharePlus.instance.share() with a ShareParams object.
Sharing text and links
import 'package:share_plus/share_plus.dart';
Future<void> _share() async {
final result = await SharePlus.instance.share(
ShareParams(
text: 'Check out this article: https://blog.redlinesoft.net',
title: 'RedlineSoft Blog',
),
);
if (result.status == ShareResultStatus.dismissed) {
// User cancelled the share sheet.
}
}
ShareResultStatus reports success, dismissed, or unavailable — handle unavailable (no share target on the platform) with a fallback message.
Sharing files
Pass files: with XFile paths (from cross_file):
await SharePlus.instance.share(
ShareParams(
files: [XFile('assets/report.pdf')],
text: 'Monthly report attached',
),
)
iPad positioning
On iPad, the share sheet anchors to a rectangle — without it, the sheet misbehaves. Attach sharePositionOrigin:
final box = context.findRenderObject() as RenderBox?;
final origin = box!.localToGlobal(Offset.zero) & box.size;
await SharePlus.instance.share(
ShareParams(
text: 'Shared from my app',
sharePositionOrigin: origin,
),
)
Platform notes
- Web: uses the Web Share API when available; otherwise falls back to copying to the clipboard or showing a dialog.
- macOS/Windows: shares via the native share dialog or file manager integration.
- Android 10+: file shares go through the
FileProvider— share_plus configures this for you in the plugin’s setup.
Takeaway: SharePlus.instance.share(ShareParams(...)) gives you one API for text, links, and files across every platform — check ShareResultStatus, pass sharePositionOrigin on iPad, and handle the Web Share API fallback on web.