getElementForInheritedComponentOfExactType<T extends InheritedComponent> method
InheritedElement?
getElementForInheritedComponentOfExactType<T extends InheritedComponent>()
override
Obtains the element corresponding to the nearest component of the given type T
,
which must be the type of a concrete InheritedComponent subclass.
Returns null if no such element is found.
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 dependOnInheritedComponentOfExactType does.
Implementation
@override
InheritedElement? getElementForInheritedComponentOfExactType<T extends InheritedComponent>() {
final InheritedElement? ancestor = _inheritedElements == null ? null : _inheritedElements![T];
return ancestor;
}