Skip to main content

Example applications

Complete projects from frus 0.5.0, each a standalone Cargo project that depends on the published crate. Read them in this order.

  1. hello_world

    The smallest application: one entry point, one StatelessWidget page

  2. counter

    State: a StatefulWidget, its State, handlers, a timer, unit tests

  3. widgets

    The widget gallery: every widget with a live example and its code

  4. forms

    Text fields, choices, pickers, validation and submission

  5. navigation

    Routes, parameters, query strings, nested pages, guards, navigation bars

  6. http

    Calling a JSON API: loading, errors, retries, posting data

  7. websocket

    A long-lived connection: messages over time, sending, reconnecting

  8. authentication

    Sign-in, a shared auth service, route guards, sessions

  9. forge

    A larger real application (front end and back end)

Running one

Unzip it, then from its folder:

cargo run # on the desktop: Windows, macOS, Linux
cargo test # its tests, without a window
frus run -d web # in the browser, with the frus command
frus run -d android # on the connected phone

Every project is laid out the same way, described in App structure. The frus command is covered in The frus command.