createState()— a method in a
StatefulWidgetthat’s called immediately and should return a
Stateobject for the widget
initState()— the first method called in the
Stateobject after the widget is created
didChangeDependencies()— called immediately after
initState()the first time the widget is built
build()— very similar to the one from the
StatelessWidget. It’s called right after
didChangeDependencies(). It’s called every single time the UI needs to render and returns a widget’s tree.
didUpdateWidget()— it’s called when the parent widget changes and needs to redraw its UI
deactivate()— called before
dispose(), when this object is removed from the tree
dispose()— called when deallocating the whole widget and its state
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.