Hot Reload as a Workflow
How hot reload actually works, what it can't do, and building a faster development loop around it.
읽는 데 3분
Flutter's hot reload is often the first thing that surprises newcomers: change a line of code, save, and the running app updates in under a second — without losing its current state. This lesson explains what's actually happening, because understanding it changes how you use it.
What hot reload actually does
When you save a file while flutter run is active, Flutter injects the updated source code into the already-running Dart VM, without restarting the app. Because the app process itself never stops, existing widget state — text you've typed into a field, a counter's current value, the screen you're currently on — survives the update. Flutter then triggers a rebuild of the widget tree using the new code, so your change appears immediately in context.
This is fundamentally different from a hot restart, which does end the app process and start fresh: state resets, but every change — no matter how deep — is guaranteed to apply cleanly.
r -> hot reload (keeps state, applies most code changes)
R -> hot restart (resets state, guaranteed to apply all changes)
q -> quit
These keyboard shortcuts are available directly in the terminal running flutter run.
Building this into your workflow
The practical habit worth building: navigate your app to the exact screen and state you're working on once, then leave it there while you iterate with hot reload repeatedly. If you're tweaking a form's padding, hot reload lets you adjust the padding value ten times in ten seconds without re-typing test data into the form each time — because that data hasn't been lost.
Padding(
padding: const EdgeInsets.all(16), // change this, save, see it instantly
child: MyForm(),
)What hot reload can't do
Hot reload has real limits, and recognizing when you've hit one saves time chasing a change that "isn't showing up":
- Changes to
main()— since it already ran once, edits there require a hot restart. - Changes to a class's fields — adding or removing a field on a
Stateclass, or changing static/global state initializers, generally needs a hot restart to take effect correctly. - Native code changes — anything in the
android/orios/folders, or new plugin dependencies, requires a full stop-and-rerun offlutter run. pubspec.yamlchanges — new dependencies or asset declarations needflutter pub getand a restart, not just a reload.
Flutter's tooling is generally good about detecting these cases and performing a hot restart automatically, or telling you one is needed — but if a change genuinely isn't showing up after a hot reload, a hot restart is the first thing to try before assuming something is broken.
Hot reload versus a full rebuild
Without hot reload, testing a UI tweak in most native mobile development means a full recompile — often tens of seconds to minutes. Flutter's near-instant reload loop is a major part of why it feels productive to iterate on layout and styling in particular, where you're often making many small visual adjustments in a row and want to see each one immediately rather than batching changes and waiting.