fix(ui): remove check for launchUrl
This commit is contained in:
@@ -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)),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user