createState(): When the Framework is instructed to build a StatefulWidget, it immediately calls createState()
mounted is true: When createState creates your state class, a buildContext is assigned to that state. buildContext is, overly simplified, the place in the widget tree in which this widget is placed. Here's a longer explanation. All widgets have a bool this.mounted property. It is turned true when the buildContext is assigned. It is an error to call setState when a widget is unmounted.
initState(): This is the first method called when the widget is created (after the class constructor, of course.) initState is called once and only once. It must call super.initState().
didChangeDependencies(): This method is called immediately after initState on the first time the widget is built.
build(): This method is called often. It is required, and it must return a Widget.
didUpdateWidget(Widget oldWidget): If the parent widget changes and has to rebuild this widget (because it needs to give it different data), but it's being rebuilt with the same runtimeType, then this method is called. This is because Flutter is re-using the state, which is long lived. In this case, you may want to initialize some data again, as you would in initState.
setState(): This method is called often from the framework itself and from the developer. Its used to notify the framework that data has changed
deactivate(): Deactivate is called when State is removed from the tree, but it might be reinserted before the current frame change is finished. This method exists basically because State objects can be moved from one point in a tree to another.
dispose(): dispose() is called when the State object is removed, which is permanent. This method is where you should unsubscribe and cancel all animations, streams, etc.
mounted is false: The state object can never remount, and error will be thrown if setState is called.
createState() : 框架被委托创建StatefulWidget时, 该方法被调用. 然后 mounted置为true
initState() : 当widget被创建时, 该方法被调用.
didChangeDependencies() : initState()后调用该方法; 当父级结构层级或者节点变化触发该方法, 仅仅属性值变化不触发.
setState() : 框架或者开发者调用此方法, 通知框架数据改变, 需要重新渲染界面.
deactivate() : 当State从组件树中移除时触发, 但有可能被重新插入组件树, 例如从树的一点移到另外的点.
dispose() : 当State被永久移除时触发, 在此回调中需要做资源释放处理. 然后 mounted置为false