ホットリロードはFlutterの最も愛される機能の1つで、アプリを再起動したり現在の状態を失うことなく、コード変更がほぼ瞬時(1秒未満)に実行中のアプリに反映されることができます。これは開発と実験のスピードを劇的に加速させます。
ホットリロードが行うこと
HOT RELOAD injects updated code into the RUNNING app:
→ make a code change → save → see it reflected in ~1 second
→ the app KEEPS its current STATE (you stay on the same screen, with the same data)
→ no full restart, no re-navigating to where you were
→ Edit UI/logic and see the result almost immediately while the app runs.
ホットリロード対ホットリスタート
HOT RELOAD → injects changes, PRESERVES app state (fast, ~1s) — for most UI/code changes
HOT RESTART → restarts the app, RESETS state (a bit slower) — for changes hot reload
can't handle (e.g. changes to main(), global state initialization, some structural changes)
FULL RESTART → rebuild and relaunch (slowest) — for native code changes, deep changes
