From 20358c8a34b946e6c44c7e5d77f9921cf798591a Mon Sep 17 00:00:00 2001 From: lemoer Date: Mon, 7 Jul 2025 21:52:24 +0200 Subject: [PATCH] exception if launchUrl fails --- lib/main.dart | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/lib/main.dart b/lib/main.dart index a8619b2..1fedff1 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -60,7 +60,7 @@ class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( - title: 'Flutter Demo', + title: 'LeineLab e.V. Key App', theme: ThemeData( colorScheme: ColorScheme.fromSeed(seedColor: Colors.yellow), ), @@ -564,7 +564,12 @@ class AuthentikUserSettingsChangeDialogState extends ChangeNotifier { server = await HttpServer.bind("127.0.0.1", 30165); - await launchUrl(authorizationUrl, mode: LaunchMode.externalApplication); + if (!await launchUrl( + authorizationUrl, + mode: LaunchMode.externalApplication, + )) { + throw Exception("Could not launch the authorization URL."); + } if (server == null) { // exit() might have been called before we arrived here.