From Chapter 3, An Introduction to Flutter, we have seen that widgets play an important role in Flutter application development. They are the pieces that form the UI; they are the code representation of what is visible to the user.
UIs are almost never static; they change frequently, as you know. Although immutable by definition, widgets are not meant to be final – after all, we are dealing with a UI, and a UI will certainly change during the life cycle of any application. That's why Flutter provides us with two types of widgets: stateless and stateful.
The big difference between these is in the way the widget is built. It's the developer's responsibility to choose which kind of widget to use in each situation when composing the UI, in order to make the most of the power in the widget rendering layer of Flutter.