title: Display a svg from a String in Flutter/Dart
body: <p>I'm trying to display an image from a svg String to the screen.</p>
  
  <p>I'm using: <a href="https://pub.dartlang.org/packages/flutter_svg" rel="nofollow noreferrer">https://pub.dartlang.org/packages/flutter_svg</a> for svg support.</p>
  
  <pre><code>final String svgAsString = '''&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;svg xmlns="http://www.w3.org/2000/svg" width="109" height="109" viewBox="0 
  0 109 109"&gt;
  &lt;g id="kvg:StrokePaths_080a1" style="fill:none;stroke:#000000;stroke- 
  width:3;stroke-linecap:round;stroke-linejoin:round;"&gt;
  &lt;path id="kvg:080a1-s1" 
  d="M20.22,18.74c0.77,0.77,0.79,2.14,0.8,3.05C21.38,62,20.62,75,11.5,89.39"/&gt;
  &lt;/g&gt;
  &lt;/svg&gt;''';
  </code></pre>
  
  <p>I'm having trouble getting this rendered to either an image widget or draw onto a canvas. I've tried both ways and not getting anywhere.</p>
  
  <p>The full code I will paste below: I'm not sure if I'm on the right tracks.</p>
  
  <pre><code>import 'dart:async';
  import 'dart:ui';
  
  import 'package:flutter/material.dart';
  import 'package:flutter_svg/flutter_svg.dart';
  
   class KanjiGradeGenerator extends StatefulWidget {
       @override
       _KanjiGradeState createState() =&gt; _KanjiGradeState();
   }
  
   class _KanjiGradeState extends State&lt;KanjiGradeGenerator&gt; {
  
   _KanjiGradeState() {}
  
  displaySVG() async {
  
  &lt;g id="kvg:StrokePaths_080a1" style="fill:none;stroke:#000000;stroke- 
  width:3;stroke-linecap:round;stroke-linejoin:round;"&gt;
  &lt;path id="kvg:080a1-s1" 
  d="M20.22,18.74c0.77,0.77,0.79,2.14,0.8,3.05C21.38,62,20.62,75,11.5,89.39"/&gt;
  &lt;/g&gt;
  &lt;/svg&gt;''';
  
  final DrawableRoot svgRoot = await svg.fromSvgString(rawSvg, rawSvg);
  
  final Picture picture = svgRoot.toPicture();
  
  PictureRecorder picRec;
  Canvas can = Canvas(picRec);
  
  setState(() {
    can.drawPicture(picture);
  });
  }
  
  Widget build(BuildContext context) {
      return new Scaffold(
        body: Container(
          child: displaySVG()
        ),
      );
   }
  }
  </code></pre>
  
  <p>The error I receive is:</p>
  
  <blockquote>
    <p>I/flutter ( 7791): type 'Future' is not a subtype of type 'Widget'</p>
  </blockquote>