filter method
Filters all candidates, retuning only a subset that matches
Implementation
@override
Iterable<WidgetTreeNode> filter(Iterable<WidgetTreeNode> candidates) {
if (W == Widget) {
return candidates;
}
final type = _typeOf<W>();
return candidates
.where((WidgetTreeNode node) => node.element.widget.runtimeType == type)
.toList();
}