Use context.getElementForInheritedWidgetOfExactType<_BlocProviderInherited<T>>().widget
and it should work.
As far as benefits go, the documentation basically states the same though someone can correct me but I don’t see any difference. You should be able to get rid of the _typeOf
variable.