@@ -42,7 +42,7 @@ CustomRender svgDataImageRender() =>
42
42
final dataUri = _dataUriFormat.firstMatch (
43
43
_src (context.tree.element? .attributes.cast () ?? < String , String > {})! );
44
44
final data = dataUri? .namedGroup ('data' );
45
- if (data == null ) return Container (height: 0 , width: 0 );
45
+ if (data == null ) return const SizedBox (height: 0 , width: 0 );
46
46
return Builder (
47
47
key: context.key,
48
48
builder: (buildContext) {
@@ -74,7 +74,7 @@ CustomRender svgDataImageRender() =>
74
74
CustomRender svgNetworkImageRender () =>
75
75
CustomRender .widget (widget: (context, buildChildren) {
76
76
if (context.tree.element? .attributes["src" ] == null ) {
77
- return Container (height: 0 , width: 0 );
77
+ return const SizedBox (height: 0 , width: 0 );
78
78
}
79
79
return Builder (
80
80
key: context.key,
@@ -104,7 +104,7 @@ CustomRender svgAssetImageRender() =>
104
104
CustomRender .widget (widget: (context, buildChildren) {
105
105
if (_src (context.tree.element? .attributes.cast () ?? < String , String > {}) ==
106
106
null ) {
107
- return Container (height: 0 , width: 0 );
107
+ return const SizedBox (height: 0 , width: 0 );
108
108
}
109
109
final assetPath = _src (context.tree.element! .attributes.cast ())!
110
110
.replaceFirst ('asset:' , '' );
@@ -148,7 +148,7 @@ CustomRenderMatcher svgDataUriMatcher(
148
148
149
149
/// A CustomRenderMatcher for an <img> tag with an svg tag over the network
150
150
CustomRenderMatcher svgNetworkSourceMatcher ({
151
- List <String > schemas: const ["https" , "http" ],
151
+ List <String > schemas = const ["https" , "http" ],
152
152
List <String >? domains,
153
153
String ? extension = "svg" ,
154
154
}) =>
@@ -178,7 +178,7 @@ CustomRenderMatcher svgAssetUriMatcher() => (context) =>
178
178
.endsWith (".svg" );
179
179
180
180
final _dataUriFormat = RegExp (
181
- "^(?<scheme>data):(?<mime>image\/ [\\ w\+\-\ . ]+)(?<encoding>;base64)?\, (?<data>.*)" );
181
+ "^(?<scheme>data):(?<mime>image\\ /[\\ w\\ + \\ - \\ .]+)(?<encoding>;base64)?\ \ ,(?<data>.*)" );
182
182
183
183
String ? _src (Map <String , String > attributes) {
184
184
return attributes["src" ];
0 commit comments