Obtains the element corresponding to the nearest widget of the given type, which must be the type of a concrete InheritedWidget subclass.
Calling this method is O(1) with a small constant factor.
This method does not establish a relationship with the target in the way that inheritFromWidgetOfExactType does. It is normally used by such widgets to obtain their corresponding InheritedElement object so that they can call InheritedElement.dispatchDependenciesChanged to actually notify the widgets that did register such a relationship.
Source
InheritedElement ancestorInheritedElementForWidgetOfExactType(Type targetType);