As a general rule, if the modified code is downstream of the root
widget’s build() method, then hot reload behaves as expected.
However, if the modified code won’t be re-executed as a result
of rebuilding the widget tree, then you won’t
see its effects after hot reload.

For example, consider the following code:

After running this app, change the code as follows:

With a hot restart, the program starts from the beginning,
executes the new version of main(),
and builds a widget tree that displays the text Hello.

However, if you hot reload the app after this change,
main() and initState() are not re-executed,
and the widget tree is rebuilt with the unchanged instance
of MyApp as the root widget.
This results in no visible change after hot reload.

How it works

When hot reload is invoked, the host machine looks
at the edited code since the last compilation.
The following libraries are recompiled: