NikolaRusakov / polars-dart

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

flutter_rust_bridge_template

This repository serves as a template for Flutter projects calling into native Rust libraries via flutter_rust_bridge.

Getting Started

To begin, ensure that you have a working installation of the following items:

echo "ANDROID_NDK=.." >> ~/.gradle/gradle.properties

Then go ahead and run flutter run (for web, run dart run flutter_rust_bridge:serve instead). When you're ready, refer to our documentation here to learn how to write and use binding code.

Once you have edited api.rs to incorporate your own Rust code, the bridge files bridge_definitions.dart and bridge_generated.dart are generated using the following command (note: append --wasm to add web support):

Windows

flutter_rust_bridge_codegen --rust-input native\src\api.rs --dart-output .\lib\bridge_generated.dart --dart-decl-output .\lib\bridge_definitions.dart

Linux/MacOS/any other Unix

flutter_rust_bridge_codegen --rust-input native/src/api.rs --dart-output ./lib/bridge_generated.dart --dart-decl-output ./lib/bridge_definitions.dart

Scaffolding in existing projects

If you would like to generate boilerplate for using flutter_rust_bridge in your existing projects, check out the flutter_rust_bridge brick for more details.

Disclaimer

This template is not affiliated with flutter_rust_bridge. Please file issues and PRs related to the template here, not flutter_rust_bridge.

License

Copyright 2022 Viet Dinh.

This template is licensed under either of

at your option.

The SPDX license identifier for this project is MIT OR Apache-2.0.

About

License:Apache License 2.0


Languages

Language:C++ 29.8%Language:CMake 26.9%Language:Dart 24.9%Language:Rust 8.0%Language:C 4.9%Language:HTML 2.5%Language:Swift 2.4%Language:Just 0.4%Language:Kotlin 0.2%Language:Objective-C 0.1%