dnfield / flutter_svg

SVG parsing, rendering, and widget library for Flutter
MIT License
1.64k stars 449 forks source link

image cannot be displayed #1073

Open yykou opened 1 month ago

yykou commented 1 month ago

An SVG image on a web page that can be opened normally will result in a black area when loaded using the latest version of the library, and the image cannot be displayed.

SVG image path:https://ccdn1.goodq.top/caches/3802cdfcb59f037aa40858825f9f3e24/aHR0cHM6Ly9zdmdzLjR2eC5uZXQvcWZ5LWNvbnRlbnQvdXBsb2Fkcy8yMDIxLzA0LzBhYTNlNzQwYzU0ZjMxZjY0YmIyODE3OTc2ZjQwODJkLnN2Zw_p_p100_p_3D_p_p100_p_3D.svg

code: SvgPicture.network( 'https://ccdn1.goodq.top/caches/3802cdfcb59f037aa40858825f9f3e24/aHR0cHM6Ly9zdmdzLjR2eC5uZXQvcWZ5LWNvbnRlbnQvdXBsb2Fkcy8yMDIxLzA0LzBhYTNlNzQwYzU0ZjMxZjY0YmIyODE3OTc2ZjQwODJkLnN2Zw_p_p100_p_3D_p_p100_p_3D.svg', semanticsLabel: 'A shark?!', width: 50.0, height: 50.0, placeholderBuilder: (BuildContext context) => Container( padding: const EdgeInsets.all(30.0), child: const CircularProgressIndicator()), )

The final display effect: Clipboard - 2024年5月30日下午3点24分

yykou commented 1 month ago

[√] Flutter (Channel stable, 3.19.0, on Microsoft Windows [版本 10.0.19045.4412], locale zh-CN) • Flutter version 3.19.0 on channel stable at C:\yykou\flutter_sdk\flutter_windows_3.19.0-stable\flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision bae5e49bc2 (4 months ago), 2024-02-13 17:46:18 -0800 • Engine revision 04817c99c9 • Dart version 3.3.0 • DevTools version 2.31.1

s681562 commented 1 week ago

Same error. Either black rectangle is showing or nothing is showing. It looks like flutter_svg can not encode svg images created by <!-- Generator: Adobe Illustrator 27.5.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->

Code: IconButton( padding: EdgeInsets.zero, constraints: BoxConstraints(), icon: SvgPicture.asset("assets/images/gdb_logo_negative.svg"), onPressed: () { // ToDo https://gemeinsamdigital.berlin.de/de/ }, ),

Try this out:

gdb_kfw_bwsb_sk_rgb

Result:

KakaoTalk_20240624_091003776

Try this out:

gdb_logo_negativ

Result:

KakaoTalk_20240624_091017138

Try this out:

gdb_logo_positive

Result:

KakaoTalk_20240624_091028986