extend method

TransformationData extend(
  1. int? top,
  2. int? left,
  3. int? bottom,
  4. int? right,
  5. String? background,
  6. TBorderType? borderType,
  7. double? dpr,
)

Method for Basic Transformations

  • top : top (Default: 10)

  • left : left (Default: 10)

  • bottom : bottom (Default: 10)

  • right : right (Default: 10)

  • background : background (Default: "000000")

  • borderType : TBorderType (Default: constant)

  • dpr : DPR (Default: 1)

Returns TransformationData.

Implementation

TransformationData extend(
  int? top,
  int? left,
  int? bottom,
  int? right,
  String? background,
  TBorderType? borderType,
  double? dpr,
) {
  // Determine if there are values to add to the dictionary

  var values = <String, String>{};

  if (top != null) {
    values['t'] = top.toString();
  }

  if (left != null) {
    values['l'] = left.toString();
  }

  if (bottom != null) {
    values['b'] = bottom.toString();
  }

  if (right != null) {
    values['r'] = right.toString();
  }

  if (background != null && background.isNotEmpty) {
    values['bc'] = background;
  }

  if (borderType != null) {
    values['bt'] = borderType.value;
  }

  if (dpr != null) {
    values['dpr'] = dpr.toString();
  }

  return TransformationData(plugin: 't', name: 'extend', values: values);
}