copyWith method

SizeConstraint copyWith({
  1. int? minWidth,
  2. int? maxWidth,
  3. int? minHeight,
  4. int? maxHeight,
  5. bool? ignoreSize,
})

Returns a new SizeConstraint object with the same properties as this one, but with any specified properties replaced.

If any parameter is not provided, its value will be taken from this object.

  • minWidth: An optional parameter. Specifies the minimum width for queried images.
  • maxWidth: An optional parameter. Specifies the maximum width for queried images.
  • minHeight: An optional parameter. Specifies the minimum height for queried images.
  • maxHeight: An optional parameter. Specifies the maximum height for queried images.
  • ignoreSize: An optional parameter. If set to true, all image sizes will be returned.

Implementation

SizeConstraint copyWith({
  int? minWidth,
  int? maxWidth,
  int? minHeight,
  int? maxHeight,
  bool? ignoreSize,
}) {
  minWidth ??= this.minWidth;
  maxWidth ??= this.maxHeight;
  minHeight ??= this.minHeight;
  maxHeight ??= this.maxHeight;
  ignoreSize ??= this.ignoreSize;

  return SizeConstraint(
    minWidth: minWidth,
    maxWidth: maxWidth,
    minHeight: minHeight,
    maxHeight: maxHeight,
    ignoreSize: ignoreSize,
  );
}