calculatePadding method

void calculatePadding()

Implementation

void calculatePadding() {
  final actualX = x ?? xFunction?.call() ?? 0;
  final actualY = y ?? yFunction?.call() ?? 0;
  final actualWidth =
      width ?? widthFunction?.call() ?? childBuild?.bounds.x ?? 0;
  final actualHeight =
      height ?? heightFunction?.call() ?? childBuild?.bounds.y ?? 0;
  if (isCentered) {
    padding = EdgeInsets.fromLTRB(
      actualX - actualWidth / 2,
      actualY - actualHeight / 2,
      bounds.x - (actualX + actualWidth / 2),
      bounds.y - (actualY + actualHeight / 2),
    );
  } else {
    padding = EdgeInsets.fromLTRB(
      actualX,
      actualY,
      bounds.x - (actualX + actualWidth),
      bounds.y - (actualY + actualHeight),
    );
  }
}