isValidUrl static method
Validates if the given string is a valid URL.
Implementation
static bool isValidUrl(String url) {
final regex = RegExp(
r'^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?\$');
return regex.hasMatch(url);
}