onSvgPicture function

Widget onSvgPicture({
  1. required String imagePath,
  2. double size = 24,
  3. double? width,
  4. double? height,
  5. Color? color,
})

Implementation

Widget onSvgPicture({
  required String imagePath,
  double size = 24,
  double? width,
  double? height,
  Color? color,
}) {
  return SvgPicture.asset(
    imagePath,
    width: width ?? size,
    height: height ?? size,
    colorFilter: color == null
        ? null
        : ColorFilter.mode(
      color,
      BlendMode.srcIn,
    ),
  );
}