Coder Social home page Coder Social logo

hetian9288 / flutter_rust_bridge Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fzyzcjy/flutter_rust_bridge

0.0 1.0 0.0 5.67 MB

High-level memory-safe binding generator for Flutter/Dart <-> Rust

Home Page: https://fzyzcjy.github.io/flutter_rust_bridge/

License: MIT License

Shell 0.26% JavaScript 6.48% Ruby 0.24% C++ 1.88% Python 0.32% C 0.84% Objective-C 0.01% Rust 48.49% Kotlin 0.01% Dart 39.35% Swift 0.11% HTML 0.38% CMake 1.63%

flutter_rust_bridge's Introduction

flutter_rust_bridge: High-level memory-safe binding generator for Flutter/Dart <-> Rust

Rust Package Flutter Package Stars CI Example Codacy Badge

Logo

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: 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. 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).
  • Cross-platform: Android, iOS, Windows, Linux, MacOS, and Web.
  • 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)
  • 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.

๐Ÿ“Ž P.S. Convenient Flutter tests

If you want to write and debug tests in Flutter conveniently, with action history, time travelling, screenshots, rapid re-execution, video recordings, interactive mode and more, here is my another open-source library: https://github.com/fzyzcjy/flutter_convenient_test.

โœจ Contributors

All Contributors

Thanks goes to these wonderful people (emoji key following all-contributors specification):

fzyzcjy
fzyzcjy

๐Ÿ’ป ๐Ÿ“– ๐Ÿ’ก ๐Ÿค” ๐Ÿšง
Viet Dinh
Viet Dinh

๐Ÿ’ป โš ๏ธ ๐Ÿ“–
Joshua Wade
Joshua Wade

๐Ÿ’ป
Marcel
Marcel

๐Ÿ’ป
rustui
rustui

๐Ÿ“–
Michael Bryan
Michael Bryan

๐Ÿ’ป
bus710
bus710

๐Ÿ“–
Sebastian Urban
Sebastian Urban

๐Ÿ’ป
Daniel
Daniel

๐Ÿ’ป
Kevin Li
Kevin Li

๐Ÿ’ป ๐Ÿ“–
Patrick Auernig
Patrick Auernig

๐Ÿ’ป
Anton Lazarev
Anton Lazarev

๐Ÿ’ป
Unoqwy
Unoqwy

๐Ÿ’ป
Febrian Setianto
Febrian Setianto

๐Ÿ“–
syndim
syndim

๐Ÿ’ป
sagu
sagu

๐Ÿ’ป ๐Ÿ“–
Ikko Ashimine
Ikko Ashimine

๐Ÿ“–
alanlzhang
alanlzhang

๐Ÿ’ป ๐Ÿ“–
Sai Chaitanya
Sai Chaitanya

๐Ÿ’ป
Ares Andrew
Ares Andrew

๐Ÿ“–
raphaelrobert
raphaelrobert

๐Ÿ“–
thomas725
thomas725

๐Ÿ“–
Daniel Porteous (dport)
Daniel Porteous (dport)

๐Ÿ“–
Wouter Ensink
Wouter Ensink

๐Ÿ“–
่€่‘ฃ
่€่‘ฃ

๐Ÿ’ป ๐Ÿ“–
Lattice 0
Lattice 0

๐Ÿ’ป ๐Ÿ“–
orange soeur
orange soeur

๐Ÿ“–
Rom's
Rom's

๐Ÿ’ป ๐Ÿ“–
Cupnfish
Cupnfish

๐Ÿ’ป
SoLongAndThanksForAllThePizza
SoLongAndThanksForAllThePizza

๐Ÿ’ป ๐Ÿ“–
Sam Nystrom
Sam Nystrom

๐Ÿ“–
hsfzxjy
hsfzxjy

๐Ÿ’ป
muji
muji

๐Ÿ“–

More specifically, thanks for all these contributions:

  • Desdaemon: Support not only simple enums but also enums with fields which gets translated to native enum or freezed class in Dart. Support the Option type as nullable types in Dart. Support Vec of Strings type. Support comments in code. Add marker attributes for future usage. Add Linux and Windows support for with-flutter example, and make CI works for that. Avoid parameter collision. Overhaul the documentation and add several chapters to demonstrate configuring a Flutter+Rust project in all five platforms. Refactor command module. Precompiled binary CI workflow. Fix bugs. Add support for the Web platform, parallel to the existing mobile/desktop platforms, via WASM and JavaScript as intermediate values. GitHub retry actions.
  • SecondFlight: Allow structs and enums to be imported from other files within the crate by creating source graph. Auto-create relavent dir. Fix store_dart_post_cobject error with ffigen 6.0.
  • Unoqwy: Add struct mirrors, such that types in the external crates can be imported and used without redefining and copying.
  • antonok-edm: Avoid converting syn types to strings before parsing to improve code and be more robust.
  • lattice0: Support methods, such that Rust struct impls can be converted to Dart class methods. StreamSink at any argument.
  • sagudev: Make code generator a lib. Add error types. Depend on cbindgen. Fix LLVM paths. Update deps. Fix CI errors.
  • surban: Support unit return type. Skip unresolvable modules. Ignore prefer_const_constructors. Non-final Dart fields.
  • Roms1383: Fix build_runner calling bug. Remove global ffigen dependency. Improve version check. Fix enum name-variant conflicts. Support Chrono date time and UUID types. Migrate to Rust 1.64 workspace. Update and refactor CI. Update header comments. Code cleanup.
  • trobanga: Add support for [T;N] structs. Add usize support. Add a cmd argument. Separate dart tests.
  • dbsxdbsx: Allow generating multiple Rust and Dart files.
  • SoLongAndThanksForAllThePizza: Refactor and enhance SyncReturn to support more types.
  • hsfzxjy: Fix SyncReturn use-after-free bug.
  • alanlzhang: Add generation for Dart metadata. Enhance module parser.
  • AlienKevin: Add flutter example for macOS. Add doc for Android NDK bug.
  • efc-mw: Improve Windows encoding handling.
  • valeth: Rename callFfi's port.
  • Cupnfish: Allow multi mirror.
  • sccheruku: Prevent double-generating utility.
  • w-ensink: Improve doc. Fix CI. Refactor. Add tests.
  • Michael-F-Bryan: Detect broken bindings.
  • bus710: Add a case in troubleshooting.
  • Syndim: Add a bracket to box.
  • banool: Fix symbol-stripping doc.
  • TENX-S: Improve doc. Reproduce a bug.
  • raphaelrobert: Remove oudated doc.
  • tmpfs: Improve doc.
  • thomas725: Improve doc.
  • juzi5201314: Improve doc.
  • Stonks3141: Fix doc credit.
  • feber: Fix doc link.
  • rustui: Fix a typo.
  • eltociear: Fix a typo.

flutter_rust_bridge's People

Contributors

alanlzhang avatar alienkevin avatar allcontributors[bot] avatar antonok-edm avatar banool avatar bus710 avatar cupnfish avatar dbsxdbsx avatar dependabot[bot] avatar desdaemon avatar efc-mw avatar eltociear avatar feber avatar fzyzcjy avatar hetian9288 avatar juzi5201314 avatar lattice0 avatar mergeable[bot] avatar roms1383 avatar sagudev avatar sccheruku avatar secondflight avatar solongandthanksforallthepizza avatar stonks3141 avatar surban avatar syndim avatar tenx-s avatar trobanga avatar unoqwy avatar w-ensink avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.