initState() is a method of class State and it is considered as an important lifecycle method in Flutter. initState() is called only Once and we use it for one time initializations. Example : To initialize data that depends on the specific BuildContext . To initialize data that needs to executed before build() .
What is void initState in Flutter?
void initState() @mustCallSuper, @protected. Called when this object is inserted into the tree . The framework will call this method exactly once for each State object it creates.