@@ -83,7 +83,7 @@ class UrlValidator extends BaseValidator<String> {
83
83
: null ;
84
84
}
85
85
86
- /// Check if the string [str ] is a URL.
86
+ /// Check if the string [value ] is a URL.
87
87
///
88
88
/// * [protocols] sets the list of allowed protocols
89
89
/// * [requireTld] sets if TLD is required
@@ -92,18 +92,18 @@ class UrlValidator extends BaseValidator<String> {
92
92
/// * [hostWhitelist] sets the list of allowed hosts
93
93
/// * [hostBlacklist] sets the list of disallowed hosts
94
94
bool isURL (
95
- String ? str , {
95
+ String ? value , {
96
96
List <String ?> protocols = const < String ? > ['http' , 'https' , 'ftp' ],
97
97
bool requireTld = true ,
98
98
bool requireProtocol = false ,
99
99
bool allowUnderscore = false ,
100
100
List <String > hostWhitelist = const < String > [],
101
101
List <String > hostBlacklist = const < String > [],
102
102
}) {
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:' )) {
107
107
return false ;
108
108
}
109
109
final int port;
@@ -118,7 +118,7 @@ class UrlValidator extends BaseValidator<String> {
118
118
final String hash;
119
119
120
120
// check protocol
121
- List <String > split = str .split ('://' );
121
+ List <String > split = value .split ('://' );
122
122
if (split.length > 1 ) {
123
123
protocol = shift (split).toLowerCase ();
124
124
if (! protocols.contains (protocol)) {
0 commit comments