svgAsset static method

Widget svgAsset(
  1. String assetName, {
  2. Key? key,
  3. bool matchTextDirection = false,
  4. AssetBundle? bundle,
  5. String? package,
  6. double? width,
  7. double? height,
  8. BoxFit fit = BoxFit.contain,
  9. AlignmentGeometry alignment = Alignment.center,
  10. bool allowDrawingOutsideViewBox = false,
  11. WidgetBuilder? placeholderBuilder,
  12. Color? color,
  13. BlendMode colorBlendMode = BlendMode.srcIn,
  14. String? semanticsLabel,
  15. bool excludeFromSemantics = false,
  16. Clip clipBehavior = Clip.hardEdge,
  17. bool cacheColorFilter = false,
  18. SvgTheme? theme,
})

build widget for svg asset

Implementation

static Widget svgAsset(String assetName,
    {Key? key,
    bool matchTextDirection = false,
    AssetBundle? bundle,
    String? package,
    double? width,
    double? height,
    BoxFit fit = BoxFit.contain,
    AlignmentGeometry alignment = Alignment.center,
    bool allowDrawingOutsideViewBox = false,
    WidgetBuilder? placeholderBuilder,
    Color? color,
    BlendMode colorBlendMode = BlendMode.srcIn,
    String? semanticsLabel,
    bool excludeFromSemantics = false,
    Clip clipBehavior = Clip.hardEdge,
    bool cacheColorFilter = false,
    SvgTheme? theme}) {
  final path = p.join(
    // external library
    'packages/icony/assets/images/icony_gameicons/',
    // local library
    // 'assets/images/icony_gameicons/',
    assetName,
  );
  return SvgPicture.asset(
    path,
    key: key,
    matchTextDirection: matchTextDirection,
    bundle: bundle,
    package: package,
    width: width,
    height: height,
    fit: fit,
    alignment: alignment,
    allowDrawingOutsideViewBox: allowDrawingOutsideViewBox,
    placeholderBuilder: placeholderBuilder,
    color: color,
    colorBlendMode: colorBlendMode,
    semanticsLabel: semanticsLabel,
    excludeFromSemantics: excludeFromSemantics,
    clipBehavior: clipBehavior,
    cacheColorFilter: cacheColorFilter,
    theme: theme,
  );
}