isHttpBasedUrl function

bool isHttpBasedUrl(
  1. String url
)

Implementation

bool isHttpBasedUrl(String url) {
  try {
    final uri = Uri.parse(url.trim());
    return uri.isScheme('HTTP') || uri.isScheme('HTTPS');
  } catch (_) {
    return false;
  }
}