copyWith method
Creates a new TextElement from this one by updating individual properties.
This method creates a new TextElement object with values for
the properties provided by similarly named arguments, or using
the existing value of the property if no argument, or null,
is provided.
Implementation
TextElement copyWith({
String? text,
List<String?>? groups,
Type? matcherType,
int? matcherIndex,
int? offset,
}) {
return TextElement(
text ?? this.text,
groups: groups ?? this.groups,
matcherType: matcherType ?? this.matcherType,
matcherIndex: matcherIndex ?? this.matcherIndex,
offset: offset ?? this.offset,
);
}