getMaxHeight method

double? getMaxHeight({
  1. double? heightParent,
})

Implementation

double? getMaxHeight({double? heightParent}) {
  double? height;

  // height
  if (maxHeight != null) {
    height = maxHeight;
  }

  // percentage height based on parent
  else if (maxHeightPercentage != null && heightParent != null) {
    height = ((maxHeightPercentage! / 100) * heightParent);
  }

  // cannot be negative
  if (height != null && height.isNegative) {
    height = 0;
  }

  return height;
}