svg method
SvgPicture
svg({
- Key? key,
- bool matchTextDirection = false,
- AssetBundle? bundle,
- @Deprecated('Do not specify package for a generated library asset') String? package = package,
- double? width,
- double? height,
- BoxFit fit = BoxFit.contain,
- AlignmentGeometry alignment = Alignment.center,
- bool allowDrawingOutsideViewBox = false,
- WidgetBuilder? placeholderBuilder,
- String? semanticsLabel,
- bool excludeFromSemantics = false,
- SvgTheme? theme,
- ColorFilter? colorFilter,
- Clip clipBehavior = Clip.hardEdge,
- @deprecated Color? color,
- @deprecated BlendMode colorBlendMode = BlendMode.srcIn,
- @deprecated bool cacheColorFilter = false,
Implementation
SvgPicture svg({
Key? key,
bool matchTextDirection = false,
AssetBundle? bundle,
@Deprecated('Do not specify package for a generated library asset')
String? package = package,
double? width,
double? height,
BoxFit fit = BoxFit.contain,
AlignmentGeometry alignment = Alignment.center,
bool allowDrawingOutsideViewBox = false,
WidgetBuilder? placeholderBuilder,
String? semanticsLabel,
bool excludeFromSemantics = false,
SvgTheme? theme,
ColorFilter? colorFilter,
Clip clipBehavior = Clip.hardEdge,
@deprecated Color? color,
@deprecated BlendMode colorBlendMode = BlendMode.srcIn,
@deprecated bool cacheColorFilter = false,
}) {
final BytesLoader loader;
if (_isVecFormat) {
loader = AssetBytesLoader(
_assetName,
assetBundle: bundle,
packageName: package,
);
} else {
loader = SvgAssetLoader(
_assetName,
assetBundle: bundle,
packageName: package,
theme: theme,
);
}
return SvgPicture(
loader,
key: key,
matchTextDirection: matchTextDirection,
width: width,
height: height,
fit: fit,
alignment: alignment,
allowDrawingOutsideViewBox: allowDrawingOutsideViewBox,
placeholderBuilder: placeholderBuilder,
semanticsLabel: semanticsLabel,
excludeFromSemantics: excludeFromSemantics,
colorFilter: colorFilter ??
(color == null ? null : ColorFilter.mode(color, colorBlendMode)),
clipBehavior: clipBehavior,
cacheColorFilter: cacheColorFilter,
);
}