gpt4 book ai didi

flutter - Flutter SVG仅显示一种颜色

转载 作者:行者123 更新时间:2023-12-03 04:52:53 25 4
gpt4 key购买 nike

我想在项目中添加SVG文件,并使用flutter_svg:^ 0.17.3,
我的项目显示SVG,但实际上我的SVG文件有2种颜色,但是在项目中,它仅显示一种颜色!
svg文件的来源:

<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512">
<defs>
<style>.fa-secondary{opacity:.4}</style>
</defs>
<path d="M208 80a128 128 0 1 1-90.51 37.49A127.15 127.15 0 0 1 208 80m0-80C93.12 0 0 93.12 0 208s93.12 208 208 208 208-93.12 208-208S322.88 0 208 0z" class="fa-secondary"/><path d="M504.9 476.7L476.6 505a23.9 23.9 0 0 1-33.9 0L343 405.3a24 24 0 0 1-7-17V372l36-36h16.3a24 24 0 0 1 17 7l99.7 99.7a24.11 24.11 0 0 1-.1 34z" class="fa-primary"/>
</svg>

最佳答案

您可以尝试使用此SVG波纹管,或使用0.17.4再试一次:

<svg width="512" height="512" viewBox="0 0 512 512" fill="none" xmlns="http://www.w3.org/2000/svg">
<g clip-path="url(#clip0)">
<path opacity="0.4" d="M208 80C237.613 80.0002 266.311 90.2684 289.202 109.055C312.094 127.842 327.763 153.985 333.54 183.029C339.317 212.074 334.845 242.223 320.885 268.339C306.925 294.456 284.342 314.924 256.982 326.257C229.623 337.589 199.181 339.085 170.842 330.488C142.504 321.892 118.023 303.735 101.571 279.113C85.1187 254.49 77.713 224.924 80.6157 195.453C83.5185 165.982 96.55 138.43 117.49 117.49C129.348 105.566 143.453 96.1132 158.989 89.678C174.526 83.2428 191.184 79.9533 208 80V80ZM208 0C93.12 0 0 93.12 0 208C0 322.88 93.12 416 208 416C322.88 416 416 322.88 416 208C416 93.12 322.88 0 208 0Z" fill="#999999"/>
<path d="M504.9 476.7L476.6 505C474.379 507.234 471.738 509.008 468.829 510.218C465.92 511.428 462.801 512.05 459.65 512.05C456.499 512.05 453.38 511.428 450.471 510.218C447.562 509.008 444.921 507.234 442.7 505L343 405.3C340.773 403.065 339.009 400.414 337.808 397.497C336.607 394.58 335.992 391.455 336 388.3V372L372 336H388.3C391.455 335.992 394.58 336.607 397.497 337.808C400.414 339.009 403.065 340.773 405.3 343L505 442.7C509.479 447.231 511.982 453.35 511.964 459.721C511.945 466.091 509.405 472.196 504.9 476.7V476.7Z" fill="black"/>
</g>
<defs>
<clipPath id="clip0">
<rect width="512" height="512" fill="white"/>
</clipPath>
</defs>
</svg>

关于flutter - Flutter SVG仅显示一种颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61092994/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com