Lay out a widget

How do you lay out a single widget in Flutter? This section
shows you how to create and display a simple widget.
It also shows the entire code for a simple Hello World app.

In Flutter, it takes only a few steps to put text, an icon,
or an image on the screen.

1. Select a layout widget

Choose from a variety of layout widgets based
on how you want to align or constrain the visible widget,
as these characteristics are typically passed on to the
contained widget.

This example uses Center which centers its content
horizontally and vertically.

2. Create a visible widget

For example, create a Text widget:

Create an Image widget:

Create an Icon widget:

3. Add the visible widget to the layout widget

All layout widgets have either of the following: