add method

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

Implementation

void 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]] = RouteNode();
    }
    subNodes[path[depth]]!.add(path, className, depth: ++depth);
  }
}