Skip to content

[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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bikram0000
Copy link

ScreenRecording_06-14-2025 09-39-46_1

@bikram0000 bikram0000 changed the title Added IOS support [desktop_drop] Added IOS support Jun 14, 2025
@boyan01 boyan01 requested a review from Copilot July 22, 2025 03:46
Copy link

@Copilot Copilot AI left a 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'
Copy link
Preview

Copilot AI Jul 22, 2025

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.

Suggested change
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(),
Copy link
Preview

Copilot AI Jul 22, 2025

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.

Suggested change
"path": NSNull(),
"path": "",

Copilot uses AI. Check for mistakes.

])
} else {
resultItems.add([
"path": NSNull(),
Copy link
Preview

Copilot AI Jul 22, 2025

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.

Suggested change
"path": NSNull(),
"path": nil,

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant