Skip to content

Commit dea464b

Browse files
authored
Merge pull request Sub6Resources#500 from vrtdev/bugfix/475-iframe-customrender-attributes
Fix iframe customRender not receiving attributes
2 parents 6704b8e + 783178c commit dea464b

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

lib/src/replaced_element.dart

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -140,16 +140,15 @@ class ImageContentElement extends ReplacedElement {
140140
}
141141
});
142142
image.image.resolve(ImageConfiguration()).addListener(
143-
ImageStreamListener(
144-
(ImageInfo image, bool synchronousCall) {
145-
var myImage = image.image;
146-
Size size = Size(myImage.width.toDouble(), myImage.height.toDouble());
147-
completer.complete(size);
148-
}, onError: (object, stacktrace) {
149-
completer.completeError(object);
150-
}
151-
),
152-
);
143+
ImageStreamListener((ImageInfo image, bool synchronousCall) {
144+
var myImage = image.image;
145+
Size size =
146+
Size(myImage.width.toDouble(), myImage.height.toDouble());
147+
completer.complete(size);
148+
}, onError: (object, stacktrace) {
149+
completer.completeError(object);
150+
}),
151+
);
153152
imageWidget = FutureBuilder<Size>(
154153
future: completer.future,
155154
builder: (BuildContext buildContext, AsyncSnapshot<Size> snapshot) {
@@ -159,7 +158,8 @@ class ImageContentElement extends ReplacedElement {
159158
width: snapshot.data.width,
160159
frameBuilder: (ctx, child, frame, _) {
161160
if (frame == null) {
162-
return Text(alt ?? "", style: context.style.generateTextStyle());
161+
return Text(alt ?? "",
162+
style: context.style.generateTextStyle());
163163
}
164164
return child;
165165
},
@@ -422,12 +422,12 @@ ReplacedElement parseReplacedElement(
422422
);
423423
case "iframe":
424424
return IframeContentElement(
425-
name: "iframe",
426-
src: element.attributes['src'],
427-
width: double.tryParse(element.attributes['width'] ?? ""),
428-
height: double.tryParse(element.attributes['height'] ?? ""),
429-
navigationDelegate: navigationDelegateForIframe,
430-
);
425+
name: "iframe",
426+
src: element.attributes['src'],
427+
width: double.tryParse(element.attributes['width'] ?? ""),
428+
height: double.tryParse(element.attributes['height'] ?? ""),
429+
navigationDelegate: navigationDelegateForIframe,
430+
node: element);
431431
case "img":
432432
return ImageContentElement(
433433
name: "img",

0 commit comments

Comments
 (0)