Skip to content

jiahaog/flt

Repository files navigation

flt

flt is a Flutter Terminal Embedder, implementing the Flutter Engine's Custom Embedder API.

With a terminal emulator that supports Kitty graphics, 60fps rendering can be achieved.

wonderous_kitty.mov

Otherwise, it falls back to using ANSI Escape Codes.

wonderous_ansi.mov

This works over SSH though it may be slow depending on the network.

Supported Platforms / Terminals

Kitty rendering was mostly developed on macOS. Tested on iTerm2 and Ghostty.

ANSI rendering should work on more terminals.

Checkout

This project uses submodules, so pass the --recurse-submodules flag.

git clone --recurse-submodules git@github.com:jiahaog/flt.git

Usage

Install Rust first, then at the root of the monorepo, the following command will build the Sample Flutter App, and run it with the terminal embedder.

cargo run

Other Flutter Projects

cargo run -- <path to the root of your flutter project>

Usage with flutter run (Custom Device)

The terminal embedder can be registered as a Custom Device to use it directly with the flutter tool (supporting hot reload, hot restart etc.).

  1. Enable Custom Devices:

    flutter config --enable-custom-devices
  2. Build the Embedder:

    cargo build --release
  3. Install Custom Device:

    Run the installation script to configure the custom device and launcher:

    ./install_custom_device.sh
  4. Run:

    flutter run -d terminal

More CLI help for development

# See help for `flt-cli`.
cargo run -- --help

# See help for `flt`.
cargo run -- --args=--help

Project Structure

  • flt - The terminal embedder.
  • flt-cli - A small CLI utility to make local development easier. By default, the cargo run command at the root of the repository will run this.
  • flutter-sys - Safe Rust bindings to the Flutter Embedder API.
  • sample_app - A sample Flutter Project used for local development.
  • third_party/flutter - A submodule checkout of the Flutter Framework.

References

About

Run Flutter Apps in the terminal

Resources

License

Stars

Watchers

Forks