A Rust-based tool that watches your Flutter project for file changes and automatically triggers hot reload. Features full keyboard passthrough, allowing you to use all Flutter run commands (r, R, h, q, etc.) just like running flutter run directly.
- 🔥 Automatic hot reload on Dart file changes
- ⌨️ Key passthrough: Send Flutter commands directly (r, R, h, q, etc.)
- 🚀 Spawns and manages Flutter run process
- 👀 Recursive file watching
- ⚡ Debounced reload to prevent excessive reloads
- 🎯 Configurable device targeting
- 🛡️ Graceful shutdown with Ctrl+C
- Rust (install from rustup.rs)
- Flutter SDK installed and in PATH
- A Flutter project to watch
git clone <repository-url>
cd flutter_watcher
cargo build --releaseThe binary will be available at target/release/flutter_watcher
cargo install --path .Run in the current directory (must be a Flutter project):
flutter_watcherflutter_watcher --path /path/to/flutter/projectflutter_watcher --device chrome
flutter_watcher -d "iPhone 14"flutter_watcher -- --release
flutter_watcher -- --dart-define=API_URL=https://api.example.comflutter_watcher --path ./my_app --device chrome -- --dart-define=ENV=dev- Spawns Flutter Process: Starts
flutter runwith your specified arguments - Watches for Changes: Monitors all
.dartfiles in the project directory - Auto-Reload: When a file changes, sends 'r' to the Flutter process stdin
- Key Passthrough: All keyboard input is forwarded to the Flutter process
- Debouncing: Waits 500ms between reloads to avoid excessive triggering
All Flutter run keyboard commands work seamlessly with flutter_watcher:
- r - Hot reload
- R - Hot restart (clears state)
- h - Display help
- c - Clear the screen
- q - Quit
- d - Detach (keep app running)
- s - Take a screenshot
- w - Dump widget hierarchy
- t - Dump rendering tree
- L - Dump layer tree
- S - Dump accessibility tree
- p - Toggle performance overlay
- P - Toggle performance overlay for specific layers
- a - Toggle timeline events for all widget build methods
- i - Toggle widget inspector
- o - Simulate different operating systems
- z - Toggle elevation checker
- v - Open Flutter DevTools
Simply type any of these commands while flutter_watcher is running, just as you would with flutter run.
Options:
-p, --path <PATH> Path to the Flutter project directory [default: .]
-d, --device <DEVICE> Device ID to run Flutter on (optional)
-h, --help Print help
-V, --version Print version
Additional Flutter arguments can be passed after '--'
flutter_watcher -d chromeflutter_watcher -d "iPhone 14 Pro"flutter_watcher -d emulator-5554flutter_watcher -d macos
flutter_watcher -d windows
flutter_watcher -d linuxcargo buildcargo run -- --path /path/to/flutter/projectcargo testThe Flutter process may have crashed or exited. Check the Flutter output above for errors.
Ensure Flutter is installed and available in your PATH:
flutter --version- Ensure you're editing
.dartfiles - Check that the Flutter process is still running
- Verify the file is within the watched directory
MIT
Contributions are welcome! Please feel free to submit a Pull Request.