Closed 988494 closed 3 months ago
Hi! Thanks for opening your first issue here! :smile:
Hmm, firstly, could you please check whether Rust really calls the callback
? For example, if it is on the Err(_) => {}
branch, then it will not call.
Secondly, to run async in sync, you can do https://github.com/fzyzcjy/flutter_rust_bridge/blob/9e5c6e54723700e8436bc76016173e0391befa8e/frb_example/integrate_third_party/rust/src/api/override_web_audio_api.rs#L168-L170.
Thirdly, or even better, just write down pub async fn on_connect_success
, and then you do not need to do anything extra, but can directly call callback("Tom".to_owned()).await;
Close since no response, but feel free to reopen if needed or have a complete minimal reproducible sample!
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new issue.
Describe the bug
rust failed to call dart and kept blocking:impl Fn(String) -> DartFnFuture<()>
Steps to reproduce
暂无
Logs
Expected behavior
rust code
dart code:
note: Run the main() method. Always blocked not executed log:
note: print(" callback success: $name") is not executed;
Generated binding code
OS
No response
Version of
flutter_rust_bridge_codegen
2.1.0
Flutter info
No response
Version of
clang++
暂无
Additional context
暂无