I want to use SVG/Vector Graphics in my Flutter Application. is there any library or Dart Package which can be used?
Asked
Active
Viewed 1.3k times
2 Answers
6
steps
- use this plugin flutter_svg https://pub.dartlang.org/packages/flutter_svg
- adding images to Assets
- import and adding this widget
SvgPicture.asset('assets/images/Defect/icon${values[index].childId}.svg', height: 50.0,),

E.Benedos
- 1,585
- 14
- 41
2
To display the SVG from Assets in Flutter.
- Add the following code in pubspec.yaml file under dependencies
flutter_svg: ^0.22.0
- Add the following code in the header of your main.dart
import 'package:flutter_svg/flutter_svg.dart';
- Assign the SVG to one variable like
final String assetName = 'assets/images/avatar.svg';
new SvgPicture.Asset(assetName, height:100, width:100,)

Mahmood Sanjrani
- 108
- 3
- 19

Balaji Ks
- 342
- 3
- 9
-
2Sadly flutter_svg is extremly limited. Most SVG taken out of the box will actually not work. – MappaM Mar 08 '21 at 09:26