2000calories / flutter_easy_rich_text

The EasyRichText widget provides an easy way to use RichText.
https://pub.dev/packages/easy_rich_text
MIT License
80 stars 33 forks source link

Added matchBuilder option in EasyRichTextPattern #10

Closed DenchikBY closed 3 years ago

DenchikBY commented 3 years ago

Can be used for example in my specific case to replace pattern string ***[string]*** with highlighted string.

                  EasyRichTextPattern(
                    targetString: RegExp(r'\*{3}\[(.+?)\]\*{3}'),
                    matchBuilder: (BuildContext context, RegExpMatch match) {
                      return TextSpan(
                        text: match[1],
                        style: _questionTextHighlightMissesStyle,
                      );
                    },
                  ),