Skip to content
masterclass Buddy

Flutter & Dart · Function

setState

setState tells Flutter that a State object's internal value changed. Flutter then schedules that State object to build again so its subtree can reflect the change.

Last updated

Syntax

@protected
void setState(VoidCallback fn)

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • State
  • StatefulWidget
  • Element.markNeedsBuild
  • mounted
  • dispose

Source: setState method - State class - widgets library - Dart API. Checked 2026-11-03.