Skip to content

Link click does not work  #58

Closed
Closed
@ashub7

Description

First of all Thanks for such a great package.

I m using EasyRichText in Chat screen similar to Whats app . In which i need handle link, phone, email , bold, italic and strikeThrough formatting. I m using the code below ->

EasyRichText(
key: Key(messageId),
text,
defaultStyle: style,
maxLines: maxLines,
overflow: maxLines == null ? TextOverflow.clip : TextOverflow.ellipsis,
patternList: [
EasyRichTextPattern(
targetString: EasyRegexPattern.emailPattern,
urlType: 'email',
style: linkStyle,
),
EasyRichTextPattern(
targetString: EasyRegexPattern.telPattern,
urlType: 'tel',
style: linkStyle,
),
EasyRichTextPattern(
targetString: '(\)(.?)(\)',
matchBuilder: (BuildContext context, RegExpMatch? match) {
// print(match[0]);
return TextSpan(
text: match?[0]?.replaceAll('
', ''),
style: style.copyWith(fontWeight: FontWeight.bold),
);
},
),
EasyRichTextPattern(
targetString: '(_)(.?)(_)',
matchBuilder: (BuildContext context, RegExpMatch? match) {
// print(match[0]);
return TextSpan(
text: match?[0]?.replaceAll('_', ''),
style: style.copyWith(fontStyle: FontStyle.italic),
);
},
),
EasyRichTextPattern(
targetString: '(~)(.
?)(~)',
matchBuilder: (BuildContext context, RegExpMatch? match) {
return TextSpan(
text: match?[0]?.replaceAll('~', ''),
style: style.copyWith(
decoration: TextDecoration.lineThrough,
decorationColor: style.color),
);
},
),
EasyRichTextPattern(
targetString: EasyRegexPattern.webPattern,
urlType: 'web',
style: linkStyle,
),
],
);

With this code the links are properly formatted with color and underlined .. But they r not clickable i.e the url does not open the browser.
Also sometimes Email click also does not work .. its does work some time ..
Is this a bug, limitation or something wrong with my implementation .

Also there maybe some issue with email and web regex .. it opens browser for andew.the@gmail.com and mail client for oracle@gmail.com .

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions