dependOnInheritedElement abstract method

InheritedComponent dependOnInheritedElement(
  1. InheritedElement ancestor, {
  2. Object? aspect,
})

Registers this build context with ancestor such that when ancestor's component changes this build context is rebuilt.

Returns ancestor.component.

This method is rarely called directly. Most applications should use dependOnInheritedComponentOfExactType, which calls this method after finding the appropriate InheritedElement ancestor.

All of the qualifications about when dependOnInheritedComponentOfExactType can be called apply to this method as well.

Implementation

InheritedComponent dependOnInheritedElement(InheritedElement ancestor, {Object? aspect});