Add try/catch block in case launch url throws a platform exception
OmarHatem committed
Feb 27, 2023 at 16:07 UTC
f470723ece0d0f3403834341dcd30394151c8cdb
2 files changed
+6
-2
lib/src/screens/settings/widgets/settings_link_provider_cell.dart
+3
-1
@@ -30,6 +30,8 @@ class SettingsLinkProviderCell extends StandardListRow {
30
color: Palette.blueCraiola));
31
32
static void _launchUrl(String url) async {
33
- await launch(url, forceSafariVC: false);
33
+ try {
34
+ await launch(url, forceSafariVC: false);
35
+ } catch (e) {}
36
}
37
}
lib/view_model/support_view_model.dart
+3
-1
@@ -18,7 +18,9 @@ abstract class SupportViewModelBase with Store {
18
RegularListItem(
19
title: S.current.faq,
20
handler: (BuildContext context) async {
21
- await launch(url);
21
+ try {
22
+ await launch(url);
23
+ } catch (e) {}
24
},
25
),
26
LinkListItem(