isSecureContext static method

bool isSecureContext()

Check if running in secure context (HTTPS)

Implementation

static bool isSecureContext() {
  try {
    return web.window.isSecureContext;
  } catch (_) {
    return false;
  }
}