copyWith method

  1. @override
ImageSpec copyWith({
  1. ImageProvider<Object>? image,
  2. double? width,
  3. double? height,
  4. Color? color,
  5. ImageRepeat? repeat,
  6. BoxFit? fit,
  7. AlignmentGeometry? alignment,
  8. Rect? centerSlice,
  9. FilterQuality? filterQuality,
  10. BlendMode? colorBlendMode,
  11. AnimatedData? animated,
})
override

Creates a copy of this spec with the given fields replaced by the non-null parameter values.

Implementation

@override
ImageSpec copyWith({
  ImageProvider? image,
  double? width,
  double? height,
  Color? color,
  ImageRepeat? repeat,
  BoxFit? fit,
  AlignmentGeometry? alignment,
  Rect? centerSlice,
  FilterQuality? filterQuality,
  BlendMode? colorBlendMode,
  AnimatedData? animated,
}) {
  return ImageSpec(
    width: width ?? this.width,
    height: height ?? this.height,
    color: color ?? this.color,
    repeat: repeat ?? this.repeat,
    fit: fit ?? this.fit,
    alignment: alignment ?? this.alignment,
    centerSlice: centerSlice ?? this.centerSlice,
    filterQuality: filterQuality ?? this.filterQuality,
    colorBlendMode: colorBlendMode ?? this.colorBlendMode,
    animated: animated ?? this.animated,
  );
}