isHttp static method

bool isHttp(
  1. String url
)

Check if URL is HTTP

url - The URL to check Returns true if URL uses HTTP

Implementation

static bool isHttp(String url) {
  try {
    final uri = Uri.parse(url);
    return uri.scheme.toLowerCase() == 'http';
  } catch (e) {
    return false;
  }
}