我創建了一堆矢??量圖形,我想在我的顫振應用程式中使用,但似乎無法從Figma使用flutter_svg.
這是我收到的錯誤
The following assertion was thrown while parsing AssetBundlePictureKey(bundle: PlatformAssetBundle#e7c1f(), name: "assets/images/question-btn.svg", colorFilter: null, theme: SvgTheme(currentColor: null, fontSize: 14.0, xHeight: 7.0)) in _getDefinitionPaint:
Failed to find definition for url(#Group 1__d)
This library only supports <defs> and xlink:href references that are defined ahead of their references.
我了解這個問題以及它發生的原因,但是有沒有辦法將 figma 中的組件匯出到可以在顫振中作業的 svg。
uj5u.com熱心網友回復:
從錯誤訊息中可以看出,您的 SVG 具有id包含空格的屬性。
url(#Group 1__d)
之后的部分#必須是id另一個元素的。但是id值中不能有空格。
我希望 Figma 在匯出 SVG 時能夠優雅地處理這個問題。但也許不是。
嘗試編輯 Figma 檔案并從圖層名稱中洗掉空格。例如,更改Group 1__d為Group_1__d、 或Group1d等。
轉載請註明出處,本文鏈接:https://www.uj5u.com/ruanti/475351.html
