url<E> static method
Validates that the string is a valid URL.
StringRules.url(error: 'Invalid URL')
Implementation
static Rule<String, E> url<E>({required E error}) => PredicateRule(
predicate: (value) {
try {
final uri = Uri.parse(value);
return uri.hasScheme && uri.hasAuthority;
} catch (_) {
return false;
}
},
error: error,
);