calculateResponsiveWidth method

  1. @protected
double calculateResponsiveWidth(
  1. BuildContext context
)

Determine width of implemented widget.

Implementation

@protected
double calculateResponsiveWidth(BuildContext context) {
  double measuredWidth = MediaQuery.sizeOf(context).width;

  if (measuredWidth >= 1200) {
    measuredWidth /= 2.25;
  } else if (measuredWidth >= 992) {
    measuredWidth /= 2;
  } else if (measuredWidth >= 768) {
    measuredWidth /= 1.5;
  } else if (measuredWidth >= 564) {
    measuredWidth /= 1.125;
  }

  return measuredWidth;
}