Skip to content
pubscout

flutter_rust_bridge

2.13.0, released 3 months ago by cjycode.com

Flutter/Dart and Rust binding generator

Flutter FavoriteWASM-readyRock solid
$ flutter pub add flutter_rust_bridge
Source repository

What it does

Generates glue code between Flutter/Dart and Rust, allowing you to seamlessly call Rust code from Dart and vice versa. It supports arbitrary types, async Rust, traits, and complex data structures without manual boilerplate.

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

Use it when

  • You need high-performance Rust code for CPU-heavy computations or data-intensive operations in Flutter.
  • You want to reuse existing Rust libraries or codebases within a cross-platform mobile, desktop, or web Flutter app.

Skip it when

  • Your application does not require performance-critical native code or systems programming capabilities.
  • You want to avoid external toolchains such as Cargo and Rust compilation steps in your project workflow.

Strengths

  • Supports arbitrary Rust and Dart types, asynchronous Rust, and two-way communication (Rust calling Dart).
  • Officially recognized as a Flutter Favorite package with strong reliability and CI coverage.

Weaknesses

  • Requires setting up and managing a Rust toolchain alongside your Flutter development environment.
  • Build times and project complexity can increase due to cross-compilation requirements for multiple platforms.

Setup

Kind
Pure Dart
Effort
Medium
Code generation
No
Direct dependencies
8

Requires installing cargo install flutter_rust_bridge_codegen, setting up a Rust directory in your project, and running code generation commands.

final dict = await WordDict.open((situation) => true);
print(dict.size);
await for (final value in dict.search('something')) { print(value); }

Alternatives

Packages that do the same job and could replace flutter_rust_bridge.

  • ffi

    If you prefer writing manual Dart FFI bindings without an external code generator.

Works with

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