We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fd1190c commit 13e04adCopy full SHA for 13e04ad
1 file changed
lib/src/presentation/blocks/embed/embed_renderer.dart
@@ -11,8 +11,18 @@ class EmbedRenderer extends BlockRenderer<EmbedBlock> {
11
Widget build(BuildContext context) {
12
return InkWell(
13
onTap: block.source.isNotEmpty
14
- ? () => launchUrl(Uri.parse(block.source),
15
- mode: LaunchMode.externalApplication)
+ ? () async {
+ final uri = Uri.tryParse(block.source);
16
+ if (uri == null) return;
17
+ final scheme = uri.scheme.toLowerCase();
18
+ if (scheme != 'http' && scheme != 'https') return;
19
+ if (await canLaunchUrl(uri)) {
20
+ await launchUrl(
21
+ uri,
22
+ mode: LaunchMode.externalApplication,
23
+ );
24
+ }
25
26
: null,
27
borderRadius: BorderRadius.circular(8),
28
child: Container(
0 commit comments