isUrl static method

bool isUrl(
  1. String? value
)

URL validation supporting http, https, and protocol-relative URLs

Example:

FSValidators.isUrl('https://example.com'); // true
FSValidators.isUrl('example.com'); // true (protocol-relative)

Implementation

static bool isUrl(String? value) {
  final cleanValue = value?.trim();
  if (cleanValue == null || cleanValue.isEmpty) return false;
  return _urlRegex.hasMatch(cleanValue);
}