Reloading

Since Flutter apps run on the Dart VM, apps written in it can reload individual components rather than completely restart.

Hot reload

Entering r at a flutter run invocation triggers a hot reload. Hot reloads load new code into the VM and rebuild the widget tree preserving app state: main() and initState() are not invoked. Most changes can be triggered this way, except for:

  • Apps being killed, e.g. because they spent too long in the background on mobile platforms.
  • Changes to enum types, including conversions from class to enum.
  • Changes to generic types.
  • Changes to native code.
  • Changes which depend on changes to application state may not be reflected.

Hot restart

Hot restart loads new code into the VM and restarts the app, discarding app state. Trigger with R at flutter run.