findAncestorBindingOfType<T extends Binding> method

  1. @override
T? findAncestorBindingOfType<T extends Binding>()
override

Implementation

@override
T? findAncestorBindingOfType<T extends Binding>() {
  var ancestor = _parent;
  while (ancestor != null && ancestor.runtimeType != T) {
    ancestor = ancestor._parent;
  }
  return ancestor as T?;
}