FlutterGen / flutter_gen

The Flutter code generator for your assets, fonts, colors, … — Get rid of all String-based APIs.
https://pub.dev/packages/flutter_gen
MIT License
1.44k stars 142 forks source link

[FR]: Support provider(..) for SVG images #418

Open bramp opened 10 months ago

bramp commented 10 months ago

Is there an existing issue for this?

Describe the problem

AssetGenImage supports both image(..) and provider(..) the former returns a Widget and later a ImageProvider. SvgGenImage supports only svg(..) which returns a widget.

Describe the solution

It would be useful if SvgGenImage also supported a loader(..) method that returns a SvgLoader (which is the equivalent to a ImageProvider but for SVGs).

Additional context

The alternative at the moment is to write out, SvgAssetLoader(Assets.name.keyName)) instead of Assets.name.loader()

Code of Conduct

xcc3641 commented 5 months ago

any update?