ancestorInheritedElementForWidgetOfExactType is deprecated

Posted by Prem Tiwari | Updated on

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.


If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.

Related Questions & Answers