findAncestorComponentOfType<T extends Component> method
Implementation
@override
T? findAncestorComponentOfType<T extends Component>() {
var ancestor = _parent;
while (ancestor != null && ancestor.component.runtimeType != T) {
ancestor = ancestor._parent;
}
return ancestor?.component as T?;
}