super. initState() should always be the first line in your initState method . From docs: initState(): If you override this, make sure your method starts with a call to super.
Read moreWhat is super initState in Flutter?
Credit to @Remi, initState() is a method which is called once when the stateful widget is inserted in the widget tree . We generally override this method if we need to do some sort of initialisation work like registering a listener because, unlike build() , this method is called once.12 Eyl 2018
Read moreWhat does initState () do in Flutter?
InitState() is used to subscribe to the object . Overriding of initState() method performs initialization which depends on the location at which this object was inserted into the tree (like context) or on the widget used to configure this object (or widget).
Read more