getMinWidth method

double? getMinWidth({
  1. double? widthParent,
})

Implementation

double? getMinWidth({double? widthParent}) {
  double? width;

  // width
  if (minWidth != null) {
    width = minWidth;
  }

  // percentage width based on parent
  else if (minWidthPercentage != null && widthParent != null) {
    width = ((minWidthPercentage! / 100) * widthParent);
  }

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

  return width;
}