If you want to dynamically change the UI based on data received
after making an HTTP call or a user interaction,
then you have to work with StatefulWidget
and tell the Flutter framework that
the widget’s State has been updated,
so it can update that widget.

The important thing to note here is at the core
both stateless and stateful widgets behave the same.
They rebuild every frame, the difference is
the StatefulWidget has a State object
that stores state data across frames and restores it.

If you are in doubt, then always remember this rule: if a widget changes
(because of user interactions, for example) it’s stateful.
However, if a widget reacts to change, the containing parent widget can
still be stateless if it doesn’t itself react to change.

The following example shows how to use a StatelessWidget.
A common StatelessWidget is the Text widget.
If you look at the implementation of the Text widget
you’ll find it subclasses StatelessWidget.