Summary
In this chapter, we learned that Flutter has three trees to efficiently paint the UI. The widget tree is used to configure the underlying Element
object. The element tree manages the widget life cycle, holds its state (if any), and much more. It’s good at comparing because it detects changes and updates or recreates the render object behind. The render object tree is used to paint the UI and handle gestures and does the low-level work.
With this information, we have built a simple but efficient counter app that keeps a small history of increased values. We have learned about the importance of constant constructors and saw a very effective technique to manually cache widgets. We could say that the more constant constructors we can use, the better.
In the last section, the app has been improved even more with the usage of an inherited widget that lifted the state up and allowed for more constant constructors.
The next chapter is about techniques to build UIs in...