by coincidence, I looked at the Scaffold
widget implementation source code, then I noticied that it's a StateFulWidget
why it's a StatefullWidget
?
what parts or things need it to be StatefullWidget
?
CodePudding user response:
Scaffold
widget has a feature called drawer
, which has a state for itself, so when you need to open it, Scaffold
changes its state and open it. Other feature like showing snackBars
, BottomSheet
and FloatingActionButton
do the same.