Stateless & stateful widgets
In this lesson, stateless & stateful widgets are discussed in detail.
We'll cover the following...
Stateless widget
- A
Stateless
widget is immutable. Once it’s created, it can’t be changed. It doesn’t preserve its state. - Stateless widget is drawn only once, and it can not be redrawn at a later time.
- Stateless widget’s
build()
method is called only once.
Let’s use the Container
widget to understand creating a custom StatelessWidget
.
Container Widget: ...