extractScheme static method

String? extractScheme(
  1. String url
)

Extracts the scheme from a URL.

Implementation

static String? extractScheme(String url) {
  try {
    final uri = Uri.parse(url);
    return uri.scheme.isEmpty ? null : uri.scheme;
  } catch (e) {
    return null;
  }
}