findTreeWithId<T extends AbsNodeType> function
Implementation
TreeType<T>? findTreeWithId<T extends AbsNodeType>(
TreeType<T> tree, dynamic id) {
if (tree.data.id == id) {
return tree;
} else {
for (var innerTree in tree.children) {
TreeType<T>? recursionResult = findTreeWithId(innerTree, id);
if (recursionResult != null) return recursionResult;
}
}
return null;
}