[Error] flutter_svg 플러그인의 url(’#pattern’) 예외 상황 에러
by IFLA2022. 11. 30.
에러 메시지
======== Exception caught by SVG ===================================================================
The following assertion was thrown while parsing AssetBundlePictureKey(bundle: PlatformAssetBundle#17ec6(), name: "assets/images/mood_absurd.svg", colorFilter: null, theme: SvgTheme(currentColor: Color(0xff000000), fontSize: 14.0, xHeight: 7.0)) in _getDefinitionPaint:
Failed to find definition for url(#pattern)
This library only supports <defs> and xlink:href references that are defined ahead of their references.
This error can be caused when the desired definition is defined after the element referring to it (e.g. at the end of the file), or defined in another file.
This error is treated as non-fatal, but your SVG file will likely not render as intended
====================================================================================================
에러 이유
flutter_svg 플러그인에서 pattern 태그를 지원하지 않기 때문에 생긴 문제다.
svg 파일의 태그 정보를 안드로이드 앱이나 플러터에서 사용이 안되기 때문에 pattern 태그나 style 태그를 사용한 svg 파일이 존재할 때 생긴다.
디자이너 분과 협업하게 된다면 순수 이미지 파일이 들어가게 된 경우 도형으로 변경요청을 하거나 일러스트레이터의 효과는 제거 후 svg 파일을 재요청 해야한다.
댓글