Understanding that everything is a widget
Flutter relies heavily on component-driven development, in which UIs are built from the bottom up with basic components progressively being assembled into more complex components and, eventually, entire pages. In Flutter, these components are called widgets.
If you are new to Flutter, you may not be aware of its layered cake architecture. What this means is that Flutter is a series of independent libraries that each depend on the underlying layer.
Figure 4.1 – Flutter’s layered architecture (Source: https://docs.flutter.dev/resources/architectural-overview)
As you can see from Figure 4.1, the topmost libraries of the Framework layer are represented by Material and Cupertino widgets, which build upon a platform-agnostic set of widgets. An example of this in action would be ElevatedButton
for Material and CupertinoButton
for Cupertino, which compose widgets such as Row
, Align
, and Padding
to implement...