isValidUrl property

bool get isValidUrl

Valid URL (http/https). Intentionally simple — use Uri.tryParse for structural checks; this validates the common displayed format.

Implementation

bool get isValidUrl {
  return RegExp(
    r'^https?://[a-zA-Z0-9\-._~:/?#\[\]@!$&'
    "'()*+,;=%]+\$",
  ).hasMatch(trim());
}