ffi
Utilities for working with Foreign Function Interface (FFI) code.
2.2.0
1000K downloads/mo
#86 most downloaded on pub.dev
dart-lang/native
What this package is like to depend on
Last release 6 months ago
11 Feb 2026
Release timing varies
gaps range from 2 weeks to 11 months
Nearly every release is documented
notes for 20 of 21 stable releases
1 version withdrawn
withdrawn after publishing
7 years old
32 releases · first in 2019
2 releases in the last 12 months
see the full history below
Release timeline
32 releases · Sep 2019 to Feb 2026Releases
latest 32-
2.2.011 Feb 2026Release notes
Open source →- Add
ProtocolExtension.setupLogger, which the hooks runner calls to provide
the logger used for validation diagnostics before any other method is invoked
on the extension. - Fix
HookInputUserDefines.pathmangling absolute Windows paths: the drive
letter was parsed as a URI scheme. Absolute paths are now returned as-is;
relative paths are resolved against the source of the path. - Add
HookInputUserDefines.baseUri, which can be used to resolve paths
from nested user-defined options.
- Add
-
2.1.507 Jan 2026 -
2.1.417 Feb 2025 -
2.1.312 Aug 2024Release notes
Open source →- Use
package:dart_flutter_team_lints. - Migrate from
DynamicLibrary.process()to@Native externalfunctions. https://github.com/dart-lang/native/issues/1401
- Use
-
2.1.217 Jan 2024 -
2.1.115 Jan 2024 -
2.1.008 Aug 2023Release notes
Open source →- Require Dart 3.0.0 or greater.
- Expose native equivalent to
free(nativeFree) frommallocandcallocallocators.
-
2.0.209 May 2023Release notes
Open source →- Fixed a typo in a doc comment.
- Added package topics to the pubspec file.
-
2.0.119 Jun 2022Release notes
Open source →- Only zero out memory on successful allocation on Windows.
- Upgrade test dev dependency.
-
2.0.027 May 2022Release notes
Open source →- Validate bundled dynamic libraries by reading their header: when the file is
a recognized ELF, Mach-O, or PE binary, check that it was built for the
target architecture. Reject multi-architecture Mach-O output because hooks
run once per target architecture. A file the built-in validators do not
recognize, or a recognized library built for an architecture they do not
know, warns on the supplied logger instead of failing. - Bump the dependency on
package:hooksto^2.2.0. - Breaking change: Overrode
==andhashCodeinOS,Architecture, andSanitizerto support custom targets. These objects can no longer be used as keys ofconstmaps and sets.- Migration: Use
final(runtime) maps and sets instead ofconst, or use the string representations (e.g.,OS.name,Architecture.name) as keys ifconstis required.
- Migration: Use
- Support custom target OS, architecture, and santizer in protocol extension.
Release notes
Open source →- Switch Windows memory allocation to use
CoTaskMemAllocandCoTaskMemFree, which will enable support forNativeFinalizer. - Require Dart 2.17.0 or greater.
- Validate bundled dynamic libraries by reading their header: when the file is
-
1.2.113 May 2022Release notes
Open source →Revert added common C integer types as ABI-specific integers. Instead, these are available in Dart 2.17.
-
1.2.003 Feb 2022 withdrawn -
1.2.0-dev.020 Jan 2022 pre-releaseRelease notes
Open source →Added common C integer types as ABI-specific integers. These common C integer types will make their way into
dart:ffiin 2.17 and be deprecated from this package. Having them in this package enables using them in Dart 2.16.This pre-release requires Dart
2.16.0-118.0.devor greater. -
1.1.204 Jun 2021 -
1.1.127 May 2021Release notes
Open source →- Fix quadratic deserialization performance and index corruption in
Recordings.fromJson.
Release notes
Open source →Adds a sanity check to
Pointer<Utf8>andPointer<Utf16>extension methods that receiver is notnullptr. - Fix quadratic deserialization performance and index corruption in
-
1.1.025 May 2021Release notes
Open source →Adds the
arenaallocator.Moves from static analysis with lints in package:pedantic to package:lints.
-
1.0.011 Feb 2021Release notes
Open source →Bumping the version of this package to
1.0.0.Removes all deprecated methods, use
0.3.0-nullsafety.3for migration. -
0.3.1-nullsafety.011 Feb 2021 pre-releaseRelease notes
Open source →Deprecates the static methods on
Utf8andUtf16and introduces extension methods to replace them. -
0.3.0-nullsafety.310 Feb 2021 pre-releaseRelease notes
Open source →Adds back in deprecated
allocateandfreeto ease migration. These will be removed in the next release.This pre-release requires Dart
2.12.0-259.9.betaor greater. -
0.3.0-nullsafety.209 Feb 2021 pre-releaseNothing published for this version
-
0.3.0-nullsafety.103 Feb 2021 pre-releaseRelease notes
Open source →This pre-release requires Dart
2.12.0-259.8.betaor greater.Note that this pre-release does not work in Flutter versions containing Dart
2.12.0-260.0.dev-2.12.0-264.0.dev. UsingAllocator.callthrows aNoSuchMethodErrorin these versions. See Flutter Engine #23954 for more info. -
0.3.0-nullsafety.001 Feb 2021 pre-releaseRelease notes
Open source →Changes
Utf8andUtf16to extendOpaqueinstead ofStruct. This means.refis no longer available andPointer<Utf(..)>should be used. See breaking change #44622 for more info.Removes
allocateandfree. Instead, introducescallocwhich implements the newAllocatorinterface. See breaking change #44621 for more info.This pre-release requires Dart
2.12.0-265.0.devor greater. -
0.2.0-nullsafety.118 Nov 2020 pre-release -
0.2.0-nullsafety.016 Nov 2020 pre-releaseRelease notes
Open source →Pre-release (non-stable) release supporting null safety. Requires Dart 2.12.0 or greater.
-
0.1.305 Nov 2019Release notes
Open source →Stable release incorporating all the previous dev release changes.
Bump SDK constraint to
>= 2.6.0. -
0.1.3-dev.315 Oct 2019 pre-release -
0.1.3-dev.110 Oct 2019 pre-releaseRelease notes
Open source →- Adds top-level
allocate<T>()andfree()methods which can be used as a replacement for the deprecatedPointer.allocate<T>()andPointer.free()members indart:ffi.
- Adds top-level
-
0.1.210 Oct 2019Nothing published for this version
-
0.1.109 Sep 2019 -
0.1.1+110 Oct 2019 -
0.1.1+210 Oct 2019 -
0.1.009 Sep 2019