3. 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.
Read moreIs context available in initState?
The initstate() is called before the state loads its dependencies. And for that reason no context is available .
Read more