clipboard_file 0.1.6
clipboard_file: ^0.1.6 copied to clipboard
Read and copy files from the system clipboard on iOS and Android, including images, PDFs, Office documents, and CSV.
0.1.6 #
Single copied image no longer pastes as multiple files #
- iOS:
copyImagewrites one PNG representation. Reading a paste item keeps one image encoding instead of every UTI (public.png,public.jpeg,public.tiff). - Android: URI and a single HTML image from the same clip item share a group key.
- Dart:
collapseGroupedImageRepresentations()keeps one file per group. Separate HTML/RTF images stay separate.
0.1.5 #
Dart #
- Add
dedupeClipboardFiles()and apply it inClipboardFileReader.readFiles()to collapse the common iOS single-photo duplicate (unnamed image + namedIMG_*.png) without affecting multi-image pastes.
0.1.4 #
Android build fix #
- Fix Kotlin compile errors on newer Android SDK: pass
ContexttoClipData.Item.coerceToHtmlText()(notContentResolver). - Use explicit
mutableMapOf<String, Any>()for HTML image payloads soByteArraymap entries type-check correctly.
0.1.3 #
Teams / Jira / multi-image paste #
- Android: Scan all primary-clip items (URIs,
IntentEXTRA_STREAM, HTML per item); extract everydata:image/...;base64match from HTML; ignore placeholder plain text (Image,[Image]). - iOS: Read
pasteboard.itemsand RTFD/RTF allNSTextAttachmentimages (not only the first); parse HTML on each pasteboard item; resolveNSItemProviders sequentially and collect every image UTI; support Teams-style payloads (com.apple.flat-rtfd, etc.). - Dart: Add
ClipboardFileReader.readFiles()for multiple clipboard images;readFile()returns the first entry fromreadFiles(). AddreadPasteDiagnostics()for item/provider counts and placeholder hints (debugging).
Correct image extension (magic bytes) #
- iOS / Android: Prefer file magic bytes over declared MIME/UTI when building payloads (fixes JPEG bytes labeled as PNG from Teams).
- Dart: Add
ClipboardImageFormat(extensionFromBytes,normalizeExtension,normalizeFileName); apply automatically inreadFiles()/readFile()parsing soClipboardFileData.extensionmatches actual bytes. - Dart: Add
ClipboardFileReader.isImagePlaceholderText()for apps that fall back to plain-text paste.
Notes for integrators #
- Call
readFiles()(orreadFile()) beforeClipboard.kTextPlainwhen handling paste in chat-style UIs. - Rebuild the app after upgrading; native plugin changes require a full restart.
0.1.2 #
- Expanded README with installation, API reference, supported file types, and platform notes.
- Updated example app and tests to demonstrate the current API.
- Added pub.dev metadata (topics, documentation link) and publish tooling.
0.1.1 #
- Merged
readImage()intoreadFile(); usereadFile()for both files and images. - Removed
ClipboardImageDataand the separatereadImage()API.
0.1.0 #
- Initial publishable release.
- Read files and images from the clipboard on iOS and Android.
- Copy images to the clipboard.