1) Why Flutter Has a Lifecycle for Stateful Widgets

In Flutter, widgets are lightweight configuration objects, while the State object is persistent across rebuilds. This separation is why State has a lifecycle: the framework can rebuild the UI many times while keeping your state (data, controllers, subscriptions) alive as needed.

A StatefulWidget creates a State object once (per insertion), and Flutter drives the State through key lifecycle callbacks as it mounts, rebuilds, updates, and unmounts.


2) The Core Lifecycle Phases (What Runs, When, and Why)

A) Creation

createState()


B) Initialization

initState()

didChangeDependencies()