Since Flutter apps run on the Dart VM, apps written in it can reload individual components rather than completely restart.
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:
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
enumtypes, including conversions from
- Changes to generic types.
- Changes to native code.
- Changes which depend on changes to application state may not be reflected.
Hot restart loads new code into the VM and restarts the app, discarding app state. Trigger with