Route constructor
Route({
- required String path,
- String? name,
- String? title,
- RouterComponentBuilder? builder,
- RouterRedirect? redirect,
- 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);
}