The core choice
Use StatelessWidget for UI that does not manage changing data. Use StatefulWidget when the widget must remember something that can change while the app runs.
Your widget’s build() method describes the UI. In a stateful widget, the State class holds the changing values and calls setState() when they change.
Think in widgets
In Flutter, almost everything on screen is a widget. Text, buttons, rows, columns, padding, and alignment are all widgets.
You build larger screens by composing smaller widgets. Some widgets take one child. Others take many children.