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 0456cb8 commit e4a6fa4Copy full SHA for e4a6fa4
lib/ui/link_preview.dart
@@ -31,10 +31,15 @@ class LinkMetadata {
31
final document = parse(utf8.decode(response.bodyBytes));
32
33
// Extract metadata from meta tags
34
- final title = document
+ String title = document
35
.querySelector('meta[property="og:title"]')
36
?.attributes['content'] ??
37
- document.querySelector('title')?.text;
+ document.querySelector('title')?.text ?? '';
38
+
39
+ if(title.isEmpty){
40
+ //if no title is set fallback to url
41
+ title = url;
42
+ }
43
44
final description = document
45
.querySelector('meta[property="og:description"]')
0 commit comments