desktop_drop 0.9.1
desktop_drop: ^0.9.1 copied to clipboard
Receive files, text, and URLs with per-target drag acceptance in Flutter applications.
Changelog #
0.9.1 #
- Windows: Fix a startup crash caused by queued platform tasks being freed before execution on affected Flutter engines. (#526)
0.9.0 #
Breaking changes #
- Require Flutter 3.47.7 / Dart 3.13.5 or later and upgrade to
cross_file0.4. - Replace
onDragDone(DropDoneDetails)with required, async-capableonDrop(DropDetails). Consume typeditemsinstead offiles. - Replace
DropItemFileandDropItemDirectorywithDropFileItemandDropDirectoryItem. Read files throughitem.fileand list directories throughitem.directory.list().DropItemno longer extendsXFile; forwarded file methods and byte-backed drop-item constructors are removed. - Limit provider access and temporary transfer files to the lifetime of
onDrop. Await all reads and directory listings, and save content needed later before the callback returns. - Rename hover callbacks to
onEnter,onMove, andonLeave, and renameenabletoenabled. Hover callbacks receiveDragDetails;onLeavetakes no arguments and also clears hover on drop, rejection, or disabling. - Select one accepting target through Flutter hit testing, with parent fallback when a child rejects a drop. Overlapping targets no longer independently receive the same drop.
- Rename
extraAppleBookmarktoappleBookmarkandfromPromisetoisPromised. Use nullablelocalPathonly for filesystem-backed content. - Replace
rawTextwith MIME-typedDropStringItemvalues. Linux portal keys are resolved by the plugin. Raw listener registration and the old broadcast event classes are removed. See the migration guide.
Features #
- Receive files, directories, plain text, HTML, and URI lists as typed items. Read provider-backed files and directory contents through
XFileandXDirectory; URLs remain strings without automatic downloads. - Add per-target
acceptedKindsfiltering and optional synchronousonWillAcceptconditions. Configure copy, move, or link feedback withoperation, subject to source and platform support. - Preserve source MIME types and infer missing file MIME types from names without reading file contents.
- iOS: Add drag-and-drop support on iOS 13 and later, with copy-only acceptance and automatic cleanup of temporary transfers after
onDrop. - Windows: Support virtual files, directories, and native image content, retaining source resources through asynchronous processing.
- Android: Add synchronous drop acceptance, provider-backed file and directory reads, and explicit directory authorization through
DesktopDrop.instance.requestDirectoryAccesswhen the source does not grant child access. Reads do not open permission UI.
Fixes #
- Web: Handle mixed file/string drags and files without filesystem entries, and clear hover state after file-less drops. (#503; thanks jamesaorson)
- Linux: Keep portal transfers alive until file resolution completes so drops from sandboxed sources can succeed. (#505; thanks sun-jiao)
- macOS: Preserve mouse interaction with embedded native views outside an active drag. (#436; thanks gicha)
0.8.2 #
- [Android] Restore compatibility with Android Gradle Plugin versions below 9 by applying the Kotlin Gradle Plugin conditionally, while continuing to use built-in Kotlin on AGP 9 and later #495 by loucass
- [Android] Hosts on AGP versions below 9 must provide Kotlin Gradle Plugin 2.0.0 or later because
desktop_dropuses thekotlin.compilerOptionsDSL. Apps using an older KGP version must upgrade it before updatingdesktop_drop
0.8.1 #
- [desktop_drop] [Linux] register the
application/vnd.portal.filetransferdrag target and deliver its key via a newperformOperation_portalchannel message - [desktop_drop] [Linux] resolve portal transfer keys through
org.freedesktop.portal.FileTransfer, so drops from sandboxed sources yield openable document-portal paths - [desktop_drop] expose the raw drag payload in
DropDoneEvent.rawText/DropDoneDetails.rawText
0.8.0 #
BREAKING CHANGE
- [Android] Migrate to built-in Kotlin. Android host apps must use Android Gradle Plugin 9 or later.
0.7.1 #
- update worksapce
- [desktop_drop_web] fix: loop readEntries() to retrieve all directory children on web #473 by TerryHuangHD
- [desktop_drop]:
on_focus_in_eventshould returngboolean#472 by imnotlxy - [worksapce]: fix foramt
- Handle SMB URIs in Linux desktop_drop path parsing #474 by app/copilot-swe-agent
0.7.0 #
[Android] Upgrade Android compileSdk and Kotlin version. (#444) [macOS] Robust multi-source drag & drop.
- Prefer
public.file-url/ legacy filename arrays when present; fall back toNSFilePromiseReceiver(file promises) otherwise. - Handle directories (
isDirectory) and surface asDropItemDirectory. - Add
fromPromisetoDropItemso apps can distinguish promise-based drops. - Generate security-scoped bookmarks only for paths outside the app container
(skip/empty for promise files in
.../tmp/Drops/...). - Per-drop unique destination for promised files to avoid name collisions.
- Thread-safe collection of drop results when receiving promises.
- Dart guards: no-op
start/stopAccessingSecurityScopedResourceon empty bookmarks. - Bump macOS minimum to 10.13 (SPM/Podspec).
0.6.1 #
- Fix desktop_drop Linux snap build failure due to missing stdlib.h include (#425)
0.6.0 #
0.5.0 #
- upgrade web version to 1.0.0
0.4.3 #
- fix windows build warning C4701
0.4.2 #
- fix crash on Windows when app exit
0.4.1 #
- [macOS] improve enumerateDraggingItems on macOS.
0.4.0 #
- [Android] update to later version of kotlin(1.5.2). #155 by Cal Holloway
- [macOS] Fix broken gestures when used with modified MainFlutterWindow. #162 by Josh Matthews
0.3.1 #
- Fix desktop_drop web lastModifiedDate. (Thanks Luigi Rosso)
0.3.0 #
** BREAK CHANGES**
- replace DropDoneDetails property
urls: List<Uri>tofiles: List<XFile>. which is more general.
0.2.0 #
Add web support
0.1.2 #
[Linux] Fix do not work on Wayland.
0.1.1 #
update plugin description.
0.1.0 #
- add android support. (preview)
- expose pointer coordinates.
BREAK CHANGE:
- Change
onDragEntered,onDragExitedandonDragUpdatedcallbacks signature fromVoidCallbacktovoid Function(DropEventDetails). - Change
DropDoneDetailsfromvoid Function(List<Uri>)tovoid Function(DropDoneDetails). you can obtain urls byDropDoneDetails.urls.
0.0.1 #
a file drop plugin for flutter desktop platforms.
- add Linux support.
- add Windows support.
- add macOS support.