isHttps static method

bool isHttps(
  1. String url
)

Check if URL is HTTPS

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

Implementation

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