Is there a way to make context available in the initState function?

Hi all! I'm trying to implement the bloc architecture. I'm using a InheritedWidget (named Provider) that allows me to get any of the "blocs" (which are divided according to function). What seems weird to me is that I can't get the bloc in my initState, only in the Build function. Is there a way to make context available in the initState function?
To be more clear, I want to call a function just once (having context), instead of calling it multiple times (like when it's being called inside Build).
You already invited:

Liam

Upvotes from:

use ancestorWidgetOfExactTypeinstead of inheritFromWidgetOfExactType in your offunction of your InheritedWidget implementation.

If you wanna answer this question please Login or Register