objective_c
A library to access Objective C from Flutter that acts as a support library for package:ffigen.
9.6.0
5.4M downloads/mo
#145 most downloaded on pub.dev
dart-lang/native
What this package is like to depend on
Last release 4 days ago
20 Aug 2026
Ships fairly regularly
a new release about every 5 weeks
Nearly every release is documented
notes for 24 of 25 stable releases
2 versions withdrawn
withdrawn after publishing
2 years old
28 releases · first in 2024
15 releases in the last 12 months
see the full history below
Release timeline
28 releases · May 2024 to Aug 2026
2025
2026
Releases
latest 28-
9.6.020 Aug 2026Release notes
Open source →- Add a bunch more categories to the bindings.
- Bump
package:code_assetsdependency to^2.0.0.
Release notes
Open source →- Add a bunch more categories to the bindings.
- Bump
package:code_assetsdependency to^2.0.0.
-
9.5.027 Jul 2026Release notes
Open source →- Add internal utils required to support FFIgen's new port based blocks.
- Make an internal-only FFI struct,
DOBJC_Context, opaque. This is technically a breaking change, but it's extremely unlikely that any users are using these internal structs (and doing so would be a mistake).
-
9.4.122 May 2026 -
9.4.020 May 2026 withdrawnRelease notes
Open source →- Fix a bug where a Dart GC safepoint during a non-leaf FFI call could prematurely release an ObjC block before ObjC retained it, causing an EXC_BAD_ACCESS crash.
- Fix (https://github.com/dart-lang/native/issues/2877) such that all
occurances of ObjCObject
isAnow accepts a nullableObjCObject?and returnsfalsewhen input isnull - Removed
NSOrderedCollectionChange.init(). This is not a breaking change because this method never would have worked, as it doesn't exist in Objective-C. - Fix a bug where missing debug symbols caused app store valiadtion warnings.
- Removed some test-only utilities from the release dylib (fixes #2999).
- Added
bool.toNSNumber()extension method,NSNumber.isBoolcheck and converter support for bool. - Remove dependency on native_toolchain_c.
- Add an optional
loaderparam togetClassandgetProtocol, which will be called to load the class/protocol. If theloaderfails, it falls back to the ObjC runtime functions,objc_getClassandobjc_getProtocol.
-
9.3.006 Feb 2026 -
9.2.529 Jan 2026 -
9.2.423 Jan 2026Release notes
Open source →- Fix a bug build hook path issue that could pass percent-encoded cache paths to clang, leading to missing source file errors.
-
9.2.320 Jan 2026Release notes
Open source →- Fix a bug where the objective_c framework was rejected by the Apple app store due to code signing issues.
-
9.2.217 Dec 2025 -
9.2.125 Nov 2025Release notes
Open source →- Fix bug where the build hook was trying to access the code config if it was not provided.
- Bump minimum Dart version to 3.10.0.
-
9.2.025 Nov 2025 withdrawnRelease notes
Open source →- Migrate to from a Flutter plugin to native assets. This enables package:objective_c to be used in command line apps.
-
9.1.019 Nov 2025 -
9.0.007 Nov 2025Release notes
Open source →- Use FFIgen 20.0.0
- Breaking change: The collection classes,
NSArray,NSSet,NSDictionary, and their mutable counterparts, no longer directly implement the corresponding Dart collections. Instead they each have a.toDart()method that wraps the class in an adapter that implements the Dart collection. Note that this is a shallow conversion. For deep conversions, continue usingtoObjCObjectandtoDartObject. - Breaking change: Rename the internal C types
ObjCObjectandObjCProtocoltoObjCObjectImplandObjCProtocolImplrespectively. - Breaking change: Rename the internal Dart types
ObjCObjectBaseandObjCProtocolBasetoObjObjectandObjCProtocolrespectively. - Fix missing
NSNumbercategory includes in iOS and macOSobjective_c.mfiles. - Add
NSBundleandNSNullto the bindings. - Add
autoReleasePoolfunction. - Fix a bug where
NSMutableDictionary.ofreturned aNSDictionary. - Add
NSErrorExceptionclass.
-
9.0.0+107 Nov 2025Nothing published for this version
-
9.0.0-dev.002 Sep 2025 pre-releaseNothing published for this version
-
8.1.022 Jul 2025Release notes
Open source →- Bump minimum Dart version to 3.8.0.
- Support the KVO pattern by adding
Observer,Observation, andNSObject.addObserver. - Remove a reference cycle between Dart and the
NSInputStreamreturned bytoNSInputStream.
-
8.0.019 May 2025Release notes
Open source →- Use FFIgen 19.0.0
NSArrayis now a DartIterableandNSMutableArrayis now a DartList.NSDictionaryandNSMutableDictionaryare now DartMaps.NSSetandNSMutableSetare now DartSets.- Add
.toNSNumber()extension method toint,double, andnum. - Add
DateTime.toNSDate()andNSDate.toDateTime()extension methods. - Add
CFStringRef.toDartString()andCFStringRef.toNSString(). - Add
toObjCObjectandtoDartObjectthat automatically convert between supported Objective C and Dart types. - Added various interfaces, protocols, categories etc to the built ins, such as NSPort and NSTimer.
-
7.1.008 Apr 2025 -
7.0.011 Mar 2025Release notes
Open source →- Use FFIgen 18.0.0
ObjCProtocolBuildersupports implementing protocol methods directly using a block.- Change how
ObjCProtocolBuilderis implemented to fix a bug, by removing all uses ofNSProxy. This causes a couple of very minor breaking changes:- Breaking change: It's no longer possible to add more methods to an
ObjCProtocolBuilderafterbuild()has been invoked. - Breaking change: Remove
NSProxyfrom the bindings. RenameDOBJCDartProxyBuildertoDOBJCDartProtocolBuilderandDOBJCDartProxytoDOBJCDartProtocoland change their APIs. Users should not be using these classes.
- Breaking change: It's no longer possible to add more methods to an
- Breaking change: Some API names have changed due to FFIgen's new duplicate
identifier renaming logic.
$is now used as a delimiter, to match JNIgen's renaming logic. - Added a
checkOsVersionfunction.
-
6.0.017 Feb 2025 -
5.0.012 Feb 2025Release notes
Open source →- Breaking change: Rename the
NSStringtoStringconversion method fromtoString()totoDartString(). - Add
ObjCProtocolBase, which all code genned protocols implement. - Add various ObjC categories (extension methods) to the built in classes.
- Add various ObjC protocols to the bindings.
- Make all visible API types public.
- Add a
osVersiongetter, which returns the current MacOS/iOS version. - Fixed a bug where Dart API symbols could be null despite Dart_InitializeApiDL returning successfully.
- Breaking change: Rename the
-
4.1.015 Jan 2025Release notes
Open source →- Use FFIgen 16.1.0
- Reduces the chances of duplicate symbols by adding a
DOBJC_prefix. - Ensure that required symbols are available to FFI even when the final binary
is linked with
-dead_strip. - Add support for blocking ObjC protocol methods.
-
4.0.015 Nov 2024Release notes
Open source →- Use FFIgen 16.0.0
- Add
NSOrderedCollectionDifferenceto the package. - Breaking change: As part of FFIgen 16.0.0, the way ObjC categories are
generated has changed. Instead of inserting their methods into the interface,
categories now generate Dart extension methods. For ordinary methods this
makes no difference, but static methods now need to be invoked on the
extension instead of on the class.
MyInterface.staticMethodmust change toMyCategory.staticMethod - Breaking change`: Another effect of the category overhaul is that we don't
automatically included all categories any more. This reduces the ammount of
bindings generated by omitting methods from obscure categories that most users
don't need. If you notice that a method you were using is now missing, there
are two options:
- Look up which category it came from in the Apple documentation, and generate bindings for that category yourself in your own package.
- If the category is common/important enough that it should be included in package:objective_c, file a bug and we'll consider adding it back in.
- Fixed a bug where missing methods could cause runtime errors, even if they weren't being implemented.
- Throw more useful errors in all internal failure cases.
- Added
ObjCProtocolMethod.isAvailablegetter, to make it easier to implement fallback logic if a method is missing at runtime.
-
3.0.021 Oct 2024Release notes
Open source →- Add the following stream-related types to the core package:
NSInputStreamNSOutputStreamNSRunLoopNSStreamNSStreamDelegateNSStreamEventNSStreamStatus
- Add
UnimplementedOptionalMethodException, which is thrown by the ObjC bindings if an optional method is invoked, and the instance doesn't implement the method. - Dispatch all object/block releases to the main thread.
- Add utils for converting Dart
Strings to Objective-C selectors and back. - Require Dart 3.4 or later (due to the use of
dart:ffiStruct.createbypackage:ffigen). - Breaking change: Return structs from ObjC methods by value instead of taking a struct return pointer.
- Add the following stream-related types to the core package:
-
2.0.006 Sep 2024Release 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 →- Drop API methods that are deprecated in the oldest versions of iOS and macOS that flutter supports.
- Added
ObjCBlock, which is the new user-facing representation of ObjC blocks. - Migrate to ARC (Automatic Reference Counting).
- Enable ObjC objects and blocks to be sent between isolates.
- Add
autoreleaseandretainAndAutoreleasemethods to ObjC objects and blocks. - Breaking change: Remove some convenience methods from
_ObjCRefHolder:isReleased,release,pointer, andretainAndReturnPointer. Uses of these methods now need to go through.ref. Egobj.pointerbecomesobj.ref.pointer.
- Validate bundled dynamic libraries by reading their header: when the file is
-
1.1.018 Jul 2024Release notes
Open source →- Add
DartProxy, which is an implementation ofNSProxythat enables implementing ObjC protocols from Dart. Also addsDartProxyBuilderfor constructingDartProxy. - Add some extensions methods for
NSMutableData. - Fix the
NSErrorbindings so that they're not empty. - Add
ObjCProtocolBuilder, which is an ergonomic wrapper aroundDartProxyBuilder. - Add
ObjCProtocolMethod, which contains all the information thatObjCProtocolBuilderneeds to implement a method. These objects are created by the FFIgen bindings for a protocol. - Make all of the code-genned structs and enums public so they can be reused by user bindings.
- Use
package:dart_flutter_team_lints.
- Add
-
1.0.115 May 2024 -
1.0.009 May 2024Release notes
Open source →- Move sharable code from FFIgen's generated code into this package, including
ObjCObjectBase, andObjCBlockBase, as well as the core Objective C runtime functions (exceptobjc_msgSend, which is library specific). - Move core ObjC classes such as
NSStringinto this package. - Delete Dart functions associated with ObjC closure blocks when the block is destroyed. Fixes https://github.com/dart-lang/native/issues/204
- Improve debuggability of memory management errors.
- Move sharable code from FFIgen's generated code into this package, including