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.
createState()State instance for your StatefulWidget.State object, not the widget.initState()State object, right after it’s mounted.AnimationController, TextEditingController)context here; use didChangeDependencies() for that.didChangeDependencies()initState() the first time.InheritedWidget / Provider-based dependencies).context.