SpanDefinition constructor

const SpanDefinition({
  1. required TextMatcher matcher,
  2. required SpanBuilder builder,
})

A SpanDefinition that defines parsing rules and the widget to be displayed inside CustomText.

The builder function receives the entire matched string and a list of strings that have matched the fragments enclosed in parentheses within the match pattern. Use the function to return an object of InlineSpan or its subtype (e.g. WidgetSpan) to display it instead of the matched string.

Implementation

const SpanDefinition({
  required super.matcher,
  required SpanBuilder super.builder,
});