Flutter_svg: linearGradient cant loaded

Created on 22 Nov 2019  路  4Comments  路  Source: dnfield/flutter_svg

Hi,

I have this svg, you can see here:
### but Its not loaded on flutter with flutter_svg :\

<svg width="375" height="112" viewBox="0 0 375 112" fill="none" xmlns="http://www.w3.org/2000/svg">
<path fill-rule="evenodd" clip-rule="evenodd" d="M185.504 462.059C305.106 462.059 402.063 365.102 402.063 245.5C402.063 125.898 305.106 28.941 185.504 28.941C65.9019 28.941 -31.0549 125.898 -31.0549 245.5C-31.0549 365.102 65.9019 462.059 185.504 462.059Z" fill="url(#paint0_linear)" fill-opacity="0.5"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M187.5 491C323.086 491 433 381.086 433 245.5C433 109.914 323.086 0 187.5 0C51.9141 0 -58 109.914 -58 245.5C-58 381.086 51.9141 491 187.5 491Z" fill="url(#paint1_linear)" fill-opacity="0.2"/>
<path fill-rule="evenodd" clip-rule="evenodd" d="M185.005 443.11C291.104 443.11 377.114 357.1 377.114 251.001C377.114 144.902 291.104 58.8923 185.005 58.8923C78.9064 58.8923 -7.10365 144.902 -7.10365 251.001C-7.10365 357.1 78.9064 443.11 185.005 443.11Z" fill="url(#paint2_linear)"/>
<defs>
<linearGradient id="paint0_linear" x1="-24.747" y1="28.941" x2="-24.747" y2="449.443" gradientUnits="userSpaceOnUse">
<stop stop-color="#5D63F5"/>
<stop offset="1" stop-color="#FF9E7B"/>
</linearGradient>
<linearGradient id="paint1_linear" x1="-50.8492" y1="0" x2="-50.8492" y2="476.698" gradientUnits="userSpaceOnUse">
<stop stop-color="#5D63F5"/>
<stop offset="1" stop-color="#FF9E7B"/>
</linearGradient>
<linearGradient id="paint2_linear" x1="-1.508" y1="58.8923" x2="-1.508" y2="431.918" gradientUnits="userSpaceOnUse">
<stop stop-color="#5D63F5"/>
<stop offset="1" stop-color="#FF9E7B"/>
</linearGradient>
</defs>
</svg>

### but Its not loaded on flutter with flutter_svg :\
here is my pubspec.xml:

  assets:
    - assets/

here is my flutter code:

 @override
  Widget build(BuildContext context) {
    return Scaffold(
      body:
      Stack(
        children: <Widget>[
          new SvgPicture.asset(
  'assets/circels.svg',
  allowDrawingOutsideViewBox: true,
),
         ],
      ));
  }

Hope you will can help me!
thank you very much!

Most helpful comment

Defs need to be declared before they are used. See #102

All 4 comments

Defs need to be declared before they are used. See #102

even if I declare defs before it does not work

Is linearGradient implemented?

It needs to be declared before it is referenced. If you have another sample where that doesn't work please open a bug

Was this page helpful?
0 / 5 - 0 ratings

Related issues

amorenew picture amorenew  路  6Comments

ifiokjr picture ifiokjr  路  5Comments

jeffersondarcy picture jeffersondarcy  路  3Comments

ChristianKleineidam picture ChristianKleineidam  路  5Comments

Skyost picture Skyost  路  3Comments