Skip to main content

validateURL method

String? validateURL (String value)

Implementation

static String? validateURL(
String value,
) \{
if (value.isEmpty) \{
return 'Please verify URL first';
\}
final bool validURL = Uri.parse(value).isAbsolute;
if (!validURL) \{
return 'Enter a valid URL';
\}
return null;
\}