isBasicallyValidURI static method

bool isBasicallyValidURI(
  1. String uri
)

Implementation

static bool isBasicallyValidURI(String uri) {
  if (uri.contains(' ')) {
    // Quick hack check for a common case
    return false;
  }
  RegExpMatch? m = _urlWithProtocolPattern.firstMatch(uri);
  if (m != null && m.start == 0) {
    return true;
  }

  // match at start only
  m = _urlWithoutProtocolPattern.firstMatch(uri);
  return m != null && m.start == 0;
}