Skip to content

Commit b951e81

Browse files
authored
Document when to use pluginFfi vs plugin (flutter#7428)
* Document when to use pluginFfi vs plugin Adds documentation from the questions answered in: * flutter/flutter#108974 * clarify sentence
1 parent 88c6a65 commit b951e81

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/development/packages-and-plugins/developing-packages.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -614,6 +614,16 @@ a section in [Supporting the new Android plugins APIs][].
614614
If you want to develop a package that calls into native APIs using
615615
Dart's FFI, you need to develop an FFI plugin package.
616616

617+
Both FFI plugin packages and (non-FFI) plugin packages support
618+
bundling native code, but FFI plugin packages do not support
619+
method channels and do include method channel registration code.
620+
If you want to implement a plugin that uses both method channels
621+
and FFI, use a (non-FFI) plugin. You can chose per platform to
622+
use an FFI or (non-FFI) plugin.
623+
624+
FFI plugin packages were introduced in Flutter 3.0, if you're
625+
targeting older Flutter versions, you can use a (non-FFI) plugin.
626+
617627
### Step 1: Create the package
618628

619629
To create a starter FFI plugin package,

0 commit comments

Comments
 (0)