social_share_kit 0.2.0 copy "social_share_kit: ^0.2.0" to clipboard
social_share_kit: ^0.2.0 copied to clipboard

Share text, links and files directly to X, WhatsApp, Instagram, Threads, Telegram, LinkedIn, Messenger, TikTok, SMS and mail, or to the system share sheet. Reports per-target capabilities up front. Bu [...]

Changelog #

0.2.0 #

Adds ShareTargetHandler, an extension seam letting an add-on package take over individual targets.

This exists so the no-vendor-SDK stance does not have to be all-or-nothing. The first add-on, social_share_kit_facebook, uses it to upgrade ShareTarget.facebook to the native Share Dialog — including on iOS, where the core package cannot serve it at all. Apps that do not want the Facebook SDK keep a package with zero required setup.

  • SocialShareKit.registerHandler / unregisterHandler / handlerFor.
  • A handler can widen a target's capabilities, and validation honours the widened entry — otherwise core would reject content before the handler ran.
  • capabilities, supportedTargets, shareTo, shareStory and installedTargets all consult the registry. Call sites do not change when an add-on is added or removed.
  • Fix: installedTargets() no longer lets MissingPluginException or PlatformException escape. Asking what is available should not itself need a try/catch; it now reports nothing installed, matching every other route.

0.1.0 #

First release.

Sharing to X, WhatsApp, Instagram (feed, Reels, direct, story), Facebook and Facebook story, Messenger, Telegram, Threads, LinkedIn (feed and direct), TikTok, SMS, mail, the system share sheet and the clipboard — text, links, files, or a combination, through one shareTo call per target.

Notable decisions:

  • Capabilities are queryable. SocialShareKit.capabilities() reports what a target accepts on the current platform — file counts, text ceilings, whether text is actually pre-filled or only copied to the clipboard, whether cancellation can be detected. Content is validated against it before any platform call, so an unsupported combination fails with an explanation instead of opening an app that quietly drops half the payload.

  • No vendor SDKs. Sharing uses published URL schemes, Android intents and system composers only. There is no Facebook app id, client token or AppDelegate wiring to add — except for the two story composers, which require an app id by design. The cost is that facebook and tiktok are unsupported on iOS, where a direct share genuinely needs their SDKs; both report unsupportedPlatform and suggest the system sheet.

  • Android needs no manifest changes. The <queries> declarations and a namespaced FileProvider ship in the plugin's manifest and merge into the host app. Without the <queries> block, every installed-app check returns false on Android 11 and above.

  • Results, not exceptions. Every call completes with a ShareResult carrying a ShareStatus. A missing app is an outcome, not an error. success means the composer opened, which is all any share API can honestly report.

  • Text is left alone. ShareText.stripHtml and ShareText.truncateForTarget are available but never applied automatically, so snake_case, * and _ survive in ordinary prose.

0
likes
150
points
85
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Share text, links and files directly to X, WhatsApp, Instagram, Threads, Telegram, LinkedIn, Messenger, TikTok, SMS and mail, or to the system share sheet. Reports per-target capabilities up front. Bundles no vendor SDKs.

Repository (GitHub)
View/report issues

Topics

#share #social #sharing #intent

License

MIT (license)

Dependencies

flutter, plugin_platform_interface

More

Packages that depend on social_share_kit

Packages that implement social_share_kit