Skip to content

Conversation

@stuartmorgan-g
Copy link
Collaborator

This re-lands the FFI-based implementation from #9762, which was reverted in #10517.
It contains the following changes (other than version and changelog updates):

Also makes necessary repo-level changes:

  • Updates the tool's Flutter->Dart version mapping to recognize 3.38.4, to make that minimum work
  • Update the release action to use 3.38.5, to avoid having publishing due to using an older version of Flutter than the package requires.

Fixes flutter/flutter#111033

Pre-Review Checklist

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the gemini-code-assist bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.

Footnotes

  1. Regular contributors who have demonstrated familiarity with the repository guidelines only need to comment if the PR is not auto-exempted by repo tooling. 2 3

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly refactors path_provider_foundation by migrating its implementation from a Pigeon-based Flutter plugin to direct FFI calls to Foundation, updating the package to version 2.6.0 and requiring Flutter 3.38.4/Dart 3.10. The change involves deleting all Pigeon-generated Swift and Dart files, along with the Swift plugin implementation, and introducing new FFI bindings (ffi_bindings.g.dart), a real FFI-based implementation (path_provider_foundation_real.dart), and a stub for non-FFI platforms. The example project's pubspec.yaml is updated to include ffi, objective_c, mockito, and build_runner for the new FFI and testing setup, and its build.yaml is added for mock generation. Xcode project files for iOS and macOS examples are modified to reflect the new plugin registration and build phases. Integration tests are extensively rewritten to support mocking of FFI calls and platform variants, with tests now split into end-to-end and unit groups, including new tests for macOS-specific path handling. Review comments suggest making several async methods synchronous by wrapping their results in Future.value() for performance and style, and also recommend ensuring consistency for the FakePlatformProvider class across test files for better test reliability and expressiveness.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Consider rewriting a macOS/iOS plugin using ObjC interop

1 participant