getSizeByPlatform function

double getSizeByPlatform(
  1. Size size, {
  2. bool shortestSide = false,
})

Gets the Width Size by platform,

This method checks if the ResponsiveWrapper requires the width through the shortestSide. The shortestSide serves when the device are in landscape mode don't be confuse with a tablet screen

Implementation

double getSizeByPlatform(Size size, {bool shortestSide = false}) {
  if (shortestSide) {
    double deviceWidth = size.shortestSide;
    if (PlatformInfo.isWeb) {
      deviceWidth = size.width;
    }

    return deviceWidth;
  }

  return size.width;
}