Open yykou opened 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
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:
Result:
Try this out:
Result:
Try this out:
Result:
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分](https://github.com/dnfield/flutter_svg/assets/21016582/fc93a7bd-feba-4939-916e-9019c19c4f65)