flutter_rust_bridge 2.12.0

Flutter/Dart <-> Rust binding generator, feature-rich, but seamless and simple
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
use crate::dart_opaque::boxes::thread_box::ThreadBox;

#[derive(Debug, Clone)]
pub struct GeneralizedAutoDropDartPersistentHandle(wasm_bindgen::JsValue);
pub type GeneralizedDartHandleBox<T> = ThreadBox<T>;
pub type GeneralizedDartHandle = wasm_bindgen::JsValue;

impl GeneralizedAutoDropDartPersistentHandle {
    pub fn new_from_non_persistent_handle(non_persistent_handle: GeneralizedDartHandle) -> Self {
        Self(non_persistent_handle)
    }

    pub fn create_dart_handle(&self) -> GeneralizedDartHandle {
        self.0.clone()
    }
}