From 5ca969143c9acf26b50fec3c11551b161a8b3fa9 Mon Sep 17 00:00:00 2001 From: lemz90 Date: Fri, 21 Nov 2025 12:08:02 -0600 Subject: [PATCH 1/4] use if/else instead of switch statement --- packages/core/lib/src/data/build_op.dart | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/packages/core/lib/src/data/build_op.dart b/packages/core/lib/src/data/build_op.dart index cdda085c4..08ca54b8a 100644 --- a/packages/core/lib/src/data/build_op.dart +++ b/packages/core/lib/src/data/build_op.dart @@ -169,17 +169,17 @@ class BuildOp { (onWidgets != null ? (tree, placeholder) { final children = onWidgets(tree, [placeholder]); - switch (children?.length) { - case null: - return placeholder; - case 0: - return widget0; - case 1: - return children?.first ?? widget0; - default: - throw UnsupportedError( - 'onWidgets must return exactly 1 widget, got ${children?.length}', - ); + final length = children?.length; + if (length == null) { + return placeholder; + } else if (length == 0) { + return widget0; + } else if (length == 1) { + return children!.first; + } else { + throw UnsupportedError( + 'onWidgets must return exactly 1 widget, got $length', + ); } } : null); From 5cbbd502a865531fc9d97b134d93582a4c718c6e Mon Sep 17 00:00:00 2001 From: lemz90 Date: Fri, 21 Nov 2025 13:47:50 -0600 Subject: [PATCH 2/4] update NetworkImage toString expected for new param --- packages/core/test/core_config_test.dart | 2 +- packages/core/test/core_test.dart | 12 +++++------ packages/core/test/style_background_test.dart | 2 +- packages/core/test/style_sizing_test.dart | 4 ++-- .../core/test/style_vertical_align_test.dart | 2 +- packages/core/test/tag_a_test.dart | 10 +++++----- packages/core/test/tag_img_test.dart | 20 +++++++++---------- packages/core/test/tag_q_test.dart | 2 +- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/packages/core/test/core_config_test.dart b/packages/core/test/core_config_test.dart index 878192262..012cbd971 100644 --- a/packages/core/test/core_config_test.dart +++ b/packages/core/test/core_config_test.dart @@ -222,7 +222,7 @@ void main() { explained, equals( '[CssSizing:height≥0.0,height=auto,width≥0.0,width=auto,child=' - '[Image:image=NetworkImage("http://base.com/path/image.png", scale: 1.0),' + '[Image:image=NetworkImage("http://base.com/path/image.png", scale: 1.0, webHtmlElementStrategy: never, headers: null),' 'semanticLabel=image dot png' ']]', ), diff --git a/packages/core/test/core_test.dart b/packages/core/test/core_test.dart index 2bb54047e..3b4c5190b 100644 --- a/packages/core/test/core_test.dart +++ b/packages/core/test/core_test.dart @@ -141,7 +141,7 @@ void main() { '[RichText:(:' '1\n' '[CssSizing:$imgSizingConstraints,child=' - '[Image:image=NetworkImage("$src", scale: 1.0)]' + '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' '])]', ), ); @@ -303,7 +303,7 @@ void main() { equals( '[SizedBox:0.0x10.0],' '[HorizontalMargin:left=40,right=40,child=[CssBlock:child=[Column:children=' - '[CssSizing:$imgSizingConstraints,child=[Image:image=NetworkImage("http://domain.com/image.png", scale: 1.0)]],' + '[CssSizing:$imgSizingConstraints,child=[Image:image=NetworkImage("http://domain.com/image.png", scale: 1.0, webHtmlElementStrategy: never, headers: null)]],' '[CssBlock:child=[RichText:(:(+i:fig. 1)(: Foo))]]' ']]],' '[SizedBox:0.0x10.0]', @@ -930,7 +930,7 @@ void main() { equals( '[RichText:(:Foo ' '[CssSizing:$imgSizingConstraints,child=' - '[Image:image=NetworkImage("$src", scale: 1.0)]' + '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' '])]', ), ); @@ -948,7 +948,7 @@ void main() { '[Column:children=' '[RichText:(:Foo)],' '[CssSizing:$imgSizingConstraints,child=' - '[Image:image=NetworkImage("$src", scale: 1.0)]' + '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' ']]', ), ); @@ -965,7 +965,7 @@ void main() { equals( '[CssSizing:height≥0.0,height=1.0,width≥0.0,width=1.0,child=' '[AspectRatio:aspectRatio=1.0,child=' - '[Image:image=NetworkImage("$src", scale: 1.0)]' + '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' ']]', ), ); @@ -983,7 +983,7 @@ void main() { equals( '[CssSizing:height≥0.0,height=1.0,width≥0.0,width=1.0,child=' '[AspectRatio:aspectRatio=1.0,child=' - '[Image:image=NetworkImage("$src", scale: 1.0)]' + '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' ']]', ), ); diff --git a/packages/core/test/style_background_test.dart b/packages/core/test/style_background_test.dart index b3aab9b3f..0b4a24d4c 100644 --- a/packages/core/test/style_background_test.dart +++ b/packages/core/test/style_background_test.dart @@ -116,7 +116,7 @@ Future main() async { expect( explained, equals( - '[Container:image=NetworkImage("$src", scale: 1.0),child=' + '[Container:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null),child=' '[CssBlock:child=[RichText:(:Foo)]]' ']', ), diff --git a/packages/core/test/style_sizing_test.dart b/packages/core/test/style_sizing_test.dart index 26c8916d8..8a1b2ac19 100644 --- a/packages/core/test/style_sizing_test.dart +++ b/packages/core/test/style_sizing_test.dart @@ -484,7 +484,7 @@ Future main() async { equals( '[RichText:(:Foo ' '[CssSizing:height≥0.0,height=10.0,width≥0.0,width=10.0,child=' - '[Image:image=NetworkImage("$src", scale: 1.0)]' + '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' '])]', ), ); @@ -501,7 +501,7 @@ Future main() async { '[CssBlock:child=[RichText:align=center,' '[CssSizing:height≥0.0,height=10.0,width≥0.0,width=10.0,child=' '[AspectRatio:aspectRatio=1.0,child=' - '[Image:image=NetworkImage("$src", scale: 1.0)]' + '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' ']]' '@middle]]', ), diff --git a/packages/core/test/style_vertical_align_test.dart b/packages/core/test/style_vertical_align_test.dart index 516a1cf02..689b0a203 100644 --- a/packages/core/test/style_vertical_align_test.dart +++ b/packages/core/test/style_vertical_align_test.dart @@ -232,7 +232,7 @@ void main() { const imgSrc = 'http://domain.com/image.png'; const imgRendered = '[CssSizing:height≥0.0,height=auto,width≥0.0,width=auto,child=' - '[Image:image=NetworkImage("$imgSrc", scale: 1.0)]' + '[Image:image=NetworkImage("$imgSrc", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' ']'; Future imgExplain(WidgetTester t, String html) => mockNetworkImages(() => explain(t, html)); diff --git a/packages/core/test/tag_a_test.dart b/packages/core/test/tag_a_test.dart index 2f6b379f0..ccbae947c 100644 --- a/packages/core/test/tag_a_test.dart +++ b/packages/core/test/tag_a_test.dart @@ -271,7 +271,7 @@ void main() { equals( '[MouseRegion:child=[GestureDetector:child=' '[CssSizing:$sizingConstraints,child=' - '[Image:image=NetworkImage("$kImgSrc", scale: 1.0)]' + '[Image:image=NetworkImage("$kImgSrc", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' ']]]', ), ); @@ -287,7 +287,7 @@ void main() { '(#FF123456+u+onTap:Foo )' '[MouseRegion:child=[GestureDetector:child=' '[CssSizing:$sizingConstraints,child=' - '[Image:image=NetworkImage("$kImgSrc", scale: 1.0)]' + '[Image:image=NetworkImage("$kImgSrc", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' ']]])]', ), ); @@ -302,7 +302,7 @@ void main() { '[RichText:(:Foo ' '[MouseRegion:child=[GestureDetector:child=' '[CssSizing:$sizingConstraints,child=' - '[Image:image=NetworkImage("$kImgSrc", scale: 1.0)]' + '[Image:image=NetworkImage("$kImgSrc", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' ']]])]', ), ); @@ -317,7 +317,7 @@ void main() { '[RichText:(:' '[MouseRegion:child=[GestureDetector:child=' '[CssSizing:$sizingConstraints,child=' - '[Image:image=NetworkImage("$kImgSrc", scale: 1.0)]' + '[Image:image=NetworkImage("$kImgSrc", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' ']]]' '(#FF123456+u+onTap: foo)' ')]', @@ -334,7 +334,7 @@ void main() { '[RichText:(:' '[MouseRegion:child=[GestureDetector:child=' '[CssSizing:$sizingConstraints,child=' - '[Image:image=NetworkImage("$kImgSrc", scale: 1.0)]' + '[Image:image=NetworkImage("$kImgSrc", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' ']]]' '(: foo))]', ), diff --git a/packages/core/test/tag_img_test.dart b/packages/core/test/tag_img_test.dart index 01537c4aa..c203b38f9 100644 --- a/packages/core/test/tag_img_test.dart +++ b/packages/core/test/tag_img_test.dart @@ -23,7 +23,7 @@ void main() { explained, equals( '[CssSizing:$sizingConstraints,child=' - '[Image:image=NetworkImage("$src", scale: 1.0)]' + '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' ']', ), ); @@ -37,7 +37,7 @@ void main() { equals( '[CssSizing:$sizingConstraints,child=' '[Image:' - 'image=NetworkImage("$src", scale: 1.0),' + 'image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null),' 'semanticLabel=Foo' ']]', ), @@ -54,7 +54,7 @@ void main() { '[Tooltip:' 'message=Bar,' 'child=[Image:' - 'image=NetworkImage("$src", scale: 1.0),' + 'image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null),' 'semanticLabel=Bar' ']]]', ), @@ -71,7 +71,7 @@ void main() { '[Tooltip:' 'message=Bar,' 'child=[Image:' - 'image=NetworkImage("$src", scale: 1.0),' + 'image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null),' 'semanticLabel=Foo' ']]]', ), @@ -86,10 +86,10 @@ void main() { equals( '[RichText:(:' '[CssSizing:$sizingConstraints,child=' - '[Image:image=NetworkImage("$src", scale: 1.0)]]' + '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]]' '(: )' '[CssSizing:$sizingConstraints,child=' - '[Image:image=NetworkImage("$src", scale: 1.0)]]' + '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]]' ')]', ), ); @@ -115,7 +115,7 @@ void main() { equals( '[CssSizing:height≥0.0,height=600.0,width≥0.0,width=800.0,child=' '[AspectRatio:aspectRatio=1.3,child=' - '[Image:image=NetworkImage("$src", scale: 1.0)]' + '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' ']]', ), ); @@ -130,7 +130,7 @@ void main() { '[RichText:(:' 'Before text. ' '[CssSizing:$sizingConstraints,child=' - '[Image:image=NetworkImage("$src", scale: 1.0)]]' + '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]]' '(: After text.)' ')]', ), @@ -144,7 +144,7 @@ void main() { explained, equals( '[CssSizing:$sizingConstraints,child=' - '[Image:image=NetworkImage("$src", scale: 1.0)]]', + '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]]', ), ); }); @@ -284,7 +284,7 @@ void main() { explained, equals( '[CssSizing:$sizingConstraints,child=' - '[Image:image=NetworkImage("$fullUrl", scale: 1.0)]' + '[Image:image=NetworkImage("$fullUrl", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' ']', ), ); diff --git a/packages/core/test/tag_q_test.dart b/packages/core/test/tag_q_test.dart index 0c121c8ae..ed9104ce9 100644 --- a/packages/core/test/tag_q_test.dart +++ b/packages/core/test/tag_q_test.dart @@ -33,7 +33,7 @@ void main() { equals( '[RichText:(:“' '[CssSizing:height≥0.0,height=auto,width≥0.0,width=auto,child=' - '[Image:image=NetworkImage("$src", scale: 1.0)]]' + '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]]' '(:”))]', ), ); From d2426ce894608fcd573a8fb4bd6af193c240d400 Mon Sep 17 00:00:00 2001 From: Dao Hoang Son Date: Mon, 24 Nov 2025 23:10:08 +0700 Subject: [PATCH 3/4] Revert "update NetworkImage toString expected for new param" This reverts commit 5cbbd502a865531fc9d97b134d93582a4c718c6e. --- packages/core/test/core_config_test.dart | 2 +- packages/core/test/core_test.dart | 12 +++++------ packages/core/test/style_background_test.dart | 2 +- packages/core/test/style_sizing_test.dart | 4 ++-- .../core/test/style_vertical_align_test.dart | 2 +- packages/core/test/tag_a_test.dart | 10 +++++----- packages/core/test/tag_img_test.dart | 20 +++++++++---------- packages/core/test/tag_q_test.dart | 2 +- 8 files changed, 27 insertions(+), 27 deletions(-) diff --git a/packages/core/test/core_config_test.dart b/packages/core/test/core_config_test.dart index 012cbd971..878192262 100644 --- a/packages/core/test/core_config_test.dart +++ b/packages/core/test/core_config_test.dart @@ -222,7 +222,7 @@ void main() { explained, equals( '[CssSizing:height≥0.0,height=auto,width≥0.0,width=auto,child=' - '[Image:image=NetworkImage("http://base.com/path/image.png", scale: 1.0, webHtmlElementStrategy: never, headers: null),' + '[Image:image=NetworkImage("http://base.com/path/image.png", scale: 1.0),' 'semanticLabel=image dot png' ']]', ), diff --git a/packages/core/test/core_test.dart b/packages/core/test/core_test.dart index 3b4c5190b..2bb54047e 100644 --- a/packages/core/test/core_test.dart +++ b/packages/core/test/core_test.dart @@ -141,7 +141,7 @@ void main() { '[RichText:(:' '1\n' '[CssSizing:$imgSizingConstraints,child=' - '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' + '[Image:image=NetworkImage("$src", scale: 1.0)]' '])]', ), ); @@ -303,7 +303,7 @@ void main() { equals( '[SizedBox:0.0x10.0],' '[HorizontalMargin:left=40,right=40,child=[CssBlock:child=[Column:children=' - '[CssSizing:$imgSizingConstraints,child=[Image:image=NetworkImage("http://domain.com/image.png", scale: 1.0, webHtmlElementStrategy: never, headers: null)]],' + '[CssSizing:$imgSizingConstraints,child=[Image:image=NetworkImage("http://domain.com/image.png", scale: 1.0)]],' '[CssBlock:child=[RichText:(:(+i:fig. 1)(: Foo))]]' ']]],' '[SizedBox:0.0x10.0]', @@ -930,7 +930,7 @@ void main() { equals( '[RichText:(:Foo ' '[CssSizing:$imgSizingConstraints,child=' - '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' + '[Image:image=NetworkImage("$src", scale: 1.0)]' '])]', ), ); @@ -948,7 +948,7 @@ void main() { '[Column:children=' '[RichText:(:Foo)],' '[CssSizing:$imgSizingConstraints,child=' - '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' + '[Image:image=NetworkImage("$src", scale: 1.0)]' ']]', ), ); @@ -965,7 +965,7 @@ void main() { equals( '[CssSizing:height≥0.0,height=1.0,width≥0.0,width=1.0,child=' '[AspectRatio:aspectRatio=1.0,child=' - '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' + '[Image:image=NetworkImage("$src", scale: 1.0)]' ']]', ), ); @@ -983,7 +983,7 @@ void main() { equals( '[CssSizing:height≥0.0,height=1.0,width≥0.0,width=1.0,child=' '[AspectRatio:aspectRatio=1.0,child=' - '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' + '[Image:image=NetworkImage("$src", scale: 1.0)]' ']]', ), ); diff --git a/packages/core/test/style_background_test.dart b/packages/core/test/style_background_test.dart index 0b4a24d4c..b3aab9b3f 100644 --- a/packages/core/test/style_background_test.dart +++ b/packages/core/test/style_background_test.dart @@ -116,7 +116,7 @@ Future main() async { expect( explained, equals( - '[Container:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null),child=' + '[Container:image=NetworkImage("$src", scale: 1.0),child=' '[CssBlock:child=[RichText:(:Foo)]]' ']', ), diff --git a/packages/core/test/style_sizing_test.dart b/packages/core/test/style_sizing_test.dart index 8a1b2ac19..26c8916d8 100644 --- a/packages/core/test/style_sizing_test.dart +++ b/packages/core/test/style_sizing_test.dart @@ -484,7 +484,7 @@ Future main() async { equals( '[RichText:(:Foo ' '[CssSizing:height≥0.0,height=10.0,width≥0.0,width=10.0,child=' - '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' + '[Image:image=NetworkImage("$src", scale: 1.0)]' '])]', ), ); @@ -501,7 +501,7 @@ Future main() async { '[CssBlock:child=[RichText:align=center,' '[CssSizing:height≥0.0,height=10.0,width≥0.0,width=10.0,child=' '[AspectRatio:aspectRatio=1.0,child=' - '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' + '[Image:image=NetworkImage("$src", scale: 1.0)]' ']]' '@middle]]', ), diff --git a/packages/core/test/style_vertical_align_test.dart b/packages/core/test/style_vertical_align_test.dart index 689b0a203..516a1cf02 100644 --- a/packages/core/test/style_vertical_align_test.dart +++ b/packages/core/test/style_vertical_align_test.dart @@ -232,7 +232,7 @@ void main() { const imgSrc = 'http://domain.com/image.png'; const imgRendered = '[CssSizing:height≥0.0,height=auto,width≥0.0,width=auto,child=' - '[Image:image=NetworkImage("$imgSrc", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' + '[Image:image=NetworkImage("$imgSrc", scale: 1.0)]' ']'; Future imgExplain(WidgetTester t, String html) => mockNetworkImages(() => explain(t, html)); diff --git a/packages/core/test/tag_a_test.dart b/packages/core/test/tag_a_test.dart index ccbae947c..2f6b379f0 100644 --- a/packages/core/test/tag_a_test.dart +++ b/packages/core/test/tag_a_test.dart @@ -271,7 +271,7 @@ void main() { equals( '[MouseRegion:child=[GestureDetector:child=' '[CssSizing:$sizingConstraints,child=' - '[Image:image=NetworkImage("$kImgSrc", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' + '[Image:image=NetworkImage("$kImgSrc", scale: 1.0)]' ']]]', ), ); @@ -287,7 +287,7 @@ void main() { '(#FF123456+u+onTap:Foo )' '[MouseRegion:child=[GestureDetector:child=' '[CssSizing:$sizingConstraints,child=' - '[Image:image=NetworkImage("$kImgSrc", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' + '[Image:image=NetworkImage("$kImgSrc", scale: 1.0)]' ']]])]', ), ); @@ -302,7 +302,7 @@ void main() { '[RichText:(:Foo ' '[MouseRegion:child=[GestureDetector:child=' '[CssSizing:$sizingConstraints,child=' - '[Image:image=NetworkImage("$kImgSrc", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' + '[Image:image=NetworkImage("$kImgSrc", scale: 1.0)]' ']]])]', ), ); @@ -317,7 +317,7 @@ void main() { '[RichText:(:' '[MouseRegion:child=[GestureDetector:child=' '[CssSizing:$sizingConstraints,child=' - '[Image:image=NetworkImage("$kImgSrc", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' + '[Image:image=NetworkImage("$kImgSrc", scale: 1.0)]' ']]]' '(#FF123456+u+onTap: foo)' ')]', @@ -334,7 +334,7 @@ void main() { '[RichText:(:' '[MouseRegion:child=[GestureDetector:child=' '[CssSizing:$sizingConstraints,child=' - '[Image:image=NetworkImage("$kImgSrc", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' + '[Image:image=NetworkImage("$kImgSrc", scale: 1.0)]' ']]]' '(: foo))]', ), diff --git a/packages/core/test/tag_img_test.dart b/packages/core/test/tag_img_test.dart index c203b38f9..01537c4aa 100644 --- a/packages/core/test/tag_img_test.dart +++ b/packages/core/test/tag_img_test.dart @@ -23,7 +23,7 @@ void main() { explained, equals( '[CssSizing:$sizingConstraints,child=' - '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' + '[Image:image=NetworkImage("$src", scale: 1.0)]' ']', ), ); @@ -37,7 +37,7 @@ void main() { equals( '[CssSizing:$sizingConstraints,child=' '[Image:' - 'image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null),' + 'image=NetworkImage("$src", scale: 1.0),' 'semanticLabel=Foo' ']]', ), @@ -54,7 +54,7 @@ void main() { '[Tooltip:' 'message=Bar,' 'child=[Image:' - 'image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null),' + 'image=NetworkImage("$src", scale: 1.0),' 'semanticLabel=Bar' ']]]', ), @@ -71,7 +71,7 @@ void main() { '[Tooltip:' 'message=Bar,' 'child=[Image:' - 'image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null),' + 'image=NetworkImage("$src", scale: 1.0),' 'semanticLabel=Foo' ']]]', ), @@ -86,10 +86,10 @@ void main() { equals( '[RichText:(:' '[CssSizing:$sizingConstraints,child=' - '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]]' + '[Image:image=NetworkImage("$src", scale: 1.0)]]' '(: )' '[CssSizing:$sizingConstraints,child=' - '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]]' + '[Image:image=NetworkImage("$src", scale: 1.0)]]' ')]', ), ); @@ -115,7 +115,7 @@ void main() { equals( '[CssSizing:height≥0.0,height=600.0,width≥0.0,width=800.0,child=' '[AspectRatio:aspectRatio=1.3,child=' - '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' + '[Image:image=NetworkImage("$src", scale: 1.0)]' ']]', ), ); @@ -130,7 +130,7 @@ void main() { '[RichText:(:' 'Before text. ' '[CssSizing:$sizingConstraints,child=' - '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]]' + '[Image:image=NetworkImage("$src", scale: 1.0)]]' '(: After text.)' ')]', ), @@ -144,7 +144,7 @@ void main() { explained, equals( '[CssSizing:$sizingConstraints,child=' - '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]]', + '[Image:image=NetworkImage("$src", scale: 1.0)]]', ), ); }); @@ -284,7 +284,7 @@ void main() { explained, equals( '[CssSizing:$sizingConstraints,child=' - '[Image:image=NetworkImage("$fullUrl", scale: 1.0, webHtmlElementStrategy: never, headers: null)]' + '[Image:image=NetworkImage("$fullUrl", scale: 1.0)]' ']', ), ); diff --git a/packages/core/test/tag_q_test.dart b/packages/core/test/tag_q_test.dart index ed9104ce9..0c121c8ae 100644 --- a/packages/core/test/tag_q_test.dart +++ b/packages/core/test/tag_q_test.dart @@ -33,7 +33,7 @@ void main() { equals( '[RichText:(:“' '[CssSizing:height≥0.0,height=auto,width≥0.0,width=auto,child=' - '[Image:image=NetworkImage("$src", scale: 1.0, webHtmlElementStrategy: never, headers: null)]]' + '[Image:image=NetworkImage("$src", scale: 1.0)]]' '(:”))]', ), ); From a2f4f7094e716aa7b43d04ae78381f35bda34183 Mon Sep 17 00:00:00 2001 From: Dao Hoang Son Date: Mon, 24 Nov 2025 23:14:55 +0700 Subject: [PATCH 4/4] fix: remove extra image properties --- packages/core/test/_.dart | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/packages/core/test/_.dart b/packages/core/test/_.dart index 89c357068..e0ce3daaf 100644 --- a/packages/core/test/_.dart +++ b/packages/core/test/_.dart @@ -162,7 +162,13 @@ Future explainWithoutPumping({ ).explain(built); str = str.replaceAll(RegExp('String#[^,]+,'), 'String,'); - return str.replaceAll(RegExp('Uint8List#[0-9a-f]+,'), 'bytes,'); + str = str.replaceAll(RegExp('Uint8List#[0-9a-f]+,'), 'bytes,'); + + // images + str = str.replaceAll(', headers: null', ''); + str = str.replaceAll(', webHtmlElementStrategy: never', ''); + + return str; } final _explainMarginRegExp = RegExp(