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,
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/iconforest_bytesize/assets/images/bytesize/',
// local library
// 'assets/images/bytesize/',
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,
);
}