add method

dynamic add(
  1. List<String> path,
  2. String className, {
  3. int depth = 0,
})

Implementation

add(List<String> path, String className, {int depth = 0}) {
  if (path.length == depth) {
    this.className = className;
  } else {
    if (!subNodes.containsKey(path[depth])) {
      subNodes[path[depth]] = new RouteNode();
    }
    subNodes[path[depth]]!.add(path, className, depth:++depth);
  }
}