-
|
Hi! I am testing flutter_rust_bridge and when I add a simple function to api.rs run |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
|
Hi, could you please provide a minimal reproducible sample (probably a simple github repo)? And this looks like a bug, so feel free to create an issue! |
Beta Was this translation helpful? Give feedback.
-
|
Hi, I can make a basic example but I just yesterday cloned the repo and test it with frb_example/with_flutter, add to api.rs this: pub fn init() {}run |
Beta Was this translation helpful? Give feedback.
-
Can you show me exactly how? I didn't find any point about how to do it in the guide. I know you can input rust-input and dart-output to flutter_rust_bridge_codegen but I would expect a developer for a project to have to input them manually in each project. Is they any reason why the example project doesn't use build.rs for that witch sounds like the right place to put it? |
Beta Was this translation helpful? Give feedback.
Oh yes, the doc is a bit stale given that so many new features and new tutorials are added since it was created... Feel free to PR to fix it!
If you like build.rs, https://cjycode.com/flutter_rust_bridge/feature/build_rs.html and https://github.com/fzyzcjy/flutter_rust_bridge/blob/master/frb_example/pure_dart_multi/rust/build.rs (yes I know it is not with_flutter example...).
However, I am not sure whether build.rs is the best way for a Flutter app. You know, the codegen (invoked by build.rs or manually) generates Dart code, and if you run Flutter build which executes build.rs which generates Dart code, you will not get the new Dart code before Flutter build happens, so it may use the old…