Flutter Svg
final String assetName = 'assets/image.svg';
final Widget svg = SvgPicture.asset(
assetName,
semanticsLabel: 'Acme Logo'
);
S.Mahdi
final String assetName = 'assets/image.svg';
final Widget svg = SvgPicture.asset(
assetName,
semanticsLabel: 'Acme Logo'
);
// ImageProvider does not support SvgPicture.asset()
// the following code will throw an error because flutter_svg package is not compatible with image provider
Container(
decoration: BoxDecoration(
image: DecorationImage(
image: SvgPicture.asset(''),
),
),
),
// instead, you can use flutter_svg_provider package. It suppports image provider