The following example uses MaterialApp,
which holds its root page in the home property.

From here, your actual first page is another Widget,
in which you create your state.

A Stateful widget, such as MyHomePage below, consists of two parts.
The first part, which is itself immutable, creates a State object
that holds the state of the object. The State object persists over
the life of the widget.

The State object implements the build() method for the stateful widget.

When the state of the widget tree changes, call setState(),
which triggers a build of that portion of the UI.
Make sure to call setState() only when necessary,
and only on the part of the widget tree that has changed,
or it can result in poor UI performance.

In Flutter, the UI (also known as widget tree), is immutable,
meaning you can’t change its state once it’s built.
You change fields in your State class, then call setState()
to rebuild the entire widget tree again.