social_sharing_plus
is a Flutter plugin that allows you to share content, images and videos to various social media platforms like Facebook, Twitter, LinkedIn, WhatsApp, Reddit, and Telegram. This package provides a simple and unified interface for sharing across different apps, handling the nuances and differences of each platform.
🚀 Exciting News! You can now share multiple images and videos with text(optional)! 📸🎥
social_sharing_plus
is supported on Android and iOS platforms. On the Android side, queries are made with the package names of the respective apps. This requires the addition of some Android-specific code.
dependencies:
social_sharing_plus: ^1.2.3
import 'package:social_sharing_plus/social_sharing_plus.dart';
static const SocialPlatform platform = SocialPlatform.facebook;
String? _mediaPath; // add image or video path
List<String> _mediaPaths = []; // add image or video paths
bool isMultipleShare = true;
isMultipleShare
? await SocialSharingPlus.shareToSocialMediaWithMultipleMedia(
platform,
media: _mediaPaths,
content: content,
isOpenBrowser: false,
onAppNotInstalled: () {
ScaffoldMessenger.of(context)
..hideCurrentSnackBar()
..showSnackBar(SnackBar(
content: Text('${platform.name.capitalize} is not installed.'),
));
},
)
: await SocialSharingPlus.shareToSocialMedia(
platform,
content,
media: _mediaPath,
isOpenBrowser: true,
);
shareToSocialMedia
:Properties | Required | Default | Description |
---|---|---|---|
socialPlatform | true | Platform you want to share on | |
content | true | Any text you want to share | |
media | false | The image or video you want to share | |
isOpenBrowser | false | true |
If the relevant application is not installed, it redirects to the link (browser) of the relevant application. |
onAppNotInstalled | false | This method works if the application is not installed and the isOpenBrowser value is set to false. (For example: Showing a Snackbar like "The application is not installed on your device."...) |
shareToSocialMediaWithMultipleMedia
:Properties | Required | Default | Description |
---|---|---|---|
socialPlatform | true | Platform you want to share on | |
content | false | Any text you want to share | |
media | true | The image or video you want to share | |
isOpenBrowser | false | true |
If the relevant application is not installed, it redirects to the link (browser) of the relevant application. |
onAppNotInstalled | false | This method works if the application is not installed and the isOpenBrowser value is set to false. (For example: Showing a Snackbar like "The application is not installed on your device."...) |
sdk: '>=2.17.0 <4.0.0'
Please file any issues, bugs, or feature requests as an issue on our GitHub page.
If you would like to contribute to the plugin (e.g. by improving the documentation, solving a bug, or adding a cool new feature), please carefully review our contribution guide and send us your pull request.
This social_sharing_plus plugin for Flutter is developed by Bedirhan SaÄŸlam. You can contact me at bedirhansaglam270@gmail.com
MIT