Skip to content

Remove references to plugin_ffi#13004

Merged
sfshaza2 merged 1 commit intomainfrom
deprecate-plugin-ffi
Jan 28, 2026
Merged

Remove references to plugin_ffi#13004
sfshaza2 merged 1 commit intomainfrom
deprecate-plugin-ffi

Conversation

@dcharkes
Copy link
Contributor

@dcharkes dcharkes commented Jan 28, 2026

The new way of bundling native code is flutter create --template=package_ffi. (Or if the Flutter Plugin API or Android Play components need to be bundled: flutter create --template=plugin.)

Issue:

Related PRs:

@dcharkes dcharkes requested a review from antfitch January 28, 2026 08:57
@dcharkes dcharkes requested review from a team and sfshaza2 as code owners January 28, 2026 08:57
@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @dcharkes, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request updates the Flutter documentation to align with current best practices for integrating native code using Dart FFI. It deprecates the plugin_ffi template, guiding developers towards the package_ffi template for pure FFI packages and the standard plugin template for scenarios requiring Flutter Plugin API access. The changes streamline the documented workflow for FFI development, focusing on the build.dart hook for native code compilation and updating related commands.

Highlights

  • Deprecation of plugin_ffi template: The documentation for flutter create --template=plugin_ffi has been removed, marking it as a legacy approach for creating FFI plugins.
  • Updated FFI package creation guidance: The recommended command for creating FFI packages is now flutter create --template=package_ffi. For scenarios requiring Flutter Plugin API access or Google Play services integration, flutter create --template=plugin is suggested.
  • Streamlined FFI package structure description: The documentation now focuses on the modern FFI package structure, emphasizing hook/build.dart for native code compilation and removing outdated details about platform-specific build files and pubspec.yaml configurations.
  • Revised FFI binding generation command: The command to regenerate FFI bindings has been updated from dart run ffigen --config ffigen.yaml to dart run tool/ffigen.dart.

🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@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 does a great job of removing references to the legacy plugin_ffi template and updating the documentation to favor the modern package_ffi approach. The changes are clear and well-aligned with the stated goal. I've added a couple of minor suggestions to ensure the documentation for edge cases, where the standard plugin template is now recommended, is fully comprehensive.

Comment on lines +721 to +723
If you need to access the Flutter Plugin API or configure a Google Play
services runtime on Android, use the `flutter create --template=plugin`
command instead.
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

The note about when to use the standard plugin template is missing a use case. The legacy plugin_ffi template was also used for static linking on iOS or macOS. According to the related issue, this case should also be covered by the standard plugin template. It would be good to include this for completeness.

Suggested change
If you need to access the Flutter Plugin API or configure a Google Play
services runtime on Android, use the `flutter create --template=plugin`
command instead.
If you need to access the Flutter Plugin API, configure a Google Play
services runtime on Android, or use static linking on iOS or macOS,
use the `flutter create --template=plugin` command instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Well, yes and no. The Plugin (non-FFI) template doesn't help you with the setup like the FFI plugin template did. No CMakeList.txt and C source code are provided.

Comment on lines +16 to +18
If you need to use the Flutter Plugin API, or if you need to configure a Google
Play services runtime on Android, use the standard plugin template (`flutter create
--template=plugin`).
Copy link
Contributor

Choose a reason for hiding this comment

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

medium

This paragraph is missing a use case for the standard plugin template. The legacy plugin_ffi template was also used for static linking on iOS or macOS, which is now a use case for the standard plugin template. It would be beneficial to add this information here for users who land on this page.

Suggested change
If you need to use the Flutter Plugin API, or if you need to configure a Google
Play services runtime on Android, use the standard plugin template (`flutter create
--template=plugin`).
If you need to use the Flutter Plugin API, configure a Google Play services
runtime on Android, or use static linking on iOS or macOS, use the standard
plugin template (`flutter create --template=plugin`).

@dcharkes dcharkes requested a review from goderbauer January 28, 2026 08:59
@flutter-website-bot
Copy link
Collaborator

Visit the preview URL for this PR (updated for commit eeaebb7):

https://flutter-docs-prod--pr13004-deprecate-plugin-ffi-uj153fj4.web.app

Copy link
Contributor

@sfshaza2 sfshaza2 left a comment

Choose a reason for hiding this comment

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

lgtm. Thaks, @dcharkes

@sfshaza2 sfshaza2 merged commit 47154c1 into main Jan 28, 2026
10 checks passed
@sfshaza2 sfshaza2 deleted the deprecate-plugin-ffi branch January 28, 2026 16:44
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.

3 participants