This page explains in detail the main Flutter concepts: StatelessWidget vs StatefulWidget, MaterialApp, Scaffold, and setState(). For each topic, you'll find explanations of what they are, their sub-concepts or related components, and references for further reading.
StatelessWidget: A widget that describes part of the UI by building a constellation of other widgets that describe the UI more concretely. It does not maintain any mutable state. The widget's appearance only depends on the configuration information it is given.
A widget that has mutable state. This means the UI can change dynamically over time based on user interaction or asynchronous events.
MaterialApp is a convenience widget that wraps several widgets commonly required for a Material Design app.
The Scaffold widget provides a basic visual layout structure for a Material Design app.
It saves you from manually implementing the standard visual layout structure of apps, like app bars, drawers, snack bars, and floating buttons, with consistent Material Design look and feel.
setState() is a method used inside the State class of a StatefulWidget.
It notifies Flutter that the internal state of the widget has changed in a way that might impact the UI. Flutter then schedules a rebuild of the widget subtree.
void increment() {
setState(() {
count++;
});
}
setState() only from within the State class.setState() should be synchronous and quick.setState() triggers build() method to rerun and update the UI.Provider, Bloc, or ChangeNotifier offer alternatives.