normalizeBorderSide method

BorderSide normalizeBorderSide(
  1. BorderSide? borderSide,
  2. double width
)

Decreases borderSide to <= width / 2

Implementation

BorderSide normalizeBorderSide(BorderSide? borderSide, double width) {
  if (borderSide == null) {
    return defaultBorderSide;
  }

  double borderWidth;
  if (borderSide.width > width / 2) {
    borderWidth = width / 2.toDouble();
  } else {
    borderWidth = borderSide.width;
  }

  return borderSide.copyWith(width: borderWidth);
}