Skip to content

Commit

Permalink
Set launchUrl to open browser
Browse files Browse the repository at this point in the history
  • Loading branch information
vyPal committed Sep 8, 2023
1 parent f478fe4 commit db948b8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion lib/home.dart
Original file line number Diff line number Diff line change
Expand Up @@ -511,7 +511,8 @@ class HomePageState extends State<HomePage> {
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';
}
Expand Down
3 changes: 2 additions & 1 deletion lib/message.dart
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,8 @@ class MessagePageState extends State<MessagePage> {
}

Future<void> _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}');
}
}

0 comments on commit db948b8

Please sign in to comment.