What is a widget?
Widgets are the central class hierarchy in the Flutter framework. A widget is an immutable description of part of a user interface. Widgets can be inflated into elements, which manage the underlying render tree.
Widgets themselves have no mutable state (all their fields must be final).
In flutter has many pre-build widgets. So the app designing process is very fast, and we also can customize pre-built widgets or make our widgets.
Example:
BUTTONS
TEXT
IMAGE
SLIDER
Padding
Margin
Center
Rows
Columns
THERE ARE 2 TYPES OF WIDGETS IN THE FLUTTER
- Stateless Widget
- Stateful Widget
Stateless Widget
- If a widget doesn't do anything its a Stateless Widget.
- Static in nature
- Don't store any real-time data
Example:
Text Widget
Icon Widget
Stateful Widget
- If a widget does anything then it is Stateful Widget.
- Dynamic in nature
Example:
CheckBox
Radio
Slider
Video Link: