Bug fixes

This commit is contained in:
Juan Gilsanz Polo 2025-01-22 14:40:39 +01:00
parent 51b8a6b610
commit a666d109d9
8 changed files with 54 additions and 20 deletions

View file

@ -5,6 +5,15 @@ import 'package:url_launcher/url_launcher.dart' as url_launcher;
import 'package:sentry_flutter/sentry_flutter.dart';
void openUrl(String url) async {
if (!(url.startsWith("http") || url.startsWith("https"))) {
try {
url_launcher.launchUrl(Uri.parse(url));
} catch (e, stackTrace) {
Sentry.captureException(e, stackTrace: stackTrace);
}
return;
}
if (Platform.isAndroid || Platform.isIOS) {
try {
await flutter_custom_tabs.launchUrl(
@ -20,6 +29,7 @@ void openUrl(String url) async {
),
);
} catch (e, stackTrace) {
url_launcher.launchUrl(Uri.parse(url));
Sentry.captureException(e, stackTrace: stackTrace);
}
}