Hiprup

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, reruns build() 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 from main(), 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() or initState() — Hot Reload reruns build() but does NOT re-run initState().

  • Adding/removing class fields, changing enums, changing const values 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 listmain(), 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.