handleChild method

void handleChild(
  1. GetPage route
)

Implementation

void handleChild(GetPage route) {
  final children = route.children;
  for (var child in children) {
    final middlewares = List.of(route.middlewares);
    final bindings = List.of(route.bindings);
    middlewares.addAll(child.middlewares);
    bindings.addAll(child.bindings);
    child = child.copyWith(middlewares: middlewares, bindings: bindings);
    if (child.inheritParentPath) {
      child = child.copyWith(
          name: ('${route.path}/${child.path}').replaceAll(r'//', '/'));
    }
    addRoute(child);
  }
}