5

Mastering Layout and Taming the Widget Tree

A tree data structure is a favorite of computer engineers (especially in job interviews!). Trees elegantly describe hierarchies with a parent-child relationship. You can find user interfaces (UIs) expressed as trees everywhere. HyperText Markup Language (HTML) and the Document Object Model (DOM) are trees. UIViews and their subviews are trees. The Android Extensible Markup Language (XML) and the .NET Extensible Application Markup Language (XAML) layouts are also trees. While developers are subconsciously aware of this data structure, it’s not nearly as present in the foreground as it is with Flutter. If you do not live and breathe trees, at some point, you will get lost among the leaves.

This is ...

Get Flutter Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.