Widgets are often composed of many small, single-purpose widgets that are nested to produce powerful effects. For example, the Container widget consists of several widgets responsible for layout, painting, positioning, and sizing. Specifically, the
Container widget includes the
Transform widgets. Rather than subclassing
Container to produce a customized effect, you can compose these and other simple widgets in new and unique ways.
Center widget is another example of how you can control the layout. To center a widget, wrap it in a
Center widget and then use layout widgets for alignment, row, columns, and grids. These layout widgets do not have a visual representation of their own. Instead, their sole purpose is to control some aspect of another widget’s layout. To understand why a widget renders in a certain way, it’s often helpful to inspect the neighboring widgets.
For more information, see the Flutter Technical Overview.