State is information that can be read synchronously when a widget
is built and might change during the lifetime of the widget.
It’s the responsibility of the widget implementer to ensure that
the state object is promptly notified when the state changes.
Use StatefulWidget when a widget can change dynamically.
For example, the state of the widget changes by typing into a form,
or moving a slider.
Or, it can change over time—perhaps a data feed updates the UI.

Checkbox,

Radio,

Slider,

InkWell,

Form, and

TextField
are examples of stateful widgets that subclass

StatefulWidget.

The following example declares a StatefulWidget
that requires a createState() method.
This method creates the state object that manages the widget’s state,
_MyStatefulWidgetState.