The readme mentions drawing "Some" vector drawables.
If there is partial support for that can we add documentation on how to use it?
Our use case for example, we have some relatively simple vectors (with just a
You mention it only supports PoC vectors, I'm not sure what that means but figured it may well cover this use case.
This is for Android Vector Drawables right?
I did a quick implementation that handles very simple files in the avd folder. It needs work.
One challenge is that AVDs frequently seem to be composed of other files. It doesn't really seem ideal to try to resolve all of those dependencies at runtime, load additional files, and then still have to process the content.
I've had a few requests like this but no oneseems to want it badly enough that it needs more attention. I'd be happy to review PRs that implement more of the AVD spec though!
Thanks for the response Dan!
I'm not super following some of this, like where a "avd" folder would be and stuff. (Hah, looking now he just means he put the code in the lib/avd folder. For whatever reason, I assumed the code "handles very simple files if put in the avd folder" wanted to explain my dumbness a bit)
In our case, we litterally have like 2 dozen simple drawables that look something like this:
<vector android:height="268dp" android:viewportHeight="267.794"
android:viewportWidth="198.38" android:width="198dp" xmlns:android="http://schemas.android.com/apk/res/android">
<path android:fillColor="#dedede" android:pathData="SOME PATH"/>
</vector>
It seems like if you have like any support for AVD's put into the library it's likely it could render something as simple as that? Might be cleaner then converting all of them to SVG's.
So yeah, if there is a way to render simple AVD's like that it seems like some clear documentation would be easy/beneficial to everyone - if it's in a pretty bad state we can just consider this issue closed for now.
You should be able to just do something like this:
import "package:flutter_svg/avd.dart"
...
AvdPicture.asset('my_avd.xml');
AvdPicture.string('''<vector ...></vector>''');
Oh yeah, I actually just stumbled across that myself as well when I saw there was an avd.dart. Thanks Dan.
@dnfield I might see if I can track it down more later but with a very simple android path it throws an exception:
AvdPicture.string('<?xml version="1.0" encoding="utf-8"?><vector xmlns:android="http://schemas.android.com/apk/res/android" android:width="16dp" android:height="16dp" android:viewportWidth="16" android:viewportHeight="16"> <path android:fillColor="#dedede" android:pathData="M 8 8 L 12 8 L 12 0 L 0 0 L 8 8" /></vector>');
The exception I get is the following:
"type 'PictureInfo' is not a subtype of type 'Future<PictureInfo>'"
In "package:flutter_svg/avd.dart" line 144 column 11.
This should be fixed on master now - that method was getting confused because it wasn't async and didn't return a Future.
This should be fixed on master now
Just bit me too. How soon do you think you can cut a release with the fix?
Published as version 0.12.2
Most helpful comment
Published as version 0.12.2