RouteDefinition constructor

RouteDefinition(
  1. String path,
  2. RouteWidgetBuilder widgetBuilder, {
  3. String? name,
  4. RouterPageBuilder pageBuilder = defaultPageBuilder,
  5. List<Middleware> middlewares()?,
})

Creates a RouteDefinition.

For a dialog, isDialog must be true to work properly.

Implementation

RouteDefinition(
  String path,
  this.widgetBuilder, {
  this.name,
  this.pageBuilder = defaultPageBuilder,
  List<Middleware> Function()? middlewares,
})  : _path = _addTrailingSlash(path),
      _middlewares = middlewares {
  _parametersNames = [];
  _pathRegex = pathToRegExp(
    _path,
    parameters: _parametersNames,
    caseSensitive: false,
  );
}