Answers for "load svg in imageprovider flutter"

4

Flutter svg

final String assetName = 'assets/image.svg';
final Widget svg = SvgPicture.asset(
  assetName,
  semanticsLabel: 'Acme Logo'
);
Posted by: Guest on June-27-2020
0

load svg in imageprovider flutter

// 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
Posted by: Guest on July-19-2021

Code answers related to "Dart"

Browse Popular Code Answers by Language