svgAsset static method
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,
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,
);
}