-
Notifications
You must be signed in to change notification settings - Fork 230
[desktop_drop] Added IOS support #416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
bikram0000
commented
Jun 14, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 | ✅ |
s.description = <<-DESC | ||
Cross-platform drag-and-drop plugin for Flutter, extended to support iOS via UIDropInteraction. | ||
DESC | ||
s.homepage = 'https://github.com/your-org/desktop_drop' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The homepage URL contains placeholder text 'your-org' which should be updated to the actual repository URL.
s.homepage = 'https://github.com/your-org/desktop_drop' | |
s.homepage = 'https://github.com/flutter-plugins/desktop_drop' |
Copilot uses AI. Check for mistakes.
) { | ||
if typeIdentifier == "public.image", let image = UIImage(data: data), let pngData = image.pngData() { | ||
resultItems.add([ | ||
"path": NSNull(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using NSNull() for the path field may cause issues with Flutter's type mapping. Consider using nil or an empty string instead.
"path": NSNull(), | |
"path": "", |
Copilot uses AI. Check for mistakes.
]) | ||
} else { | ||
resultItems.add([ | ||
"path": NSNull(), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using NSNull() for the path field may cause issues with Flutter's type mapping. Consider using nil or an empty string instead.
"path": NSNull(), | |
"path": nil, |
Copilot uses AI. Check for mistakes.