Closed vincenzopalazzo closed 1 year ago
I think it is good to start here https://docs.flutter.dev/platform-integration/android/c-interop without add external tools
I play with it a little bit and I found that the following call is blocking
/// Allow to create a lampo deamon from a configuration patch!
#[no_mangle]
pub extern "C" fn lampo_listen(lampod: *mut LampoDeamon) {
let Some(lampod) = as_rust!(lampod) else {
panic!("errro during the convertion");
};
let _ = lampod.listen().map_err(|err| panic!("{err}"));
}
So I test can expose another struct like Worker, with the thread inside is, and when we stop the application we will call .join
This is an idea but I did not test it
Dart package is landing in https://github.com/dart-lightning/lampo.rs/pull/44
Write the flutter bindings https://cjycode.com/flutter_rust_bridge/integrate.html