Segment<T>.regExpParam constructor Null safety

Segment<T>.regExpParam(
  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
    Segment.regExpParam(
      parser: RegExpParamParser.forward(
        key: 'name',
        regExp: RegExp(r'\w+'),
      ),
      create: (context) => context['name'] as String,
    ),

See also:

Implementation

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