part of '../../core_app.dart';

bool _shouldStayInWebView(Uri uri) {
  return <String>{
    'http',
    'https',
    'about',
    'data',
    'javascript',
    'file',
    'blob',
  }.contains(uri.scheme.toLowerCase());
}

Future<bool> _openExternalUri(Uri uri) async {
  try {
    return await launchUrl(uri, mode: LaunchMode.externalApplication);
  } on Object catch (error, stackTrace) {
    debugPrint('外部打开 URI 失败：$error\n$stackTrace');
    return false;
  }
}
