Summary
In this chapter, we learned about the layout system in Flutter. We learned how to create complex and flexible layouts that are accessible to all users. The layout algorithm in Flutter is based on the “Constraints go down. Sizes go up. Parent sets the position” rule. This means that the parent widget passes constraints to its children, which then determine their size. The parent then positions the children based on their size. However, widgets are not aware of their own position. The final size and position of a widget depends on its parent. Despite these limitations, Flutter’s layout algorithm is very efficient and can be used to create responsive UIs that look great on any screen size.
We learned how to obtain information about the device’s screen size and orientation to adjust the UI based on these parameters. We also covered the use of widgets such as Stack
or Row
to control the position and size of other widgets. We learned that accessibility...