Is it possible to combine the two widgets? Now I'm studying flutter and if I want to keep my AppBar fixed or something else. Can I have both widgets? If it's possible, should I use the build widget on both?
I haven't tried it yet because I don't understand when I should use the build() function. But I saw that Stateless is when there are no changes in the state of the screen and Stateful when there are changes.
You can combine both of Stateful and Stateless widget. This is better to control
build()costs. This is a example: You have a screen with a list of items and quantity for each item. At the trailing of item, you have a button add more to increase quantity of item by one. This is solution for this:Stateless widget (screen shows list of items)
Stateful widget (item hold state itself)
When you click
add morebutton, onlyHaveStateitem will be rebuit, not entire NoState widget. It takes you more controls yourbuild()method.