Skip to content
pubscout

objective_c

9.6.4, released 9 days ago by dart.dev

Support library for accessing Objective C via ffigen in Flutter

Rock solid
$ flutter pub add objective_c
Source repository

What it does

Provides Dart wrappers and utilities for Objective C objects, handling memory management and stream conversion. It is intended to be used alongside ffigen-generated bindings.

AI-written summary of version 9.6.3, based on the package's README and metadata. Report an inaccuracy

Use it when

  • You need to call Objective C APIs from Flutter
  • You are using ffigen to generate bindings for an Objective C library
  • You require efficient stream handling and memory safety for Objective C objects

Skip it when

  • You are not using ffigen or any Objective C code
  • You need a pure Dart solution for your platform

Strengths

  • Integrates tightly with ffigen
  • Offers memory‑management helpers (retain/release)
  • Performance improvements for stream and data conversion

Weaknesses

  • Not useful on its own
  • Limited to platforms that support Objective C (iOS, macOS, Windows, Linux, Android)
  • Requires native build steps

Setup

Kind
FFI (native library)
Effort
Low
Code generation
No
Direct dependencies
7
// Example usage with ffigen-generated bindings
import 'package:ffigen/ffigen.dart';
import 'package:objective_c/objective_c.dart';

final obj = MyObj();
final nsString = obj.toNSString();
print(nsString);

Alternatives

Packages that do the same job and could replace objective_c.

  • ffigen

    Generator for FFI bindings, using LibClang to parse C, Objective-C, and Swift files.

  • jnigen

    A Dart bindings generator for Java and Kotlin APIs using JNI and dart:ffi.

  • pigeon

    Type-safe code generator for communication between Flutter and host platforms.

  • native_toolchain_c

    Invoke the native C compiler installed on the host machine.

Works with

Packages commonly used together with objective_c: ones it builds on, ones built on it, and its own family.