exception if launchUrl fails

This commit is contained in:
lemoer 2025-07-07 21:52:24 +02:00
parent 171831994a
commit 20358c8a34

View File

@ -60,7 +60,7 @@ class MyApp extends StatelessWidget {
@override @override
Widget build(BuildContext context) { Widget build(BuildContext context) {
return MaterialApp( return MaterialApp(
title: 'Flutter Demo', title: 'LeineLab e.V. Key App',
theme: ThemeData( theme: ThemeData(
colorScheme: ColorScheme.fromSeed(seedColor: Colors.yellow), colorScheme: ColorScheme.fromSeed(seedColor: Colors.yellow),
), ),
@ -564,7 +564,12 @@ class AuthentikUserSettingsChangeDialogState extends ChangeNotifier {
server = await HttpServer.bind("127.0.0.1", 30165); 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) { if (server == null) {
// exit() might have been called before we arrived here. // exit() might have been called before we arrived here.