extend method

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

Method for Basic Transformations @param top int (Default: 10) @param left int (Default: 10) @param bottom int (Default: 10) @param right int (Default: 10) @param background String (Default: "000000") @param Border Type Border type? (Default: constant) @param DPR double (Default: 1) @return TransformationData.

Implementation

TransformationData extend(
  int? top,
  int? left,
  int? bottom,
  int? right,
  String? background,
  Bordertype? borderptype,
  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 (borderptype != null) {
    values['bt'] = borderptype.value;
  }

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

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