Summary. setState is a way to dynamically change the UI . We call it inside the State Object class of the StatefulWidget. Calling setState marks the corresponding Widget dirty .
Read moreCan you call setState in initState flutter?
Because we can’t call setState() directly in the initState method , we can’t call it from a function called by initState either. Unless this function is asynchronous and the setState call is made after the first await.16 May 2021
Read more