calculatedSize function

Size calculatedSize(
  1. Size image
)

Implementation

Size calculatedSize(Size image) {
  double width = image.width.toDouble();
  double height = image.height.toDouble();
  if (width > 240) {
    width = 240;
  }
  double calculateHeight = calculateNewHeight(
      image.width.toDouble(), image.height.toDouble(), width);
  if (calculateHeight > 240) {
    calculateHeight = 240;
    double calculateWidth = calculateNewWidth(
        image.width.toDouble(), image.height.toDouble(), calculateHeight);
    return Size(calculateWidth, calculateHeight);
  } else {
    return Size(width, calculateHeight);
  }
}