Skip to content
pubscout

swiftgen

0.2.0, released 2 months ago by labs.dart.dev

A tool for generating bindings that allow interop between Dart and Swift code.

$ flutter pub add swiftgen
Source repository

What it does

Swiftgen is an experimental tool designed to generate bindings that facilitate interop between Dart and Swift code. It relies on dependencies like ffi, ffigen, and swift2objc to achieve this integration.

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

Use it when

  • You need to interoperate between Dart and Swift code
  • You are experimenting with Swift and Dart bindings generation

Skip it when

  • You need a stable, production-ready interop solution
  • You are not using Swift or Dart FFI

Strengths

  • Automates generating bindings between Dart and Swift
  • Integrates with ffigen and swift2objc

Weaknesses

  • Experimental tool
  • Not documented thoroughly beyond basic description

Setup

Kind
FFI (native library)
Effort
Medium
Code generation
No
Direct dependencies
7

not documented

Alternatives

Packages that do the same job and could replace swiftgen.

  • pigeon

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

  • code_builder

    A fluent, builder-based library for generating valid Dart code programmatically.

  • jnigen

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

  • code_assets

    Provides the hook protocol specification for bundling native code with Dart packages.

Works with

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