Friday, November 18, 2016

Flutter: The best mobile development experience?

Developing for mobile just got a lot more fun with Flutter’s live developer workflow. At the heart of this new workflow is the Dart VM’s latest feature ‘hot reload’. Hot reloading your program allows you to update the code without restarting your application. Make changes to your program and see them instantly on your Android or iOS device.

Many programming languages support updating the running program but these all suffer from limitations that make using the feature difficult and error prone. The Dart VM’s hot reload is safe and fast. First, we designed the system to be safe and be reversible. If we detect issues at reload time, the VM will restore the original source code as if nothing happened. It’s fast because you can import new libraries, create new classes, and even add fields to existing classes without restarting your application.

Flutter works naturally with hot reload and you can see your changes on your mobile device in less than a second. And because we reload the changes into the running app, you don’t need to waste time navigating back to where you were in the app. We measure our development cycle in milliseconds!


In our talk we share some technical information on the implementation and do a deep dive on the semantics of Dart during a reload.



Some of the questions covered in the talk are:
  • What happens to static data?
  • What if functions are already on the stack when a reload occurs?
  • How do you handle adding an instance field to classes that have instantiated objects?
There is even more exciting features coming to Flutter’s mobile developer experience. The developer experience team is hard at work adding support for fix-and-continue debugging. Be sure to watch Todd’s exciting demo of this feature.

Posted by John McCutchan & Todd Turnidge, Hot Reloaders