getAttributedText method

  1. @override
List<AttributedText> getAttributedText(
  1. String text,
  2. CometChatTheme theme,
  3. BubbleAlignment? alignment, {
  4. List<AttributedText>? existingAttributes,
  5. dynamic onTap(
    1. String
    )?,
  6. bool forConversation = false,
})
override

getAttributedText is a function which is used to get the attributed text which is used to style the text in the message bubble and conversation subtitle

Implementation

@override
List<AttributedText> getAttributedText(
    String text, CometChatTheme theme, BubbleAlignment? alignment,
    {List<AttributedText>? existingAttributes,
    Function(String)? onTap,
    bool forConversation = false}) {
  return super.getAttributedText(text, theme, alignment,
      existingAttributes: existingAttributes,
      onTap: onTap ??
          (text) async {
            if (pattern != null && pattern!.hasMatch(text)) {
              await launchUrl(Uri.parse(('mailto:$text')));
            }
          },
      forConversation: forConversation);
}