copyWith method

Image copyWith({
  1. Key? key,
  2. ImageProvider<Object>? image,
  3. Widget frameBuilder(
    1. BuildContext,
    2. Widget,
    3. int?,
    4. bool,
    )?,
  4. Widget loadingBuilder(
    1. BuildContext,
    2. Widget,
    3. ImageChunkEvent?
    )?,
  5. Widget errorBuilder(
    1. BuildContext,
    2. Object,
    3. StackTrace?
    )?,
  6. String? semanticLabel,
  7. bool? excludeFromSemantics,
  8. double? width,
  9. double? height,
  10. Color? color,
  11. Animation<double>? opacity,
  12. BlendMode? colorBlendMode,
  13. BoxFit? fit,
  14. AlignmentGeometry? alignment,
  15. ImageRepeat? repeat,
  16. Rect? centerSlice,
  17. bool? matchTextDirection,
  18. bool? gaplessPlayback,
  19. bool? isAntiAlias,
  20. FilterQuality? filterQuality,
})

todo imageScale 默认大小应该和字体一样? todo orientation 符号 icon 的集成 font-awesome? todo 占位符

Implementation

//FadeInImage(
//   height: 200.0, // 根据需要设置
//   width: 300.0, // 根据需要设置
//   fit: BoxFit.cover,
//   placeholder: AssetImage("assets/company_logo.jpg"), //占位图片(本地文件)
//   image: NetworkImage(your_image_url), //网络图片
// ),

Image copyWith({
  Key? key,
  ImageProvider? image,
  Widget Function(BuildContext, Widget, int?, bool)? frameBuilder,
  Widget Function(BuildContext, Widget, ImageChunkEvent?)? loadingBuilder,
  Widget Function(BuildContext, Object, StackTrace?)? errorBuilder,
  String? semanticLabel,
  bool? excludeFromSemantics,
  double? width,
  double? height,
  Color? color,
  Animation<double>? opacity,
  BlendMode? colorBlendMode,
  BoxFit? fit,
  AlignmentGeometry? alignment,
  ImageRepeat? repeat,
  Rect? centerSlice,
  bool? matchTextDirection,
  bool? gaplessPlayback,
  bool? isAntiAlias,
  FilterQuality? filterQuality,
}) {
  return Image(
    key: key ?? this.key,
    image: image ?? this.image,
    frameBuilder: frameBuilder ?? this.frameBuilder,
    loadingBuilder: loadingBuilder ?? this.loadingBuilder,
    errorBuilder: errorBuilder ?? this.errorBuilder,
    semanticLabel: semanticLabel ?? this.semanticLabel,
    excludeFromSemantics: excludeFromSemantics ?? this.excludeFromSemantics,
    width: width ?? this.width,
    height: height ?? this.height,
    color: color ?? this.color,
    opacity: opacity ?? this.opacity,
    colorBlendMode: colorBlendMode ?? this.colorBlendMode,
    fit: fit ?? this.fit,
    alignment: alignment ?? this.alignment,
    repeat: repeat ?? this.repeat,
    centerSlice: centerSlice ?? this.centerSlice,
    matchTextDirection: matchTextDirection ?? this.matchTextDirection,
    gaplessPlayback: gaplessPlayback ?? this.gaplessPlayback,
    isAntiAlias: isAntiAlias ?? this.isAntiAlias,
    filterQuality: filterQuality ?? this.filterQuality,
  );
}