share_intent_package 1.0.18
share_intent_package: ^1.0.18 copied to clipboard
Zero-configuration Flutter share intent plugin. Receive shared content from other apps with one-command setup. Fully automated iOS ShareExtension + Android intent filters.
Share Intent Package #
The easiest Flutter share intent plugin. Receive text, images, videos, and documents from other apps with ZERO MANUAL CONFIGURATION.
🚀 One Command Setup #
# Add to pubspec.yaml
flutter pub add share_intent_package
# iOS - Fully Automatic
setup_ios_clean
# Android - Fully Automatic
setup_android
✅ No Xcode configuration
✅ No AndroidManifest editing
✅ No manual steps
✅ Works immediately
Features #
- Simple API - Just 3 methods:
getInitialSharing(),getMediaStream(),reset() - All file types - Images, videos, text, URLs, documents
- Hot & cold start - Works when app is running or closed
- Cross-platform - iOS ShareExtension + Android intent filters
Installation & Setup #
# 1. Add dependency
flutter pub add share_intent_package
# 2. Setup iOS (automatic ShareExtension + Xcode configuration)
setup_ios_clean
cd ios && pod install && cd ..
# 3. Setup Android (automatic intent filters + permissions)
setup_android
# 4. Build and run
flutter run
That's it! Your app now appears in share menus on both platforms.
Usage #
import 'package:share_intent_package/share_intent_package.dart';
class _MyAppState extends State<MyApp> {
SharedData? _sharedData;
@override
void initState() {
super.initState();
_handleSharing();
}
void _handleSharing() {
// Get data when app launched via share
ShareIntentPackage.instance.getInitialSharing().then((data) {
if (data != null) setState(() => _sharedData = data);
});
// Listen for new shares while app is running
ShareIntentPackage.instance.getMediaStream().listen((data) {
setState(() => _sharedData = data);
});
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: _sharedData == null
? Text('No shared content')
: Column(
children: [
Text('Text: ${_sharedData!.text ?? 'None'}'),
Text('Files: ${_sharedData!.filePaths ?? 'None'}'),
Text('Type: ${_sharedData!.mimeType ?? 'Unknown'}'),
],
),
);
}
}
API Reference #
| Method | Description |
|---|---|
getInitialSharing() |
Get data when app launched via share |
getMediaStream() |
Listen for shares while app is running |
reset() |
Clear cached share data |
SharedData Object #
class SharedData {
final String? text; // Shared text content
final List<String>? filePaths; // Shared file paths
final String? mimeType; // Content MIME type
}
Requirements #
- iOS 13.0+ | Android API 21+ | Flutter 3.3.0+
License #
MIT