UrlValidator constructor

UrlValidator({
  1. List<String> protocols = const <String>['http', 'https', 'ftp'],
  2. bool requireTld = true,
  3. bool requireProtocol = false,
  4. bool allowUnderscore = false,
  5. List<String> hostWhitelist = const <String>[],
  6. List<String> hostBlacklist = const <String>[],
  7. RegExp? regex,
  8. String? errorText,
  9. bool checkNullOrEmpty = true,
})

Constructor for the URL validator.

Implementation

UrlValidator({
  this.protocols = const <String>['http', 'https', 'ftp'],
  this.requireTld = true,
  this.requireProtocol = false,
  this.allowUnderscore = false,
  this.hostWhitelist = const <String>[],
  this.hostBlacklist = const <String>[],
  this.regex,

  /// {@macro base_validator_error_text}
  super.errorText,

  /// {@macro base_validator_null_check}
  super.checkNullOrEmpty,
}) : _ipValidator = IpValidator(regex: regex, errorText: errorText);