Skip to content

Commit 957c9f8

Browse files
authored
Merge pull request Sub6Resources#676 from jpunz/patch-1
Added missing width & height for SvgPicture from asset
2 parents 5fc8ca0 + 484eb2b commit 957c9f8

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/image_render.dart

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ ImageRender assetImageRender({
7676
(context, attributes, element) {
7777
final assetPath = _src(attributes)!.replaceFirst('asset:', '');
7878
if (_src(attributes)!.endsWith(".svg")) {
79-
return SvgPicture.asset(assetPath);
79+
return SvgPicture.asset(
80+
assetPath,
81+
width: width ?? _width(attributes),
82+
height: height ?? _height(attributes));
8083
} else {
8184
return Image.asset(
8285
assetPath,

0 commit comments

Comments
 (0)