The setState() method notifies the framework that the internal state of the current object is “dirty,” which means that it has been changed in a way that might impact the UI. After this notification, the framework will call the build() method to update and rebuild a widget.