applyPaddingInOffset method

Offset applyPaddingInOffset(
  1. Offset offset
)

Implementation

Offset applyPaddingInOffset(Offset offset) {
  Offset newOffset = offset.copyWith();
  if (paddingTop != null) {
    newOffset = newOffset.copyWith(dy: newOffset.dy + paddingTop!);
  }
  if (paddingBottom != null) {
    newOffset = newOffset.copyWith(dy: newOffset.dy - paddingBottom!);
  }
  if (paddingLeft != null) {
    newOffset = newOffset.copyWith(dx: newOffset.dx + paddingLeft!);
  }
  if (paddingRight != null) {
    newOffset = newOffset.copyWith(dx: newOffset.dx - paddingRight!);
  }

  return newOffset;
}