Intention to deprecate and remove plugin_ffi template #131209
Labels
c: new feature
Nothing broken; request for a new capability
c: proposal
A detailed proposal for a change to Flutter
P2
Important issues not at the top of the work list
team-tool
Owned by Flutter Tool team
tool
Affects the "flutter" command-line tool. See also t: labels.
triaged-tool
Triaged by Flutter Tool team
Removing plugin_ffi template
In the native assets we will create a way to bundle native code without the boilerplate code for every OS. Moreover, the packages with native assets will be regular Dart packages, removing the split between Dart packages and Flutter plugins with native code. (For example
package:realm
andpackage:realm_dart
.)Therefore, once we have support for native assets, the intention is to first deprecate and then remove the FFI plugin template.
Once native assets come out of experimental, we would mark the FFI plugin as deprecated, and subsequently remove it one or two Flutter versions later.
All the documentation and code labs that currently refer to FFI plugins need to be migrated in that time frame.
Potentially adding package_ffi template
Packages with native assets are much simpler than the FFI plugins due to having less boilerplate code (example). They are basically a
pubspec.yaml
dependency on https://pub.dev/packages/native_assets_cli and https://pub.dev/packages/native_toolchain_c,build.dart
doing the native build,ffigen.yaml
for the bindings, andsrc/some_c_code.c
with the native code.It could suffice to have this in
dart create
, instead of adding a template toflutter create
. However, the downside would be thatdart create
would not have a flutter sample app invoking the native code. And this sample app working out of the box means that our users know the building/bundling works for the target OS/arch they are working on.It could suffice to have this as a sample (both a package with native assets as well as an example app using it), instead of
flutter create
. The downside over a template would be that changing the name from the sample is error prone. (And checking out the sample with git clone is more work than runningflutter create
.)The extra steps that users have to do also have to be duplicated in our documentation and code lab.
Since we are intending to remove
flutter create -t plugin_ffi
, maybe we should consider whether we should addflutter create -t package_ffi
.Context:
cc @stuartmorgan @vashworth @zanderso
The text was updated successfully, but these errors were encountered: