copyWith method
Image
copyWith({
- Key? key,
- ImageProvider<
Object> ? image, - Widget frameBuilder(
- BuildContext,
- Widget,
- int?,
- bool,
- Widget loadingBuilder()?,
- Widget 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,
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,
);
}