Skip to content

Commit a747e22

Browse files
authored
Improve ImageEmbedBuilderWeb (singerdmx#1125)
1 parent dbe57bd commit a747e22

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

example/lib/universal_ui/universal_ui.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,12 @@ class ImageEmbedBuilderWeb implements EmbedBuilder {
4444
return const SizedBox();
4545
}
4646
final size = MediaQuery.of(context).size;
47-
UniversalUI().platformViewRegistry.registerViewFactory(
48-
imageUrl, (viewId) => html.ImageElement()..src = imageUrl);
47+
UniversalUI().platformViewRegistry.registerViewFactory(imageUrl, (viewId) {
48+
return html.ImageElement()
49+
..src = imageUrl
50+
..style.height = 'auto'
51+
..style.width = 'auto';
52+
});
4953
return Padding(
5054
padding: EdgeInsets.only(
5155
right: ResponsiveWidget.isMediumScreen(context)

0 commit comments

Comments
 (0)