extractFirstUrl static method
Implementation
static String? extractFirstUrl(String message) {
final urlRegExp = RegExp(
r'((https?:\/\/)?([a-zA-Z0-9.-]+\.[a-zA-Z]{2,})(\/[^\s]*)?)',
caseSensitive: false,
multiLine: true,
);
final match = urlRegExp.firstMatch(message);
return match
?.group(0); // Returns the first match or null if no match is found
}