Skip to content
pubscout

native_toolchain_c

0.19.6, released 14 days ago by labs.dart.dev

Invoke the native C compiler installed on the host machine.

$ flutter pub add native_toolchain_c
Source repository

What it does

A library designed to invoke the native C compiler installed on the host machine. It provides tools such as CBuilder and CLinker to compile sources and link binaries.

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

Use it when

  • You need to build and compile native C or C++ code as part of your Dart/Flutter build process.
  • You are using native assets/hooks to build C libraries on the host machine.

Skip it when

  • You are looking for a stable, non-experimental library (this is currently experimental under labs.dart.dev).
  • You are developing pure Dart applications without native C dependencies.

Strengths

  • Supports multiple platforms including Android, iOS, Windows, macOS, and Linux.
  • Allows mocking file systems and process invocations for tests via package:file and package:process.
  • Handles complex build scenarios like MSVC environments and linker options.

Weaknesses

  • Currently experimental with a high expected rate of API and breaking changes.
  • Published under labs.dart.dev with uncertain long-term graduation or discontinuation status.

Setup

Kind
Pure Dart
Effort
Medium
Code generation
No
Direct dependencies
8

Requires native C compilers to be installed on the host machine (such as MSVC on Windows, Xcode on macOS/iOS, or GCC/Clang on Linux/Android).

not documented

Alternatives

Packages that do the same job and could replace native_toolchain_c.

  • jnigen

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

  • objective_c

    Support library for accessing Objective C via ffigen in Flutter

Works with

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