addParent method

ModularRoute addParent(
  1. ModularRoute parent
)

Implementation

ModularRoute addParent(ModularRoute parent) {
  final newName = '${parent.name}$name'.replaceFirst('//', '/');
  return copyWith(
    name: newName,
    parent: parent.name,
    middlewares: [
      ...parent.middlewares,
      ...middlewares,
    ],
    innerModules: {
      ...parent.innerModules,
      ...innerModules,
    },
  );
}