flutter_rust_bridge.platform += 1: Write GUI on 6 platforms - now including web - with performance, hot-reload, and flexibility

82 points fzyzcjy

GitHub: https://github.com/fzyzcjy/flutter\_rust\_bridge

Finally, flutter\_rust\_bridge supports the last big platform - the Web. Now, you can freely write Dart(Flutter) and Rust code, and they will run in Web, phones (Android & iOS), desktops (Linux, MacOS, Windows) automatically.

Among with this upgrade, new features are there as well. Methods are now supported in addition to functions, multi-files are allowed, SyncReturn is enhanced, etc.

Special thanks to u/Desdaemon, who implemented the web support PR. Also thanks to all our 30 contributors, who added many features and fixed bugs (listed here).

P.S. Very briefly, what is flutter\_rust\_bridge:

  • Memory-safe: Never need to think about malloc/free.
  • Feature-rich: enums with values, platform-optimized Vec, possibly recursive struct, 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).
  • Lightweight: This is not a huge framework that includes everything, so you are free to use your favorite Flutter and Rust libraries.
  • Cross-platform: Android, iOS, Windows, Linux, MacOS (Web coming soon)
  • 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.
  • Pure-Dart compatible: Despite the name, this package is 100% compatible with pure Dart.