I am calling initial method to load data from API using initState. But it is resulting me an error. Here is error:
Unhandled Exception: inheritFromWidgetOfExactT
The best solution i think is use the context from the Widget build. And paste the method _getCategories(context) after the build with the context from the tree. So there is no problem with the widget tree.