applySideBarWidth method

double applySideBarWidth(
  1. BuildContext context,
  2. double width
)

Returns corrected according to the side bar constraints width value.

Implementation

double applySideBarWidth(BuildContext context, double width) {
  double maxWidth = context.width * sideBarMaxWidthPercentage;

  if (maxWidth < sideBarMinWidth) {
    maxWidth = sideBarMinWidth;
  }

  return width.clamp(sideBarMinWidth, maxWidth);
}