RoutePath.fromRoutes constructor

RoutePath.fromRoutes(
  1. Iterable<RouteDefinition> routes
)

Implementation

RoutePath.fromRoutes(Iterable<RouteDefinition> routes)
    : path = routes.isNotEmpty ? Url.trimSlashes(routes.last.path) : '',
      useAsDefault = routes.isNotEmpty ? routes.last.useAsDefault : false,
      additionalData = routes.isNotEmpty ? routes.last.additionalData : null,
      parent = routes.length > 1
          ? RoutePath.fromRoutes(routes.take(routes.length - 1))
          : null;