[desktop_drop] Added IOS support#416
Conversation
bikram0000
commented
Jun 14, 2025

There was a problem hiding this comment.
Pull Request Overview
This PR adds iOS support to the desktop_drop Flutter plugin, extending its drag-and-drop functionality beyond desktop platforms to iOS devices. The implementation uses iOS UIDropInteraction APIs to handle file drops on mobile devices.
- Adds comprehensive iOS platform support with Swift implementation
- Updates Flutter plugin configuration to register iOS support
- Modifies example app to demonstrate iOS functionality with Apple platform detection
Reviewed Changes
Copilot reviewed 29 out of 51 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/desktop_drop/pubspec.yaml | Registers iOS platform with DesktopDropPlugin |
| packages/desktop_drop/lib/src/drop_item.dart | Refactors bytes parameter handling for iOS compatibility |
| packages/desktop_drop/lib/src/channel.dart | Adds iOS-specific drop handling case "performOperation_ios" |
| packages/desktop_drop/ios/desktop_drop/Sources/desktop_drop/DesktopDropPlugin.swift | Complete iOS implementation with UIDropInteraction delegate |
| packages/desktop_drop/ios/desktop_drop.podspec | iOS CocoaPods specification |
| packages/desktop_drop/example/lib/main.dart | Updates example to support Apple platforms (iOS + macOS) |
| packages/desktop_drop/README.md | Documents iOS platform support |
Files not reviewed (2)
- packages/desktop_drop/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: Language not supported
- packages/desktop_drop/example/ios/Runner.xcworkspace/contents.xcworkspacedata: Language not supported
Comments suppressed due to low confidence (2)
packages/desktop_drop/README.md:12
- The platform name should be 'iOS' instead of 'IOS' to match standard capitalization conventions.
| IOS | ✅ |
packages/desktop_drop/ios/desktop_drop/Sources/desktop_drop/DesktopDropPlugin.swift
Outdated
Show resolved
Hide resolved
packages/desktop_drop/ios/desktop_drop/Sources/desktop_drop/DesktopDropPlugin.swift
Outdated
Show resolved
Hide resolved
|
Resolved |
There was a problem hiding this comment.
Pull Request Overview
Copilot reviewed 31 out of 53 changed files in this pull request and generated 6 comments.
Files not reviewed (2)
- packages/desktop_drop/example/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata: Language not supported
- packages/desktop_drop/example/ios/Runner.xcworkspace/contents.xcworkspacedata: Language not supported
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| /// In this case, the original source path is not available by design. | ||
| final bool fromPromise; | ||
|
|
||
|
|
There was a problem hiding this comment.
[nitpick] Remove the extra blank line. There should only be one blank line between the field declaration and the constructor.
| let package = Package( | ||
| name: "desktop_drop", | ||
| platforms: [ | ||
| .iOS("12.0") |
There was a problem hiding this comment.
The iOS deployment target should be consistent with the podspec file which specifies '11.0'. Consider updating to iOS 11.0 or ensure both files use the same minimum version.
| .iOS("12.0") | |
| .iOS("11.0") |
| s.dependency 'Flutter' | ||
| s.pod_target_xcconfig = { 'DEFINES_MODULE' => 'YES' } | ||
|
|
||
| s.platform = :ios, '11.0' |
There was a problem hiding this comment.
The iOS deployment target should be consistent with Package.swift which specifies '12.0'. Consider updating to iOS 12.0 or ensure both files use the same minimum version.
| s.platform = :ios, '11.0' | |
| s.platform = :ios, '12.0' |
|
|
||
|
|
There was a problem hiding this comment.
[nitpick] Remove the extra blank line. There should only be one blank line between the imports and the class declaration.
|
|
||
|
|
||
|
|
||
|
|
||
| func mimeType(for url: URL) -> String { |
There was a problem hiding this comment.
[nitpick] Remove the excessive blank lines. There should only be one blank line between method declarations.
|
|
||
|
|
||
|
|
||
| } |
There was a problem hiding this comment.
[nitpick] Remove the extra blank lines before the closing brace. There should be no blank lines before the final closing brace.