Skip to content

chptx/rxterm2

Repository files navigation

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! 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:

Windows

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

1、install rust

  • windows use installer,last step for set PATH

2、install vs build tool with win 11 sdk(10.0.22000.0)

3、(priv)open developer powershell for vs 2022(which has cmake command)

  • install corrosion
git clone https://github.com/corrosion-rs/corrosion.git
cmake -Scorrosion -Bbuild -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release
cmake --install build --config Release

4、change for windows

https://cjycode.com/flutter_rust_bridge/template/setup_desktop.html

5、(priv)build windows with vscode

flutter run -d windows -v

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.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors