Hot reload bảo tồn state của app và tải lại code nhanh, chỉ chạy lại build() mà không chạy lại initState() hay main().
- Hot restart phá hủy toàn bộ state, chạy lại
main()vàinitState(), biên dịch lại app hoàn toàn. - Dùng hot reload cho chỉnh sửa UI (~100ms), hot restart khi thay đổi khởi tạo state hoặc định nghĩa class (~1-2s).
Hot reload preserves app state and quickly reloads code changes, rerunning only build() methods.
- Hot restart destroys all state, re-runs
main()andinitState(), fully recompiling the app. - Use hot reload for UI tweaks, hot restart when you change state initialization or class definitions.