In order to build more complex experiences—for example,
to react in more interesting ways to user input—applications
typically carry some state. Flutter uses StatefulWidgets to capture
this idea. StatefulWidgets are special widgets that know how to generate
State objects, which are then used to hold state.
Consider this basic example, using the ElevatedButton mentioned earlier:

You might wonder why StatefulWidget and State are separate objects.
In Flutter, these two types of objects have different life cycles.
Widgets are temporary objects, used to construct a presentation of
the application in its current state. State objects, on the other
hand, are persistent between calls to
build(), allowing them to remember information.