fix(ui): remove check for launchUrl

This commit is contained in:
Salvatore Giordano
2022-04-25 11:57:42 +02:00
parent 17ca07e575
commit 701559fcdd
2 changed files with 3 additions and 2 deletions
@@ -259,6 +259,7 @@ class FileAttachment extends AttachmentWidget {
splashRadius: 16,
onPressed: () {
final assetUrl = attachment.assetUrl;
print('assetUrl: $assetUrl');
if (assetUrl != null) launchURL(context, assetUrl);
},
);
@@ -8,9 +8,9 @@ import 'package:url_launcher/url_launcher.dart';
/// Launch URL
Future<void> launchURL(BuildContext context, String url) async {
if (await canLaunch(url)) {
try {
await launch(url);
} else {
} catch (e) {
ScaffoldMessenger.of(context).showSnackBar(
SnackBar(content: Text(context.translations.launchUrlError)),
);