I am new to flutter and when I want to call my context in InitState it throws an error :
which is about
BuildContext.inheritFromWidgetOfExactType
but then I use did
The answer is here
This method should not be called from widget constructors or from State.initState methods, because those methods would not get called again if the inherited value were to change. To ensure that the widget correctly updates itself when the inherited value changes, only call this (directly or indirectly) from build methods, layout and paint callbacks, or from State.didChangeDependencies.