NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev · #360 most downloaded on pub.dev
Generator for FFI bindings, using LibClang to parse C, Objective-C, and Swift files.
Last release 2 days ago
06 Oct 2026
Release timing varies
gaps range from 2 weeks to 5 months
Nearly every release is documented
notes for 60 of the last 60 stable releases
1 version withdrawn
withdrawn after publishing
6 years old
121 releases · first in 2020
One column per quarter.
The YAML configuration format is deprecated and will be removed in a future release.
Input.appendCompilerOptions to allow appending custom compilerdefaultCompilerOpts from the public API, since it is now redundant and wasImportedType.class declarations are now treated like structs, and with C++ support on,class/struct keyword.std::uint16_t) was left unresolved, which dropped every function thatextern "C" { ... }$, e.g.outer::inner::Color becomes outer$inner$Color, and originalName isVisitor or importType can filter or renamepackage:cli_util versions 0.5.x and 0.6.x.The YAML configuration format is deprecated and will be removed in a future release.
Input.appendCompilerOptions to allow appending custom compilerdefaultCompilerOpts from the public API, since it is now redundant and wasImportedType.class declarations are now treated like structs, and with C++ support on,class/struct keyword.std::uint16_t) was left unresolved, which dropped every function thatextern "C" { ... }$, e.g.outer::inner::Color becomes outer$inner$Color, and originalName isVisitor or importType can filter or renamepackage:cli_util versions 0.5.x and 0.6.x.Breaking change : Major overhaul of Dart config API:
Visitor pattern.
rename and renameMember replaced with .name setters on AST nodes.include and includeMember replaced with .isIncluded on AST nodes.Functions/Globals.includeSymbolAddress replaced with.exposeSymbolAddress on AST nodes.Functions.includeTypedef replaced with .generateTypedefs onFunc AST node.Structs.packingOverride replaced with Struct.pack.Enums.style and .silenceWarning moved to EnumClass AST node.Functions.isLeaf and .recordUse moved to Func AST node.Structs/Unions.dependencies moved to Struct/Union AST nodes.Interfaces/Protocols.module moved to ObjCInterface/ObjCProtocol ASTInterfaces/Protocols.includeTransitive removed (always false).Categories.includeTransitive replaced withObjCInterface.includeCategories.Typedefs.includeUnused consolidated into Typealias.isIncluded usingTypealiasInclude enum (never, ifUsed, always).imported fields and importedTypesByUsr intoFfiGenerator.importType, switching it to a callback patternimportFromSymbolFile and importFromSymbolFiles utils, which loadFfiGenerator.importType.Output.dartFile with DartOutput, to prepare for upcomingHeaders to InputlibraryImports, which was dead codeuseSupportedTypedefs, treating it as always truepreamble non-nullgenerate function asyncinstancetype are filtered.package:code_assets dependency to ^2.0.0.__Breaking change__: Remove deprecated useDartHandle field from FfiGenerator.
@Deprecated annotations from C/ObjC headers into generated Dart
bindings. Deprecation messages from __attribute__((deprecated("msg"))) and
API_DEPRECATED("msg", ...) are included in the annotation.useDartHandle field from
FfiGenerator.includeSymbolAddress field from
Categories, Interfaces, and Protocols.wrapperName field from
NativeExternalBindings.Output.sort. Sorting is now
always enabled.isA now accepts a nullable ObjCObject? and returns
false when called with null, aligning its behavior with Dart’s is
operator.xcrun for resolving macOS SDK paths, enabling support for non-standard
Xcode installations. #3134$allocate(Allocator $allocator, {required ...})SWIFT_UNAVAILABLE annotated init/new methods were
generating runtime-crashing no-arg constructors.__attribute__((unavailable)) were
incorrectly included in bindings when no platform version info was configured.Protocols.includeTransitive was not
working correctly.package:meta dependency to ^1.19.0 and stop generating
experimental_member_use lint ignore in generated bindings when
@RecordUse() is used.package:package_config.Nothing published for this version
Update tests and examples now that package:objective_c is using native assets.
Add xcodeUri, iosSdkUri, and macSdkUri, to mirror xcodePath, iosSdkPath, and macSdkPath.
xcodeUri, iosSdkUri, and macSdkUri, to mirror xcodePath,
iosSdkPath, and macSdkPath.Declarations.excludeAll, Declarations.includeAll,
Declarations.includeSet, Declarations.includeAllMembers,
Declarations.includeMemberSet, Declarations.useOriginalName,
Declarations.renameWithMap, Declarations.useMemberOriginalName, and
Declarations.renameMemberWithMap.__Breaking change__: Completely rewrite the public Dart API for FFIgen. The new API is focused on a declartive configuration: FfiGenerate(...) with a…
FfiGenerate(...) with
a generate() method. The configuration describes everything w.r.t. to the
FFIgen input and output. The generate method takes context parameters such as
a logger and path to libclang.
With this breaking change, also some defaults changed: (1) @Native bindings
are now the default, and (2) struct/unions refered to by pointer will be
generated as Opaque by default.isInstance to isA, castFrom to as, and castFromPointer to
fromPointer.Foo$Builder class.
The protocol's instance methods are now directly invokable from the built
object.show or hide when importing the interface.
show/hide to show or hide a particular interface, eg
Foo, you'll now also need to show or hide Foo$Methods.Foo.isInstance(x) instead of x is Foo
to check the runtime type of an ObjC object.NS_OPTIONS now default to generating int constants instead of a Dart enum.
Users who cared about this distinction were likely already using
enums.as-int for these enums. This change just provides a better default
behavior, so is unlikely to cause any substantive code changes.NSError** error, capture any error returned, and throw it as a Dart
NSErrorException.Logger argument of FfiGenerator.generate optional. It defaults to
a logger printing to stdout and stderr.Nothing published for this version
Nothing published for this version
Bump minimum Dart version to 3.8.0.
dart format so that the formatter uses the target package's
Dart version and formatting options._ to the list of Dart keywords, since it has special meaning in newer
Dart versions.__Breaking change__: Major change to the way ObjC methods are code-genned. Methods now use named parameters, making them more readable and closer to h…
NSData method
dataWithBytes:length: used to be generated as
dataWithBytes_length_(Pointer<Void> bytes, int length), but is now generated
as dataWithBytes(Pointer<Void> bytes, {required int length}). Protocol
methods are not affected.
_(.Fix a clang warning in ObjC protocol generated bindings.
__Breaking change__: Change the usrTypeMappings field of Config's factory constructor from a List to a Map .
headers.entry-points to
locate Apple APIs: $XCODE, $IOS_SDK, and $MACOS_SDK.new method,
which just calls that method.usrTypeMappings field of Config's factory
constructor from a List<ImportedType> to a Map<String, ImportedType>.keepIsolateAlive parameter to the block and protocol constructors that
allows a block or protocol to keep its owner isolate alive.keepIsolateAlive defaults to true, so all existing ObjC
blocks and protocols now keep their isolates alive by default.NSProxy.$ is used as a delimiter now, to avoid
renamed identifiers from colliding with other identifiers. For example, foo
is renamed to foo$1 if there's already a foo in the namespace.__Breaking change__: Maintain protocol conformance when translating from ObjC to Dart. For example, ObjC's id is now translated to Dart's FooProtocol.…
id<FooProtocol> is now translated to Dart's
FooProtocol. Generally this shouldn't be a breaking change for code that is
using protocols correctly, with a few caveats:
ObjCProtocolBuilder directly, after
calling build() you will need to cast the generated object to the target
protocol: FooProtocol.castFrom(protocolBuilder.build()).id is used: id<FooProtocol, BarProtocol> becomes FooProtocol. The
FooProtocol.castFrom method can help work around issues this may cause.max field to the external-versions config, and use it to determine
which APIs are generated.Ensure that required symbols are available to FFI even when the final binary is linked with -dead_strip.
-dead_strip.objc_retain calls from the generated bindings.__Breaking change__: Change the way ObjC categories are generated. Instead of inserting their methods into the interface, generate Dart extension meth…
package:dart_style directly to format generated Dart code, rather than
subprocessing to dart format.MyInterface.staticMethod must change to MyCategory.staticMethod.
Categories are included/excluded by the objc-categories config entry.include-transitive-objc-interfaces, include-transitive-objc-protocols,
and include-transitive-objc-categories config flags, which control whether
transitively included ObjC interfaces, protocols, and categories are
generated.include-transitive-objc-interfaces defaults to false,
which changes the default behavior from pulling in all transitive deps, to
generating them as stubs. include-transitive-objc-protocols defaults to
false, and include-transitive-objc-categories defaults to true, but these
both replicate the existing behavior.__Breaking change__: Only generate ObjC protocol implementation bindings for protocols that are included by the config filters. This is breaking becau…
ObjCBlock trampolines to reduce generated ObjC code.package:objective_c.objc-protocols filters.sort: config option now affects ObjC interface/protocol methods.NSRange was not being imported from package:objective_c:
https://github.com/dart-lang/native/issues/1180Fix bug with nullable types in ObjCBlock's type arguments: https://github.com/dart-lang/native/issues/1537
ObjCBlock's type arguments:
https://github.com/dart-lang/native/issues/1537__Breaking change__: ObjC blocks are now passed through all ObjC APIs as ObjCBlock , instead of the codegenned ObjCBlock_... wrapper. The wrapper is n…
void generate(Config config). Make Config an implementatble interface,
rather than needing to be parsed from yaml.external-versions config option. Setting the minimum target
version will omit APIs from the generated bindings if they were deprecated
before this version.assetId under ffi-native to asset-id to follow dash-case.ObjCBlock<Ret Function(Args...)>, instead of the codegenned
ObjCBlock_... wrapper. The wrapper is now a non-constructible set of util
methods for constructing ObjCBlock.s.requires_arc = [] in your podspec, this should
either be removed, or you should add the FFIgen generated ObjC code to the
list. If you're compiling directly with clang, add the -fobjc-arc flag.MyEnum and a struct
with a member MyEnum enumMember, two members are generated: enumMemberAsInt
which contains the original integer value, and enumMember, which is of type
MyEnum. If you configure the enum to be generated as Dart integers, this
new behavior will not apply, and the struct member will be an integer as well.sealed
classes as opposed to abstract classes.member-rename option to ObjC interface and protocol
methods and properties.member-filter option that filters ObjC interface and protocol methods
and properties.__Breaking change__: Code-gen the ObjC id type to ObjCObjectBase rather than NSObject, since not all ObjC classes inherit from NSObject. Eg NSProxy.
id type to ObjCObjectBase rather
than NSObject, since not all ObjC classes inherit from NSObject. Eg
NSProxy.output.objc-bindings config option.enums->as-int
option as specified in the README.silence-enum-warning to true.objc-protocols config option to generate bindings for a protocol.include-unused-typedefs to allow generating typedefs that are not
referred to anywhere, the default option is false.package:dart_flutter_team_lints.__Breaking change__: Use package:objective_c in ObjC bindings.
ffi-native option.ffi-native option.retainAndReturnPointer method to ObjC objects and blocks, and add
castFromPointer method to blocks.-Wno-nullability-completeness as default compiler option for MacOS.package:objective_c in ObjC bindings.
NSString have been moved into package:objective_c.lib argument anymore. In
fact, FFIgen won't even generate the native library class (unless it needs
to bind top level functions without using @Native). It is still necessary
to DynamicLibrary.open the dylib though, to load the classes and methods.final lib = FooNativeLib(DynamicLibrary.open('foo.dylib'));
must be changed to DynamicLibrary.open('foo.dylib');.lib parameter from all ObjC object constructors and static method calls
and block constructors.NSString are being used,
package:objective_c must be imported, as they won't be exported by the
generated bindings.structs/unions ->
dependency-only is set to opaque.__Breaking change__: Stop generating setters for global variables marked const in C.
--ignore-source-errors (or yaml config ignore-source-errors: true)
must be passed to change this behaviour.const in C.ffi-native functions marked leaf.Stable release targeting Dart 3.2 using new dart:ffi features available in Dart 3.2 and later.
dart:ffi features available
in Dart 3.2 and later.Pointer<NativeFunction<Function>>, also
generate a typedef for the Function.asset to assetId for ffi-native.Fix doc comment missing on struct/union array fields.
Added a JSON schema for FFIgen config files.
Fixed invalid code generated due to zero-length arrays in structs/union.
Fixed invalid code generated due to anonymous structs/unions with unsupported types.
Stable release for Dart 3.0 with support for class modifers, variadic arguments, and @Natives.
@Natives.Added support for variadic functions using config functions -> variadic-arguments.
functions -> variadic-arguments.Use @Native syntax instead of deprecated @FfiNative syntax.
@Native syntax instead of deprecated @FfiNative syntax.Fix invalid struct/enum member references due to multiple anonymous struct/enum in a declaration.
…pre 3.0, so adding the final keyword is not a breaking change.
final class modifier to generated sub types Struct, Union and
Opaque. A class modifier is required in Dart 3.0 because the classes
dart:ffi as marked base.
When migrating a package that uses FFIgen, and exposes the generated code in
the public API of the package, to Dart 3.0, that package does not
need a major version bump. Sub typing Struct, Union and
Opaque sub types is already disallowed by dart:ffi pre 3.0, so adding the
final keyword is not a breaking change.Fix invalid struct/enum member references due to multiple anonymous struct/enum in a declaration.
Generate parameter names in function pointer fields and typedefs.
Detect LLVM installed using Scoop on Windows machines.
Automatically generate ignore_for_file: type=lint if not specified in preamble.
ignore_for_file: type=lint if not specified in preamble.Fix some macros not being generated in some cases due to relative header paths.
Fix path normalization behaviour for absolute paths and globs starting with .
**.Add support nested anonymous union/struct
Add new supported typedef - uintptr_t (mapped to ffi.UintPtr).
uintptr_t (mapped to ffi.UintPtr).Change compiler option order so that user options can override built-in options.
Added newer versions of LLVM, to default linuxDylibLocations.
linuxDylibLocations.Fix helper methods sometimes missing from NSString.
Added support for sharing bindings using symbol-file config. (See README.md and examples/shared_bindings).
symbol-file config. (See README.md
and examples/shared_bindings).Handle declarations with definition accessible from a different entry-point.
Fix typedef include/exclude config.
ObjCBlock wrapper instead of raw pointer in more cases.Fix bug where function bindings were not deduped correctly.
_EXPERIMENTAL_ support for FfiNative. The API and output might change at any point.
FfiNative. The API and output
might change at any point.Added exclude-all-by-default config flag, which changes the default behavior of declaration filters to exclude everything, rather than include everyth
exclude-all-by-default config flag, which changes the default behavior
of declaration filters to exclude everything, rather than include everything.- Bump package:ffi to 2.0.1.
package:ffi to 2.0.1.Replace path separators in include-directives before matching file names.
include-directives before matching file names.libclang.Removed config dart-bool. Booleans are now always generated with bool and ffi.Bool as it's Dart and C Type respectively.
dart-bool. Booleans are now always generated with bool
and ffi.Bool as it's Dart and C Type respectively.Add a the xcode tools llvm as default path on MacOS.
Stable release targeting Dart 2.17, supporting ABI-specific integer types.
Fixed invalid default dart types being generated for size_t and wchar_t.
size_t and wchar_t.Added support for generating ABI Specific integers.
size-map and typedef-map.library-imports and type-map.- Analyzer fixes.
Added fix for empty include list to exclude all
Added fix for errors due to name collision between member name and type name used internally in structs/unions.
Your coding agent can read these notes before it upgrades. Set up the MCP server →