1
0
mirror of https://gitlab.com/comunic/comunicmobile synced 2024-11-22 04:49:21 +00:00

Add references support

This commit is contained in:
Pierre HUBERT 2020-04-16 12:06:57 +02:00
parent 2bb75da017
commit 45d3f93192
2 changed files with 6 additions and 5 deletions

View File

@ -43,7 +43,8 @@ class TextWidget extends StatelessWidget {
}
/// Sub parse function
List<InlineSpan> _parseLinks(BuildContext context, String text, TextStyle style) {
List<InlineSpan> _parseLinks(
BuildContext context, String text, TextStyle style) {
var buff = StringBuffer();
final list = new List<InlineSpan>();
@ -79,8 +80,8 @@ class TextWidget extends StatelessWidget {
buff.write(" ");
}
// Check if it is a user reference
else if(validateUserReference(word)) {
// Check if it is a directory reference
else if (validateDirectoryReference(word)) {
changeWordType();
list.add(

View File

@ -28,6 +28,6 @@ bool validateUrl(String url) {
}
}
/// Validate user reference
bool validateUserReference(String ref) =>
/// Validate directory reference
bool validateDirectoryReference(String ref) =>
RegExp(r'@[a-zA-Z0-9]+').hasMatch(ref);