From db948b8302764d673d849c51dc7a18d31994e4ad Mon Sep 17 00:00:00 2001 From: vyPal Date: Fri, 8 Sep 2023 11:43:42 +0200 Subject: [PATCH] Set launchUrl to open browser --- lib/home.dart | 3 ++- lib/message.dart | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/home.dart b/lib/home.dart index e47a3ba..bd465f9 100644 --- a/lib/home.dart +++ b/lib/home.dart @@ -511,7 +511,8 @@ class HomePageState extends State { final url = Uri.parse( 'https://github.com/DislikesSchool/EduPage2/releases/latest'); if (await canLaunchUrl(url)) { - await launchUrl(url); + await launchUrl(url, + mode: LaunchMode.externalApplication); } else { throw 'Could not launch $url'; } diff --git a/lib/message.dart b/lib/message.dart index 7f28071..7d430f2 100644 --- a/lib/message.dart +++ b/lib/message.dart @@ -214,7 +214,8 @@ class MessagePageState extends State { } Future _onOpen(LinkableElement link) async { - if (!await launchUrl(Uri.parse(link.url))) { + if (!await launchUrl(Uri.parse(link.url), + mode: LaunchMode.externalApplication)) { throw Exception('Could not launch ${link.url}'); } }