10000 Run flutter format once more · Sub6Resources/flutter_html@5ae5cc4 · GitHub
[go: up one dir, main page]

Skip to content

Commit 5ae5cc4

Browse files
committed
Run flutter format once more
1 parent fb16b8d commit 5ae5cc4

File tree

2 files changed

+9
-11
lines changed

2 files changed

+9
-11
lines changed

packages/flutter_html_svg/lib/flutter_html_svg.dart

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ import 'package:flutter_svg/flutter_svg.dart';
1010
// TODO re-add MultipleGestureDetector for image taps in this extension
1111

1212
class SvgHtmlExtension extends Extension {
13-
1413
final String? dataEncoding;
1514
final String? dataMimeType;
1615
final List<String> networkSchemas;
@@ -34,11 +33,11 @@ class SvgHtmlExtension extends Extension {
3433

3534
@override
3635
bool matches(ExtensionContext context) {
37-
if(!supportedTags.contains(context.elementName)) {
36+
if (!supportedTags.contains(context.elementName)) {
3837
return false;
3938
}
4039

41-
if(context.elementName == "svg") {
40+
if (context.elementName == "svg") {
4241
return true;
4342
}
4443

@@ -51,7 +50,7 @@ class SvgHtmlExtension extends Extension {
5150
bool _matchesSvgDataUri(ExtensionContext context) {
5251
final attributes = context.attributes;
5352

54-
if(attributes['src'] == null) {
53+
if (attributes['src'] == null) {
5554
return false;
5655
}
5756

@@ -60,28 +59,27 @@ class SvgHtmlExtension extends Extension {
6059
return context.elementName == "img" &&
6160
dataUri != null &&
6261
(dataMimeType == null || dataUri.namedGroup('mime') == dataMimeType) &&
63-
(dataEncoding == null || dataUri.namedGroup('encoding') == dataEncoding);
62+
(dataEncoding == null ||
63+
dataUri.namedGroup('encoding') == dataEncoding);
6464
}
6565

6666
/// Matches an <img> tag with an svg network image
6767
bool _matchesSvgNetworkSource(ExtensionContext context) {
6868
final attributes = context.attributes;
6969

70-
if(attributes['src'] == null) {
70+
if (attributes['src'] == null) {
7171
return false;
7272
}
7373

74-
7574
final src = Uri.tryParse(attributes['src']!);
76-
if(src == null) {
75+
if (src == null) {
7776
return false;
7877
}
7978

8079
return context.elementName == "img" &&
8180
networkSchemas.contains(src.scheme) &&
8281
(networkDomains == null || networkDomains!.contains(src.host)) &&
8382
(extension == null || src.path.endsWith(".$extension"));
84-
8583
}
8684

8785
/// Matches an <img> tag with an svg asset image
@@ -142,7 +140,7 @@ class SvgHtmlExtension extends Extension {
142140
widget = _renderAssetSvg(context);
143141
} else if (_matchesSvgDataUri(context)) {
144142
widget = _renderDataSvg(context);
145-
} else if (_matchesSvgNetworkSource(context)){
143+
} else if (_matchesSvgNetworkSource(context)) {
146144
widget = _renderNetworkSvg(context);
147145
}
148146
}

packages/flutter_html_svg/test/svg_data_image_test.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ void main() {
2222
testMatchAndRender(
2323
"matches and renders image/svg+xml with text encoding",
2424
makeImgTag(
25-
src: 'data:image/svg+xml,$svgEncoded', width: 100, height: 100),
25+
src: 'data:image/svg+xml,$svgEncoded', width: 100, height: 100),
2626
const SvgHtmlExtension(
2727
dataEncoding: null,
2828
),

0 commit comments

Comments
 (0)
0