resize method

TransformationData resize(
  1. int? height,
  2. int? width,
  3. TFit? fit,
  4. String? background,
  5. TPosition? position,
  6. TAlgorithm? algorithm,
  7. double? dpr,
)

Method for Basic Transformations

  • height : height (Default: 0)
  • width : width (Default: 0)
  • fit : TFit (Default: cover)
  • background : background (Default: "000000")
  • position : TPosition (Default: center)
  • algorithm : TAlgorithm (Default: lanczos3)
  • dpr : DPR (Default: 1) Returns TransformationData.

Implementation

TransformationData resize(
  int? height,
  int? width,
  TFit? fit,
  String? background,
  TPosition? position,
  TAlgorithm? algorithm,
  double? dpr,
) {
  var values = <String, String>{};
  if (height != null) {
    values['h'] = height.toString();
  }
  if (width != null) {
    values['w'] = width.toString();
  }
  if (fit != null) {
    values['f'] = fit.value;
  }
  if (background != null && background.isNotEmpty) {
    values['b'] = background;
  }
  if (position != null) {
    values['p'] = position.value;
  }
  if (algorithm != null) {
    values['k'] = algorithm.value;
  }
  if (dpr != null) {
    values['dpr'] = dpr.toString();
  }
  return TransformationData(plugin: 't', name: 'resize', values: values);
}