flutter_rust_bridge 1.20.1 flutter_rust_bridge: ^1.20.1 copied to clipboard
High-level memory-safe binding generator for Flutter/Dart <-> Rust
flutter_rust_bridge: High-level memory-safe binding generator for Flutter/Dart <-> Rust #
Want to combine the best between Flutter
, a cross-platform hot-reload rapid-development UI toolkit, and Rust
, a language empowering everyone to build reliable and efficient software? Here it comes!
🚀 Advantages #
- Memory-safe: Never need to think about malloc/free.
- Feature-rich:
enum
s with values, platform-optimizedVec
, possibly recursivestruct
, zero-copy big arrays,Stream
(iterator) abstraction, error (Result
) handling, cancellable tasks, concurrency control, and more. See full features here. - Async programming: Rust code will never block the Flutter. Call Rust naturally from Flutter's main isolate (thread).
- Easy to use: Merely write down your Rust code, run generator, and the Dart/Flutter code is there.
- Lightweight: This is not a huge framework that includes everything, so you are free to use your favorite Flutter and Rust libraries. For example, state-management with Flutter library (e.g. MobX) can be elegant and simple (contrary to implementing in Rust); implementing a photo manipulation algorithm in Rust will be fast and safe (countrary to implementing in Flutter).
- Easy to code-review & convince yourself: This package simply simulates how humans write boilerplate code. If you want to convince yourself (or your team) that it is safe, there is not much code to look at. No magic at all! (More about safety concerns.)
- Fast: It is only a thin (though feature-rich) wrapper, without overhead such as protobuf serialization, thus performant. (More benchmarks later) (Throw away components like thread-pool to make it even faster)
- Multi-platform: Android, iOS, Windows, Linux, MacOS (Web coming soon)
- Pure-Dart compatible: Despite the name, this package is 100% compatible with pure Dart.
💡 User Guide #
Check out the user guide for show-me-the-code, tutorials, features and much more.
Contributors ✨ #
Thanks goes to these wonderful people (emoji key):
fzyzcjy 💻 📖 💡 🤔 🚧 |
Viet Dinh 💻 ⚠️ 📖 |
Joshua Wade 💻 |
Marcel 💻 |
rustui 📖 |
Michael Bryan 💻 |
bus710 📖 |
Sebastian Urban 💻 |
Daniel 💻 |
Kevin Li 💻 📖 |
Patrick Auernig 💻 |
Anton Lazarev 💻 |
Unoqwy 💻 |
This project follows the all-contributors specification. Contributions of any kind welcome!