DEV Community

Discussion on: Flutter in 30 Seconds

Collapse
 
twof profile image
Alex Reilly

I haven't gotten the chance to try it out yet, but the most exciting Flutter feature to me was hot reloading. Is it as convenient as it looked in the demos?

Collapse
 
nitya profile image
Nitya Narasimhan, Ph.D

Hot reloading (and it IS stateful) works just as advertised both from IDE (click the lightning bolt in toolbar) or command-line (if you run something with "flutter run" it will prompt you in the terminal to simply use "ctrl-r" for hot reloads) so from a convenience standpoint - yes!!

I am still trawling through docs and learning - but I do know there are cases where it will NOT work (see flutter.io/hot-reload/). I saw this happen when I added widgets to the current app (tree). In such cases, it does prompt you to do a full restart. But changing values (e.g., for styling) or functions (e.g., for processing) within classes should be fine.

One thing I liked is that it would give me an indication of how long it took to do the hot reloading. As I work with more apps/widgets, I hope to gain an intuition for what kinds of changes are ideally suited (or not) in terms of the time taken to effect a hot reload.

For instance, I hope to take the source code for the Flutter Gallery (examples/) app and deconstruct parts of it to get a better understanding of how to design complex apps within this architecture - how is the performance/reload-ability impacted by number of widgets in tree, number of source files used etc. So much to learn..

However, I think this is an awesome feature if you are working in teams (designer+developer) and want to quickly iterate and explore ideas in real time.

I am just starting to dig into more complex examples so stay tuned and do share your insights back here when you explore this further :-)