Skip to content

Commit 37fd2c7

Browse files
Copilotdaohoangson
andcommitted
Fix data-src attribute fallback logic for empty values
Co-authored-by: daohoangson <[email protected]>
1 parent 181123c commit 37fd2c7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

packages/fwfh_webview/lib/src/web_view_factory.dart

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,11 @@ mixin WebViewFactory on WidgetFactory {
132132
}
133133

134134
final a = meta.element.attributes;
135-
final src = urlFull(a[kAttributeIframeDataSrc] ?? a[kAttributeIframeSrc] ?? '');
135+
final dataSrc = a[kAttributeIframeDataSrc];
136+
final srcAttr = a[kAttributeIframeSrc];
137+
final src = urlFull(
138+
(dataSrc?.isNotEmpty == true) ? dataSrc! : (srcAttr ?? '')
139+
);
136140
if (src == null) {
137141
return widgets;
138142
}

0 commit comments

Comments
 (0)