1#[flutter_rust_bridge::frb(sync)]
2pub fn greet(name: String) -> String {
3 format!("Hello, you {name}!")
4}
5
6pub fn init_app() {
8 crate::platform::init_app();
9}
10
11#[flutter_rust_bridge::frb(sync)]
13pub fn heavy_computation(input: i32) -> i32 {
14 let mut result = input;
15 for _ in 0..1000 {
16 result = (result * 2) % 1000000;
17 }
18 result
19}
20
21#[flutter_rust_bridge::frb()]
23pub async fn async_heavy_work(input: i32) -> i32 {
24 tokio::time::sleep(tokio::time::Duration::from_millis(100)).await;
25 input * 2
26}