Skip to content
masterclass Buddy

Flutter & Dart · Function

initState

initState runs once when Flutter inserts a State object into the widget tree. Override it for setup based on the widget or its location, and call super.initState() first.

Last updated

Syntax

void initState()

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

Subscribe
  • State.didChangeDependencies
  • State.didUpdateWidget
  • State.dispose
  • BuildContext.dependOnInheritedWidgetOfExactType

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