mirror of
				https://gitlab.com/comunic/comunicmobile
				synced 2025-11-03 19:54:12 +00:00 
			
		
		
		
	Add references support
This commit is contained in:
		@@ -43,7 +43,8 @@ class TextWidget extends StatelessWidget {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  /// Sub parse function
 | 
					  /// Sub parse function
 | 
				
			||||||
  List<InlineSpan> _parseLinks(BuildContext context, String text, TextStyle style) {
 | 
					  List<InlineSpan> _parseLinks(
 | 
				
			||||||
 | 
					      BuildContext context, String text, TextStyle style) {
 | 
				
			||||||
    var buff = StringBuffer();
 | 
					    var buff = StringBuffer();
 | 
				
			||||||
    final list = new List<InlineSpan>();
 | 
					    final list = new List<InlineSpan>();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@@ -79,8 +80,8 @@ class TextWidget extends StatelessWidget {
 | 
				
			|||||||
        buff.write(" ");
 | 
					        buff.write(" ");
 | 
				
			||||||
      }
 | 
					      }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
      // Check if it is a user reference
 | 
					      // Check if it is a directory reference
 | 
				
			||||||
      else if(validateUserReference(word)) {
 | 
					      else if (validateDirectoryReference(word)) {
 | 
				
			||||||
        changeWordType();
 | 
					        changeWordType();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        list.add(
 | 
					        list.add(
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -28,6 +28,6 @@ bool validateUrl(String url) {
 | 
				
			|||||||
  }
 | 
					  }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/// Validate user reference
 | 
					/// Validate directory reference
 | 
				
			||||||
bool validateUserReference(String ref) =>
 | 
					bool validateDirectoryReference(String ref) =>
 | 
				
			||||||
    RegExp(r'@[a-zA-Z0-9]+').hasMatch(ref);
 | 
					    RegExp(r'@[a-zA-Z0-9]+').hasMatch(ref);
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user