-4

I'm developing an UI components library and I want to use some SVG icons, I added them to the package's pubspec.yaml like this :

flutter:
  assets:
    - assets/
    - assets/svg/

And I tried to load the SVG file like this, to no avail:

 const String backArrow = 'assets/svg/back_arrow.svg';

I got an exception:

FlutterError (Unable to load asset: assets/svg/back_arrow.svg)

How can I properly load those assets in my package?

João Pedro
  • 794
  • 2
  • 12
  • 28

1 Answers1

0

Try this package from pub.dev: flutter_svg

dKen
  • 3,078
  • 1
  • 28
  • 37
sun sreng
  • 587
  • 6
  • 7