1. createState()
    • Must exist
    • Called immediately after Flutter is instructed to create a stateful widget
    • Can be called multiple times (ex. If you use the same widget in multiple places)
    • When this is called a BuildContext is assigned to the state
  2. This.mounted
    • A property on every widget
    • Only returns true once the BuildContext has been assigned
    • If you call setState before this is true you will get an error, however this means it is a great way to make sure there is a BuildContext before calling setState()
  3. initState()
    • Called only once
    • Must be called with super.initState()
    • Best time to
      • Initialize data that relies on a specific BuildContext
      • Initialize properties that rely on this specific widget’s parent
      • Subscribe to things that could change data (Streams, ChangeNotifiers, and I think async await stuff)
  4. didChangeDependencies()
    • Called right after initState() on the first time the widget is built
    • Called whenever an object that a widget depends on changes
    • Build method is always called after this
    • First chance to call BuildContext.inheritFromWidgetOfExactType
      • Would make a widget listen to changes from its parent
  5. Build()
    • Called often
    • Think of this like the Render method in React
    • Must return a widget
  6. didUpdateWidget(oldWidget)
    • Called if a widget needs to be rebuilt due to its parent widget changing and passing it new data
    • Rebuilt with the same runtimeType
    • Flutter is re-using the state
    • Some data is re-initialized
    • This is a replacement for initState() if the widget associated with a pre-existing state object is rebuilt
    • Flutter calls the build method after this, so don’t bother calling setState because that’s redundant
  7. setState()
    • Called often from Flutter itself as well as the developer
    • Tells Flutter that data has changed and it should rebuild a widget
    • Similar to setState() in React
    • NOT async
  8. Deactivate()
    • Rarely used
    • Called when state is removed from the tree, but can be reinserted before the current frame change is finished
    • Used for moving state object within the tree
  9. Dispose()
    • Called when the state object is removed, which is permanent
    • Mounted = false