isUrl method
Checks if the string is a valid URL.
Implementation
bool isUrl() {
final urlRegex =
RegExp(r'^(https?:\/\/)?([\w\-]+(\.[\w\-]+)+)([\/\w\.\-]*)*\/?$');
return urlRegex.hasMatch(this);
}
Checks if the string is a valid URL.
bool isUrl() {
final urlRegex =
RegExp(r'^(https?:\/\/)?([\w\-]+(\.[\w\-]+)+)([\/\w\.\-]*)*\/?$');
return urlRegex.hasMatch(this);
}