adguard-home-manager/lib/functions/open_url.dart

21 lines
688 B
Dart
Raw Normal View History

2024-01-29 02:37:45 +01:00
import 'package:flutter_custom_tabs/flutter_custom_tabs.dart';
import 'package:sentry_flutter/sentry_flutter.dart';
2023-04-06 22:56:32 +02:00
2023-05-03 16:30:20 +02:00
void openUrl(String url) async {
2024-01-29 02:37:45 +01:00
try {
await launchUrl(
Uri.parse(url),
2023-05-03 16:30:20 +02:00
customTabsOptions: const CustomTabsOptions(
2024-01-29 02:37:45 +01:00
shareState: CustomTabsShareState.browserDefault,
urlBarHidingEnabled: true,
2023-05-03 16:30:20 +02:00
showTitle: true,
2024-01-29 02:37:45 +01:00
),
2023-05-03 16:30:20 +02:00
safariVCOptions: const SafariViewControllerOptions(
barCollapsingEnabled: true,
2024-01-29 02:37:45 +01:00
dismissButtonStyle: SafariViewControllerDismissButtonStyle.close,
),
2023-05-03 16:30:20 +02:00
);
2024-01-29 02:37:45 +01:00
} catch (e, stackTrace) {
Sentry.captureException(e, stackTrace: stackTrace);
2023-05-03 16:30:20 +02:00
}
}