Monday, April 4, 2022

What is StatefulBuilder Widget in Flutter?

 In this article we will discuss about the StatefulBuilder widget. A platonic widget that both has state and calls a closure to obtain its child widget.

The StateSetter function passed to the builder is used to invoke a rebuild instead of a typical State's State.setState.

Since the builder is re-invoked when the StateSetter is called, any variables that represent the state should be kept outside the builder function.

For more explanation, please see the video below:



0 comments:

Post a Comment