Skip to main content

clipboard_file 0.1.6 copy "clipboard_file: ^0.1.6" to clipboard
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: copyImage writes 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 in ClipboardFileReader.readFiles() to collapse the common iOS single-photo duplicate (unnamed image + named IMG_*.png) without affecting multi-image pastes.

0.1.4 #

Android build fix #

  • Fix Kotlin compile errors on newer Android SDK: pass Context to ClipData.Item.coerceToHtmlText() (not ContentResolver).
  • Use explicit mutableMapOf<String, Any>() for HTML image payloads so ByteArray map entries type-check correctly.

0.1.3 #

Teams / Jira / multi-image paste #

  • Android: Scan all primary-clip items (URIs, Intent EXTRA_STREAM, HTML per item); extract every data:image/...;base64 match from HTML; ignore placeholder plain text (Image, [Image]).
  • iOS: Read pasteboard.items and RTFD/RTF all NSTextAttachment images (not only the first); parse HTML on each pasteboard item; resolve NSItemProviders 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 from readFiles(). Add readPasteDiagnostics() 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 in readFiles() / readFile() parsing so ClipboardFileData.extension matches actual bytes.
  • Dart: Add ClipboardFileReader.isImagePlaceholderText() for apps that fall back to plain-text paste.

Notes for integrators #

  • Call readFiles() (or readFile()) before Clipboard.kTextPlain when 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() into readFile(); use readFile() for both files and images.
  • Removed ClipboardImageData and the separate readImage() API.

0.1.0 #

  • Initial publishable release.
  • Read files and images from the clipboard on iOS and Android.
  • Copy images to the clipboard.
2
likes
150
points
651
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Read and copy files from the system clipboard on iOS and Android, including images, PDFs, Office documents, and CSV.

Repository (GitHub)
View/report issues

Topics

#clipboard #flutter-plugin #file #ios #android

License

MIT (license)

Dependencies

flutter

More

Packages that depend on clipboard_file

Packages that implement clipboard_file