Skip to content

Commit 43d7eb6

Browse files
authored
fix: add error handling for launchUrl in About Us feedback link (#3382)
1 parent 2f3b19b commit 43d7eb6

1 file changed

Lines changed: 11 additions & 3 deletions

File tree

lib/view/about_us_screen.dart

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Widget buildContactList(List<Map<String, dynamic>> items) {
3636
if (await canLaunchUrl(uri)) {
3737
await launchUrl(uri);
3838
} else {
39-
debugPrint('Could not launch ${item['url']}');
39+
logger.e('Could not launch URL: ${item['url']}');
4040
}
4141
},
4242
);
@@ -135,7 +135,14 @@ class _AboutUsScreenState extends State<AboutUsScreen> {
135135
style: const TextStyle(fontSize: 15),
136136
),
137137
onTap: () async {
138-
await launchUrl(Uri.parse(appLocalizations.feedbackForm));
138+
final uri = Uri.parse(appLocalizations.feedbackForm);
139+
if (await canLaunchUrl(uri)) {
140+
await launchUrl(uri);
141+
} else {
142+
logger.e(
143+
'Could not launch feedback form URL: ${appLocalizations.feedbackForm}',
144+
);
145+
}
139146
},
140147
),
141148
const Divider(thickness: 0.5),
@@ -162,7 +169,8 @@ class _AboutUsScreenState extends State<AboutUsScreen> {
162169
);
163170
} else if (snapshot.hasError) {
164171
logger.e(
165-
"Error getting version information: ${snapshot.error.toString()}");
172+
"Error getting version information: ${snapshot.error.toString()}",
173+
);
166174
return Text(
167175
appLocalizations.error,
168176
style: const TextStyle(fontSize: 15),

0 commit comments

Comments
 (0)