isURL static method

bool isURL(
  1. String value
)

Returns true for a valid URL.

Implementation

static bool isURL(String value) {
  final Uri? uri = Uri.tryParse(value.trim());
  if (uri == null) return false;
  return (uri.scheme == 'http' || uri.scheme == 'https') &&
      uri.host.isNotEmpty;
}