title: Using a SVG as a background image for a Container
body: <p>From <a href="https://stackoverflow.com/questions/44087400/flutter-svg-rendering">this question</a> I am using Flutter's SVG package (<code>flutter_svg</code>) to render a <a href="https://openclipart.org/download/310196/1542216179.svg" rel="noreferrer">SVG image</a>.</p>
  
  <p>I want to use the SVG as a <code>Container</code> background with <code>Text</code> in the middle.</p>
  
  <p><a href="https://i.stack.imgur.com/UGgWD.png" rel="noreferrer"><img src="https://i.stack.imgur.com/UGgWD.png" alt="example of Container with background image"></a></p>
  
  <p>This is the code I have so far:</p>
  
  <pre><code>Container(
        decoration: BoxDecoration(
            image: DecorationImage(image: SvgPicture.asset(
              'assets/example.svg',
            ),),
        ),
        children: &lt;Widget&gt;[
          Text('Welcome to my Flutter App',
            style: Theme.of(context).textTheme.display1.copyWith(
              color: Colors.white,
              fontWeight: FontWeight.bold
            )
          ),
        ],
      )
  </code></pre>
  
  <p>The problem I am finding is that <code>SvgPicture</code> is not an <code>ImageProvider</code> so I can't add the <code>BoxDecoration</code> to get a background image. </p>
  
  <p>Is there a way to then use <code>SvgPicture</code> as a Container's box decoration or background?</p>