CustomImage.memory constructor

CustomImage.memory(
  1. Uint8List bytes, {
  2. Key? key,
  3. Size? size,
  4. BoxFit? fit,
  5. double? width,
  6. double? height,
  7. BoxShape? shape,
  8. double? scaleByWidth,
  9. double? scaleByHeight,
  10. Color? color,
  11. GestureTapCallback? onTap,
  12. Curve? curve,
  13. EdgeInsetsGeometry? margin,
  14. EdgeInsetsGeometry? padding,
  15. Animation<double>? opacity,
  16. Rect? centerSlice,
  17. GestureLongPressCallback? onLongPress,
  18. ImageFrameBuilder? frameBuilder,
  19. ImageErrorWidgetBuilder? errorBuilder,
  20. BorderRadius? borderRadius,
  21. double scale = 1.0,
  22. String? semanticLabel,
  23. BlendMode? colorBlendMode,
  24. Color? backgroundColor,
  25. Duration? animationDuration,
  26. bool isAntiAlias = false,
  27. bool gaplessPlayback = false,
  28. bool matchTextDirection = false,
  29. bool excludeFromSemantics = false,
  30. AlignmentGeometry alignment = Alignment.center,
  31. ImageRepeat repeat = ImageRepeat.noRepeat,
  32. 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);