CustomImage.memory constructor
CustomImage.memory(
- Uint8List bytes, {
- Key? key,
- Size? size,
- BoxFit? fit,
- double? width,
- double? height,
- BoxShape? shape,
- double? scaleByWidth,
- double? scaleByHeight,
- Color? color,
- GestureTapCallback? onTap,
- Curve? curve,
- EdgeInsetsGeometry? margin,
- EdgeInsetsGeometry? padding,
- Animation<
double> ? opacity, - Rect? centerSlice,
- GestureLongPressCallback? onLongPress,
- ImageFrameBuilder? frameBuilder,
- ImageErrorWidgetBuilder? errorBuilder,
- BorderRadius? borderRadius,
- double scale = 1.0,
- String? semanticLabel,
- BlendMode? colorBlendMode,
- Color? backgroundColor,
- Duration? animationDuration,
- bool isAntiAlias = false,
- bool gaplessPlayback = false,
- bool matchTextDirection = false,
- bool excludeFromSemantics = false,
- AlignmentGeometry alignment = Alignment.center,
- ImageRepeat repeat = ImageRepeat.noRepeat,
- FilterQuality filterQuality = FilterQuality.medium,
Implementation
CustomImage.memory(
Uint8List bytes, {
super.key,
Size? size,
BoxFit? fit,
double? width,
double? height,
BoxShape? shape,
double? scaleByWidth, // 固定宽度等比缩放
double? scaleByHeight, // 固定高度等比缩放
this.color,
this.onTap,
this.curve,
this.margin,
this.padding,
this.opacity,
this.centerSlice,
this.onLongPress,
this.frameBuilder,
this.errorBuilder,
this.borderRadius,
double scale = 1.0,
this.semanticLabel,
this.colorBlendMode,
this.backgroundColor,
this.animationDuration,
this.isAntiAlias = false,
this.gaplessPlayback = false,
this.matchTextDirection = false,
this.excludeFromSemantics = false,
this.alignment = Alignment.center,
this.repeat = ImageRepeat.noRepeat,
this.filterQuality = FilterQuality.medium,
}) : _image = MemoryImage(bytes, scale: scale),
loadingBuilder = null,
width = _computeScaleWidth(
scaleByWidth, scaleByHeight, width, height, size),
height = _computeScaleHeight(
scaleByWidth, scaleByHeight, width, height, size),
fit = _handleFit(fit, scaleByWidth, scaleByHeight),
shape = _handleShape(shape, scaleByWidth, scaleByHeight);