-
Notifications
You must be signed in to change notification settings - Fork 3.6k
[path_provider] Re-release FFI foundation version #10722
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?
[path_provider] Re-release FFI foundation version #10722
Conversation
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.
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.
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):
objective_c9.2.1, to pick up the fixes for Failed to get ApplicationDocumentsDirectory: Invalid argument(s): Couldn't resolve native function 'DOBJC_initializeApi' in 'objective_c.framework/ objective_c' flutter#178915 and Asset build fails with "Null check operator used on a null value" in CodeConfig._fromJson dart-lang/native#2824Also makes necessary repo-level changes:
Fixes flutter/flutter#111033
Pre-Review Checklist
[shared_preferences]pubspec.yamlwith an appropriate new version according to the pub versioning philosophy, or I have commented below to indicate which version change exemption this PR falls under1.CHANGELOG.mdto add a description of the change, following repository CHANGELOG style, or I have commented below to indicate which CHANGELOG exemption this PR falls under1.///).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-assistbot 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
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