Route<T> constructor

Route<T>(
  1. String path,
  2. {@required String method,
  3. @required List<T> handlers}
)

Implementation

Route(this.path, {@required this.method, @required this.handlers})
    : _routeDefinition = RouteGrammar.routeDefinition
          .parse(SpanScanner(path.replaceAll(_straySlashes, '')))
          .value {
  if (_routeDefinition?.segments?.isNotEmpty != true) {
    _parser = match('').map((r) => RouteResult({}));
  }
}