Flutter for Beginners
上QQ阅读APP看书,第一时间看更新

Compiling Flutter apps and hot reload

When you're writing or debugging code, you will be using the Dart VM with JIT. This helps to utilize features such as profiling tools, hot reloading (you can refer to Chapter 3An Introduction to Flutter), and more. 

When building your app for release, the code will be compiled in AOT and your app will ship with a tiny version of the Dart VM (which is more like a runtime library) with Dart SDK capabilities such as core libraries and garbage collectors.

This difference, at first, does not seems to be important from the developer's point of view, as we want to simply write and run the app, right? However, when it comes to productivity, this becomes one of the most fundamental Dart strengths used by Flutter.

Flutter's hot reload is one of its most famous features and shows the promised productivity in action. It relies on JIT compilation to make live Dart code swaps while running the app, so we can change our application code and see the result almost in real time. With IDE plugins, this becomes even faster as, after saving a change, the plugin dispatches the reload and the result is seen quickly.

In Chapter 3 An Introduction to Flutter, we will check out hot reload and other features in more detail.

No image can describe the potential of this incredible feature. So, after checking out Chapter 3An Introduction to Flutter, I suggest you run the Flutter starter project to have first contact with this incredible feature.

Another very cool Dart tool is the Dart analyzer:

This tool helps to figure out potential problems with types and the recommended syntax before running the code.

DevTools also adds an important value to the productivity offered by the Flutter framework; find out more information in Chapter 12, Testing, Debugging, and Deployment.