Repository: flutter
Issue: [flutter_svg] 'fitWidth' does not set the widget height properly
Labels: package,p: flutter_svg

_Imported from https://github.com/dnfield/flutter_svg/issues/83_

Original report by @abeintopalo on Nov 14, 2018

When using `BoxFit.fitWidth` with SvgPicture results that the content is scaled up properly according to the container widget's width but the actual SvgPicture dimensions are not correct resulting in cropped image.

Sample code:

```
 Widget build(BuildContext context) {
    return Scaffold(
      body: Row(
        children: <Widget>[
          Spacer(
            flex: 1,
          ),
          Expanded(
            flex: 8,
            child: Column(
              mainAxisAlignment: MainAxisAlignment.start,
              crossAxisAlignment: CrossAxisAlignment.stretch,
              children: <Widget>[
                Spacer(
                  flex: 2,
                ),
                Expanded(
                  flex: 8,
                  child: Column(
                    mainAxisAlignment: MainAxisAlignment.start,
                    crossAxisAlignment: CrossAxisAlignment.stretch,
                    children: <Widget>[
                      SvgPicture.asset(
                        'assets/circles.svg',
                        color: Colors.black,
                        fit: BoxFit.fitWidth,
                      ),
                      Image.asset(
                          'assets/circles.png',
                          fit: BoxFit.fitWidth
                      ),
                    ],
                  ),
                ),
              ],
            ),
          ),
          Spacer(
            flex: 1,
          )
        ],
      ),
    );
  }
}
```

<img width="530" alt="iphone x" src="https://user-images.githubusercontent.com/7497004/48469734-4f1ce700-e7f8-11e8-9cda-2de13fab56ea.png">


In the sample code above `circles.svg` and 'circles.png` have "identical" content. I would expect that SvgPicture widget scales the same way as Image widget i.e. without cropping.


---
Comment by @dnfield on Nov 14, 2018
Can you share the svg?

---
Comment by @abeintopalo on Nov 14, 2018
Sure.

```
<?xml version="1.0" encoding="UTF-8"?>
<svg width="332px" height="58px" viewBox="0 0 332 58" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
    <!-- Generator: Sketch 52.4 (67378) - http://www.bohemiancoding.com/sketch -->
    <title>Slice 1</title>
    <desc>Created with Sketch.</desc>
    <g id="Page-2" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd">
        <circle id="Circle-6" stroke="#979797" fill="#000000" cx="303.5" cy="28.5" r="27.5"></circle>
        <circle id="Circle-5" stroke="#979797" fill="#000000" cx="248.5" cy="28.5" r="27.5"></circle>
        <circle id="Circle-4" stroke="#979797" fill="#000000" cx="193.5" cy="28.5" r="27.5"></circle>
        <circle id="Circle-3" stroke="#979797" fill="#000000" cx="138.5" cy="28.5" r="27.5"></circle>
        <circle id="Circle-2" stroke="#979797" fill="#000000" cx="83.5" cy="28.5" r="27.5"></circle>
        <circle id="Circle-1" stroke="#979797" fill="#000000" cx="28.5" cy="29.5" r="27.5"></circle>
    </g>
</svg>
```

---
Comment by @dnfield on Nov 24, 2018
Are you on master or on the published version?

---
Comment by @abeintopalo on Nov 26, 2018
I have this in my `pubspec.yaml`: `flutter_svg: ^0.6.3`