removeChild method

String? removeChild(
  1. dynamic input
)

Remove a child from this node. input can be either an instance of Node or a String.

Implementation

String? removeChild(dynamic input) {
  if (input is String) {
    children.remove(getChild(input));
    return input;
  } else if (input is Node) {
    children.remove(input);
  } else {
    throw Exception('Invalid Input');
  }
  return null;
}