Segment<T>.regExpParam constructor Null safety

  1. {required RegExpParamParser parser,
  2. RouteBuilder<T>? create,
  3. List<Segment<T>> children,
  4. RouteBuilder<T>? createError}

Creates a Segment that matches a path segment against a regular expression and adds it to the ParseContext.

  /// Matches any path segment consisting of letters
      parser: RegExpParamParser.forward(
        key: 'name',
        regExp: RegExp(r'\w+'),
      create: (context) => context['name'] as String,

See also:


factory Segment.regExpParam({
  required RegExpParamParser parser,
  RouteBuilder<T>? create,
  List<Segment<T>> children,
  RouteBuilder<T>? createError,
}) = RegExpParamSegment<T>;