find method
Searches for a node that matches predicate
in the sub-tree of this node.
Implementation
WidgetbookNode? find(
bool Function(WidgetbookNode node) predicate,
) {
if (predicate(this)) {
return this;
} else {
return children //
?.map((child) => child.find(predicate))
.firstWhere(
(child) => child != null,
orElse: () => null,
);
}
}