getParent method
Implementation
Option? getParent(Option root) {
if (root is OptionGroup) {
for (Option i in root.options) {
if (i.id == id) {
return root;
}
if (i is OptionGroup) {
Option? r = getParent(i);
if (r != null) {
return i;
}
}
}
}
return null;
}