Rust Integrated Dart

Integrate Rust into your Dart or Flutter app simply by annotating it.

Get started Early Access

Rust

#[rid::store]
#[rid::structs(Todo)]
pub struct Store {
    todos: Vec<Todo>,
}

impl rid::RidStore<Msg> for Store {
     fn create() -> Self {
        Self { todos: vec![Todo { title: "Try Rid".to_string() }] }
    }
    fn update(&mut self, req_id: u64, msg: Msg) {
        match msg {
            Msg::AddTodo(title) => {
                self.todos.push(Todo { title });
                rid::post(Reply::AddedTodo(req_id));
            }
        }
    }
}
        

Flutter

  void main() {
  final store = Store.instance;
  runApp(TodoApp(model));
}
// [ .. ]
class TodosView extends StatelessWidget {
  final Store store;
  TodosView(this.store, {Key? key}) : super(key: key);
  
  @override
  Widget build(BuildContext context) {
    final todos = store.todos;
    return Center(
      child: ListView.builder(
      itemCount: todos.length,
      itemBuilder: (_, index) => Text('${todos[index].title}'),
    ));
  }
}

          

Approachable

Interface from Flutter to Rust without writing complex and error prone FFI boilerplate.

Secure and Fast ⚡️

Author your application logic in Rust to benefit from its security and speed.

Quick UI Iteration

Benefit from Flutter's hot reload feature while creating the UI of your application.