# flutter_svg 0.1.0

An SVG rendering and widget library for Flutter.




## Installing
```
export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add 'flutter_svg:0.1.0'
```
Published: 2018-05-10T20:36:07.163330Z
Expected archive SHA-256: 6b5dacfcdd83bb03cfd5686a7b1550594e8c0989ac0598c9504aae05ed21aaf6

Available in cache; verification: upstream_checksum
## Direct dependencies
- cupertino_icons: ^0.1.0
- flutter: map[sdk:flutter]
- meta: ^1.1.2
- path_drawing: ^0.2.2
- vector_math: ^2.0.4
- xml: ^3.0.0

## Package README (untrusted upstream documentation)
# flutter_svg

[![Build Status](https://travis-ci.org/dnfield/flutter_svg.svg?branch=master)](https://travis-ci.org/dnfield/flutter_svg)

Draw SVG and Android VectorDrawable (XML) files on a Flutter Widget.

<img src="/../master/assets/flutter_logo.svg?sanitize=true" width="200px" alt="Flutter Logo">

## Getting Started

This is a Dart-native rendering library. Issues/PRs will be raised in Flutter
and flutter/engine as necessary for features that are not good candidates for
Dart implementations (especially if they're impossible to implement without
engine support).  However, not everything that Skia can easily do needs to be
done by Skia; for example, the Path parsing logic here isn't much slower than
doing it in native, and Skia isn't always doing low level GPU accelerated work
where you might think it is (e.g. Dash Paths).

Basic usage (to create an SVG rendering widget from an asset):

```dart
final String assetName = 'assets/image.svg';
final Widget svg = new SvgImage.asset(
  assetName,
  new Size(100.0, 100.0),
);
```

See [main.dart](/../master/lib/main.dart) for a complete sample.

## TODO

This list is roughly ordered.

- [ ] Text support
- [ ] Gradient support (Linear: Mostly done, Radial: partly done)
- [x] Dash path support
- [ ] Dash path with percentage dasharray values
- [ ] More SVG samples to cover more complicated cases
- [ ] Display/visibility support
- [ ] Unit tests
- [ ] Inerhitance of inheritable properties (necessary? preprocess?)
- [ ] Support for minimal CSS/styles?  See also [svgcleaner](https://github.com/razrfalcon/svgcleaner)
- [ ] XLink/ref support (necessary? partially supported for gradients)
- [ ] Glyph support?
- [ ] Markers
- [ ] Filters/effects
- [ ] Android Vector Drawable support (partial so far)
- [ ] Caching of image

## Probably out of scope

- SMIL animations. That just seems crazy.
- Full (any?) CSS support - preprocess your SVGs (perhaps with svgcleaner to get rid of all CSS?)
- Scripting in SVGs
- Foreign elements
- Rendering properties/hints

## SVG sample attribution

SVGs in `/assets/w3samples` pulled from [W3 sample files](https://dev.w3.org/SVG/tools/svgweb/samples/svg-files/)

SVGs in `/assets/deborah_ufw` provided by @deborah-ufw

SVGs in `/assets/simple` are pulled from trivial examples or generated to test
basic functionality - some of them come directly from the SVG 1.1 spec.

SVGs in `/assets/wikimedia` are pulled from [Wikimedia Commons](https://commons.wikimedia.org/wiki/Main_Page)

Android Drawables in `assets/android_vd` are pulled from Android Documentation and examples.

The Flutter Logo created based on the Flutter Logo Widget.

Please submit SVGs this can't render properly (e.g. that don't render here the
way they do in chrome), as long as they're not using anything "probably out of
scope" (above).
## Changelog
# CHANGES

## 0.1.0

Bumping minor version due to internal breaking changes and new support. Works on dev channel as of release (Flutter >= 0.3.6).

- Refactor `DrawableRoot` to support top level style definition.
- Support for dash paths.
- Support for more inherited attributes.
- Initial support for `@style` attributes.
- Support for `rgb()` color attribute/styles.
- Change painting order from stroke first, then fill to fill first, then stroke (matches Chrome rendering of `assets/simple/style_attr.svg`).

## 0.0.2

Initial text support.  Relies on flutter 0.3.6

## 0.0.1

Initial release.  Relies on pre-released master







 
