flutter-share-plus-engineering
Skill8 starsChanged 48 days agoMITView on GitHub
Design, implement, review, debug, secure, test, migrate, and optimize production cross-platform sharing in Flutter with share_plus. Use when a task involves SharePlus.instance.share, ShareParams, text or URI sharing, images/PDFs/generated documents/audio/video, XFile or XFile.fromData, multiple attachments, MIME types and filenames, iPad/macOS sharePositionOrigin, Web Share API and download/email fallbacks, Windows or Linux sharing, ShareResult semantics, temporary-file cleanup, large-file memory use, duplicate share sheets, receiver compatibility, privacy, or migration from deprecated Share.* APIs. Do not use for receiving inbound shares, guaranteed delivery workflows, direct posting through a social network SDK/API, or generic file export with no share handoff.
In this repository70 other files it gives its agents.
- camerawesome-flutterSkill
- dart-args-production-cliSkill
- dart-flutter-equatable-engineeringSkill
- dart-flutter-ffi-systems-engineeringSkill
- dart-metaSkill
- document-camera-frameSkill
- document-scan-flutterSkill
- figma-to-flutter-expertSkill
- flutter-animations-production-engineeringSkill
- flutter-app-hardening-reverse-engineeringSkill
- flutter-app-icon-engineeringSkill
- flutter-application-security-engineeringSkill
- flutter-app-links-deep-link-engineeringSkill
- flutter-cachingSkill
- flutter-concurrency-memory-performanceSkill
- flutter-confetti-engineeringSkill
- flutter-dart-package-engineeringSkill
- flutter-design-system-from-design-mdSkill
- flutter-dio-cache-interceptor-engineeringSkill
- flutter-dio-engineeringSkill
- flutter-doc-scannerSkill
- flutter-drift-persistence-engineeringSkill
- flutter-expert-tipsSkill
- flutter-firebase-analyticsSkill
- flutter-firebase-core-engineeringSkill
- flutter-firebase-messagingSkill
- flutter-get-it-injectable-dependency-injectionSkill
- flutter-go-router-engineeringSkill
- flutter-hive-persistence-engineeringSkill
- flutter-image-performanceSkill
- flutter-image-picker-production-engineeringSkill
- flutter-lints-static-analysis-engineeringSkill
- flutter-local-notifications-production-engineeringSkill
- flutter-memory-leak-engineeringSkill
- flutter-mobile-developmentSkill
- flutter-motion-engineeringSkill
- flutter-multi-environmentSkill
- flutter-native-splash-engineeringSkill
- flutter-package-plugin-selectionSkill
- flutter-path-provider-production-storageSkill
- flutter-performance-jank-optimizationSkill
- flutter-permission-handler-engineeringSkill
- flutter-pinputSkill
- flutter-production-build-releaseSkill
- flutter-production-engineeringSkill
- flutter-production-loggingSkill
- flutter-pro-image-editor-engineeringSkill
- flutter-secure-storage-security-engineeringSkill
- flutter-sentry-engineeringSkill
- flutter-skeletonizer-engineeringSkill
- flutter-squadron-concurrency-engineeringSkill
- flutter-supabase-engineeringSkill
- flutter-svg-engineeringSkill
- flutter-ui-performance-engineeringSkill
- flutter-url-launcher-engineeringSkill
- flutter-video-player-production-engineeringSkill
- flutter-webview-production-engineeringSkill
- freezed-production-engineeringSkill
- html-to-flutterSkill
- hydrated-blocSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
28 rules. About 0 are common, 16 are distinctive, and 12 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈16
Distinctive · estimate
This author's own choices. Worth a look.
12
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 8
Treat sharing as a transition across an application trust boundary.
- Very specific: line 31
Use the installed package API, README, and changelog as the source of truth when the repository differs, especially for current API shape, …
- Very specific: line 37
Use the current SharePlus.instance.share(ShareParams(...)) API.
- Distinctive: line 38
Do not assume capability or result parity across Android, Apple, Web, Linux, and Windows.
- Very specific: line 40
Prefer a path-backed XFile when a large file already exists.
- Very specific: line 41
Never call readAsBytes() solely to wrap an existing file in XFile.fromData.
- Very specific: line 43
Use XFile.fromData for genuinely in-memory or generated content, and give it an accurate MIME type and meaningful filename.
- Distinctive: line 45
Do not claim path-backed sharing is zero-copy.
- Very specific: line 47
Keep expensive generation, compression, file I/O, and sharing out of build().
- Distinctive: line 49
Keep Web sharing directly tied to transient user activation.
- Very specific: line 54
Treat ShareResult as best-effort interaction feedback, not delivery or business confirmation.
- Distinctive: line 56
Treat dismissal as normal user behavior.
- Very specific: line 57
Treat subject, title, MIME hints, filenames, and multi-attachment support as receiver-dependent.
- Distinctive: line 59
Never share access tokens, refresh tokens, credentials, private keys, or unreviewed sensitive content.
- Distinctive: line 61
Treat private and signed URLs as bearer-like information once shared.
- Very specific: line 66
Do not add obsolete Android storage permissions or manual FileProvider setup solely for current share_plus.
- Distinctive: line 68
Test real devices and important receiver applications.
- Distinctive: line 73
Use this decision order:
- Very specific: line 79
Use XFile.fromData for small content that genuinely exists only in memory.
- Distinctive: line 82
Use a short-lived signed URL only after reviewing access lifetime and forwarding risk.
- Distinctive: line 86
Prefer the first option that preserves product semantics, privacy, platform support, and acceptable memory/disk cost.
- Very specific: line 91
Read only the relevant sections of references/production-guide.md.
- Distinctive: line 98
Use these search headings:
- Distinctive: line 120
Add a share service only when it centralizes actual export caching, privacy, fallback, duplicate prevention, analytics, or testability …
- Distinctive: line 126
Keep UI state changes lifecycle-safe and release the in-flight guard in all result and error paths.
- Distinctive: line 128
Do not build receiver-specific guarantees on generic share-sheet behavior.
- Distinctive: line 132
Run the narrowest relevant Dart/Flutter checks, then test release-like builds on the affected platforms and representative receivers.
- Very specific: line 147
Never claim a share was delivered from ShareResultStatus.success.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Flutter share_plus Engineering
Treat sharing as a transition across an application trust boundary. After the platform hands content to another application, the Flutter app no longer controls delivery, retention, transformation, or receiver behavior.
Start with evidence
Before changing code:
- Inspect
pubspec.yaml,pubspec.lock, Flutter/Dart constraints, target platforms, and native toolchain requirements. - Identify the locked
share_plus,cross_file, and relevant export/file package versions. - Find every current share invocation, deprecated
Share.*call, payload generator, temporary-file owner, Web fallback, result handler, and in-flight guard. - Identify the actual payload semantics: text, URI, existing attachment, generated bytes, generated file, hosted URL, or private signed URL.
- Estimate representative payload sizes and inspect byte, disk, compression, isolate, caching, and cleanup paths.
- Identify required receiver applications and platform-specific behavior.
- Separate verified package behavior from receiver-dependent assumptions.
The bundled guide was validated against share_plus 13.3.0 on 2026-08-11.
Use the installed package API, README, and changelog as the source of truth when
the repository differs, especially for current API shape, iPad behavior,
Web fallback, previewThumbnail, filenames, Windows, and toolchain support.
Preserve these invariants
- Use the current
SharePlus.instance.share(ShareParams(...))API. - Do not assume capability or result parity across Android, Apple, Web, Linux, and Windows.
- Prefer a path-backed
XFilewhen a large file already exists. - Never call
readAsBytes()solely to wrap an existing file inXFile.fromData. - Use
XFile.fromDatafor genuinely in-memory or generated content, and give it an accurate MIME type and meaningful filename. - Do not claim path-backed sharing is zero-copy; Android may copy files into its share cache.
- Keep expensive generation, compression, file I/O, and sharing out of
build(). - Keep Web sharing directly tied to transient user activation. Prepare expensive Web exports before the final Share click.
- Provide an accurate source-widget
sharePositionOriginon iPad/macOS when positioning is required; do not use an arbitrary giant rectangle. - Allow only one share invocation per control at a time.
- Treat
ShareResultas best-effort interaction feedback, not delivery or business confirmation. - Treat dismissal as normal user behavior; never auto-retry it.
- Treat
subject,title, MIME hints, filenames, and multi-attachment support as receiver-dependent. - Never share access tokens, refresh tokens, credentials, private keys, or unreviewed sensitive content.
- Treat private and signed URLs as bearer-like information once shared.
- Own and clean only application-created temporary exports; never delete the entire shared temporary directory.
- Surface Web download/email fallback as fallback behavior, not native-share success.
- Do not add obsolete Android storage permissions or manual FileProvider setup
solely for current
share_plus. - Test real devices and important receiver applications; emulator-only success is insufficient.
Choose the smallest correct payload
Use this decision order:
- Share a URI when the hosted experience is the product and the recipient can access it.
- Share an existing path-backed file when the recipient needs a standalone attachment.
- Use
XFile.fromDatafor small content that genuinely exists only in memory. - Materialize large generated content once to an owned file, then share the path-backed file.
- Use a short-lived signed URL only after reviewing access lifetime and forwarding risk.
- Choose and label Web fallback explicitly when native Web Share is unavailable.
Prefer the first option that preserves product semantics, privacy, platform support, and acceptable memory/disk cost.
Route to the production guide
Read only the relevant sections of references/production-guide.md. Locate
sections before reading them with:
rg -n '^#{1,3} (SECTION|RELATED SECTION)$' references/production-guide.mdUse these search headings:
| Task | Search headings | ||||||||||||||||
| Install, migrate, inspect capabilities, or use the current API | `No Initialization Required | Installation | Current API | Current Parameter Rules | Deprecated APIs | SharePlus.custom | previewThumbnail | Platform Capability Matrix` | |||||||||
| Share text, URLs, or custom schemes | `Basic Text Sharing | Large Text | Text Localization | URI Sharing | URL as URI vs Text | Custom URI Schemes` | |||||||||||
| Share existing or multiple files with correct MIME and names | `Existing File Sharing | File Existence | Multiple Files | Mixed File Types | MIME Types | MIME Inference | Extension and MIME Must Agree | File Names | fileNameOverrides` | ||||||||
| Share generated bytes or manage temporary files and large payloads | `In-Memory XFile | How In-Memory Files Are Materialized | XFile.fromData Performance | Web File Memory | Temporary Files | Safe Temporary-File Strategy | Android.s Own Share Cache | Large File Performance | CPU vs Memory vs Disk` | ||||||||
| Implement Android, iOS/iPad, macOS, Web, Linux, or Windows behavior | `Android Guidance | Android File Handling | Android MIME Selection | Android Permissions | Android FileProvider | iOS Guidance | iPad Popover | Correct sharePositionOrigin | Async iPad Safety | macOS Guidance | Web Guidance | Web User Activation | Web Share File Capability | Web File Fallback | Web Text/URI Email Fallback | Linux Guidance | Windows Guidance` |
| Interpret results, titles, subjects, and analytics | `Share Results | success | dismissed | unavailable | Never Treat Share Result as Business Confirmation | Analytics Boundary | Subject and Title` | ||||||||||
| Share images, screenshots, PDFs, documents, or remote/private files | `Images | Generated Image | Image Compression | Screenshots | Screenshot Pixel Ratio | PDFs | Generated Documents | CPU-Heavy Generation | Remote Files | Signed URL Decision` | |||||||
| Review privacy, service boundaries, duplicate prevention, or lifecycle | `Privacy and Security | MUST NOT Share | Sensitive Documents | Temporary Sensitive Exports | Share Service Abstraction | When a Share Service Helps | Duplicate Share Sheets | Stateful Button Example | Lifecycle Safety | State Management Integration` | |||||||
| Handle errors, fallback, performance, reliability, or accessibility | `Error Handling | Argument Errors | Unsupported Capability | Platform Errors | Web Fallback Failure | Graceful Degradation | Performance Rules | Reliability Rules | Receiver Compatibility | Platform Permissions | Accessibility and UX` | ||||||
| Test, debug, review, migrate, or prepare production | `Testing Strategy | Cross-Platform Test Matrix | iPad Physical Testing | Android Device Testing | Web Browser Verification | Release-Build Testing | Logging and Diagnostics | Debugging Guide | Anti-Patterns | Implementation Checklist | Code Review Checklist | Production Readiness Checklist | Version-Sensitive Areas` |
For a full cross-platform sharing or production-readiness audit, read the entire guide after completing the repository inventory.
Implement at the payload lifecycle boundary
- Reuse an existing share helper or export path when it already owns real cross-cutting concerns.
- Add a share service only when it centralizes actual export caching, privacy, fallback, duplicate prevention, analytics, or testability needs.
- Fix large-file memory spikes at payload generation/materialization rather than micro-optimizing the small plugin invocation.
- Derive the popover origin from the live initiating widget after asynchronous work, with lifecycle checks.
- Keep UI state changes lifecycle-safe and release the in-flight guard in all result and error paths.
- Do not build receiver-specific guarantees on generic share-sheet behavior.
Validate the result
Run the narrowest relevant Dart/Flutter checks, then test release-like builds on the affected platforms and representative receivers. Cover changed paths from this matrix:
- text, URI, single-file, multi-file, and generated-content payloads;
- empty/missing files, wrong MIME, receiver rejection, dismissal, and unavailable capability;
- iPad/macOS positioning from the actual initiating widget;
- Web native share under user activation plus each configured fallback;
- representative small and large payload memory/disk behavior;
- one in-flight share action under rapid taps;
- temporary export cleanup without deleting unrelated files;
- privacy review for content, metadata, filenames, and URLs;
- release builds on each supported target and important receiver application.
Never claim a share was delivered from ShareResultStatus.success. Report any
platform, receiver, fallback, or payload-size path that was not executed.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

