flutter_rust_bridge
2.13.0, released 3 months ago by cjycode.com
Flutter/Dart and Rust binding generator
Flutter FavoriteWASM-readyRock solid
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.
Works with
Packages commonly used together with flutter_rust_bridge: ones it builds on, ones built on it, and its own family.
- webflutter_rust_bridge depends on itLightweight bindings for browser APIs via JS interop
- asyncflutter_rust_bridge depends on itUtility classes and helpers that extend Dart's async library.
- argsflutter_rust_bridge depends on itLibrary for parsing raw command-line arguments into options and values using GNU and POSIX styles.
- loggingflutter_rust_bridge depends on itProvides configurable logging with levels and stream listeners for Dart apps.
- smtc_windowsBuilt on flutter_rust_bridgeWindows SystemMediaTransportControls implementation for Flutter
- haudiotaggerBuilt on flutter_rust_bridgeRead, write, and edit audio file metadata across multiple platforms.
- rhttpBuilt on flutter_rust_bridgeMake HTTP requests using Rust and reqwest via FFI for Flutter apps
- openmlsBuilt on flutter_rust_bridgeDart wrapper for OpenMLS, a Rust implementation of the Messaging Layer Security (MLS) protocol.