copyWith method

  1. @override
RichTextMention copyWith({
  1. RichText? text,
  2. String? username,
})
override

Returns a copy with the given fields replaced. For a nullable field pass a function, e.g. field: () => null to clear it.

Implementation

@override
RichTextMention copyWith({RichText? text, String? username}) =>
    RichTextMention(
      text: text ?? this.text,
      username: username ?? this.username,
    );