Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix iframe customRender not receiving attributes #500

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions lib/src/replaced_element.dart
Original file line number Diff line number Diff line change
Expand Up @@ -138,16 +138,15 @@ class ImageContentElement extends ReplacedElement {
}
});
image.image.resolve(ImageConfiguration()).addListener(
ImageStreamListener(
(ImageInfo image, bool synchronousCall) {
var myImage = image.image;
Size size = Size(myImage.width.toDouble(), myImage.height.toDouble());
completer.complete(size);
}, onError: (object, stacktrace) {
completer.completeError(object);
}
),
);
ImageStreamListener((ImageInfo image, bool synchronousCall) {
var myImage = image.image;
Size size =
Size(myImage.width.toDouble(), myImage.height.toDouble());
completer.complete(size);
}, onError: (object, stacktrace) {
completer.completeError(object);
}),
);
imageWidget = FutureBuilder<Size>(
future: completer.future,
builder: (BuildContext buildContext, AsyncSnapshot<Size> snapshot) {
Expand All @@ -158,7 +157,8 @@ class ImageContentElement extends ReplacedElement {
height: snapshot.data.height,
frameBuilder: (ctx, child, frame, _) {
if (frame == null) {
return Text(alt ?? "", style: context.style.generateTextStyle());
return Text(alt ?? "",
style: context.style.generateTextStyle());
}
return child;
},
Expand Down Expand Up @@ -418,12 +418,12 @@ ReplacedElement parseReplacedElement(
);
case "iframe":
return IframeContentElement(
name: "iframe",
src: element.attributes['src'],
width: double.tryParse(element.attributes['width'] ?? ""),
height: double.tryParse(element.attributes['height'] ?? ""),
navigationDelegate: navigationDelegateForIframe,
);
name: "iframe",
src: element.attributes['src'],
width: double.tryParse(element.attributes['width'] ?? ""),
height: double.tryParse(element.attributes['height'] ?? ""),
navigationDelegate: navigationDelegateForIframe,
node: element);
case "img":
return ImageContentElement(
name: "img",
Expand Down