svgFromAsset static method

Widget svgFromAsset({
  1. required String assetPath,
  2. double? width,
  3. double? height,
  4. BoxFit fit = BoxFit.contain,
  5. Color? color,
})

Implementation

static Widget svgFromAsset(
    {required String assetPath, double? width, double? height, BoxFit fit = BoxFit.contain, Color? color}) {
  return SvgPicture.asset(
    assetPath,
    width: width,
    height: height,
    fit: fit,
    colorFilter: color != null ? ColorFilter.mode(color, BlendMode.srcIn) : null,
  );
}