getChildAtLevel method
Returns the descendant of this node with searchLevel
, which can be itself if
searchLevel
= level
Will error out if searchLevel
is < level, which means that searchLevel
is
a parent of this.
Will also error out if there is no descendant at searchLevel
Implementation
DeepNavigationNode<T> getChildAtLevel(int searchLevel) {
final child = tryChildAtLevel(searchLevel);
if (child == null) {
throw ArgumentError('No child at $searchLevel');
}
return child;
}