isAbsoluteUrl function
Is absolute URL / is relative path. Roadmap #174.
Implementation
bool isAbsoluteUrl(String url) {
final String trimmed = url.trim();
if (trimmed.isEmpty) return false;
final int colonIndex = trimmed.indexOf(':');
if (colonIndex <= 0) return false;
final String scheme = trimmed.replaceRange(colonIndex, trimmed.length, '').toLowerCase();
return scheme == _kSchemeHttp ||
scheme == _kSchemeHttps ||
scheme == _kSchemeFile ||
scheme == _kSchemeFtp;
}