svgFile function

Widget svgFile(
  1. String imageUri, {
  2. Key? key,
  3. BoxFit? fit,
  4. Color? color,
  5. double? width,
  6. double? height,
  7. Alignment alignment = Alignment.center,
  8. BlendMode? colorBlendMode,
  9. bool excludeFromSemantics = false,
  10. bool matchTextDirection = false,
  11. bool allowDrawingOutsideViewBox = false,
  12. Widget? placeholder,
  13. bool cacheColorFilter = false,
  14. ColorFilter? colorFilter,
})

Create svg image widget

Implementation

Widget svgFile(
  String imageUri, {
  Key? key,
  BoxFit? fit,
  Color? color,
  double? width,
  double? height,
  Alignment alignment = Alignment.center,
  BlendMode? colorBlendMode,
  bool excludeFromSemantics = false,
  bool matchTextDirection = false,
  bool allowDrawingOutsideViewBox = false,
  Widget? placeholder,
  bool cacheColorFilter = false,
  ui.ColorFilter? colorFilter,
}) {
  return SvgPicture.file(
    File(imageUri),
    key: key,
    fit: fit ?? BoxFit.contain,
    width: width,
    height: height,
    alignment: alignment,
    excludeFromSemantics: excludeFromSemantics,
    matchTextDirection: matchTextDirection,
    allowDrawingOutsideViewBox: allowDrawingOutsideViewBox,
    placeholderBuilder:
        placeholder != null ? (BuildContext context) => placeholder : null,
    colorFilter: _getColorFilter(colorFilter, color, colorBlendMode),
  );
}