findById method

InspectorNode? findById(
  1. String targetId
)

Implementation

InspectorNode? findById(String targetId) {
  if (id == targetId) return this;
  for (final child in children) {
    final match = child.findById(targetId);
    if (match != null) return match;
  }
  return null;
}