@@ -83,7 +83,7 @@ class UrlValidator extends BaseValidator<String> {
8383 : null ;
8484 }
8585
86- /// Check if the string [str ] is a URL.
86+ /// Check if the string [value ] is a URL.
8787 ///
8888 /// * [protocols] sets the list of allowed protocols
8989 /// * [requireTld] sets if TLD is required
@@ -92,18 +92,18 @@ class UrlValidator extends BaseValidator<String> {
9292 /// * [hostWhitelist] sets the list of allowed hosts
9393 /// * [hostBlacklist] sets the list of disallowed hosts
9494 bool isURL (
95- String ? str , {
95+ String ? value , {
9696 List <String ?> protocols = const < String ? > ['http' , 'https' , 'ftp' ],
9797 bool requireTld = true ,
9898 bool requireProtocol = false ,
9999 bool allowUnderscore = false ,
100100 List <String > hostWhitelist = const < String > [],
101101 List <String > hostBlacklist = const < String > [],
102102 }) {
103- if (str == null ||
104- str .isEmpty ||
105- str .length > _maxUrlLength ||
106- str .startsWith ('mailto:' )) {
103+ if (value == null ||
104+ value .isEmpty ||
105+ value .length > _maxUrlLength ||
106+ value .startsWith ('mailto:' )) {
107107 return false ;
108108 }
109109 final int port;
@@ -118,7 +118,7 @@ class UrlValidator extends BaseValidator<String> {
118118 final String hash;
119119
120120 // check protocol
121- List <String > split = str .split ('://' );
121+ List <String > split = value .split ('://' );
122122 if (split.length > 1 ) {
123123 protocol = shift (split).toLowerCase ();
124124 if (! protocols.contains (protocol)) {
0 commit comments