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