Route constructor

Route({
  1. required String path,
  2. String? name,
  3. String? title,
  4. RouterComponentBuilder? builder,
  5. RouterRedirect? redirect,
  6. List<RouteBase> routes = const <RouteBase>[],
})

Implementation

Route({
  required this.path,
  this.name,
  this.title,
  this.builder,
  this.redirect,
  super.routes = const <RouteBase>[],
})  : assert(path.isNotEmpty, 'Route path cannot be empty'),
      assert(name == null || name.isNotEmpty, 'Route name cannot be empty'),
      assert(builder != null || redirect != null, 'builder or redirect must be provided'),
      super._() {
  // cache the path regexp and parameters
  _pathRE = patternToRegExp(path, pathParams);
}