isNativeOauthDeepLinkReturnUri function
true if returnUri uses a scheme other than http / https (e.g. myapp://oauth).
Recommended on mobile so the API redirects to the app rather than a web page.
Uses _rawScheme to support underscores in schemes (e.g. rapide_ticket://).
Implementation
bool isNativeOauthDeepLinkReturnUri(String? returnUri) {
final u = returnUri?.trim();
if (u == null || u.isEmpty) return false;
final s = _rawScheme(u);
return s.isNotEmpty && s != 'http' && s != 'https';
}