What is Hot Reload vs Hot Restart? When does Hot Reload fail?
Two related but distinct dev-loop tools.
Hot Reload (press
r) — injects updated source into the running Dart VM, rerunsbuild()methods, preserves state (nav stack, counters, scroll position). <1 second. Best for tweaking UI / layouts / colors.
Hot Restart (press
R) — kills the Dart VM state, restarts the app frommain(), loses state. 2-5 seconds. Best for pubspec changes, native code edits, app-init bugs.
When Hot Reload fails or silently doesn't reflect changes:
Changes to
main()orinitState()— Hot Reload rerunsbuild()but does NOT re-runinitState().Adding/removing class fields, changing enums, changing
constvalues used at compile time.Native Android/iOS code edits — needs a full rebuild.
Adding a package —
flutter pub get+ Hot Restart.Global / static state — won't reset on Hot Reload.
Three things signal real Flutter experience: (1) 'Hot Reload preserves state, Hot Restart loses it' — most candidates can recite this; (2) 'Hot Reload reruns build() but does NOT re-run initState()' — that's the senior detail; (3) the failure list — main(), enums, static fields, native code edits, package adds. Mentioning the stateful_hot_reload caveat ('your bug is probably stale state, not the framework') shows you've debugged Hot Reload weirdness in production.