Warning: it's extremely unlikely that you should use this package. It's almost always a better idea to write a Flutter plugin.
This package enables Dart developers to use various C APIs by Apple. The package uses dart:ffi and the C APIs are generated with ffi_tool.
Until dart:ffi supports finalizers (Dart SDK issue #35770),
you need to call reference counting manually (the package provides arcRetain
and arcRelease
).
- Core Foundation
- developer.apple.com/documentation/corefoundation
- Import:
package:cupertino_ffi/core_foundation.dart
- Objective-C runtimes
- developer.apple.com/documentation/objectivec/objective-c_runtime
- Import
package:cupertino_ffi/objc.dart
Important: Core Foundation primitives are "toll-free"
compatible with Foundation primitives (NSArray, NSString, etc.).
In other words, conversion between Pointer<CFString>
and Pointer<NSString>
are simple casts.