getMobileLayoutSize function

MobileLayoutSize getMobileLayoutSize({
  1. required double width,
  2. ScreenSizeSettings sizes = const ScreenSizeSettings.portrait(),
})

Gets type of mobile layout size

sizes defaults to ScreenSizeSettings.portrait()

width must not be null

Implementation

MobileLayoutSize getMobileLayoutSize({
  required double width,
  ScreenSizeSettings sizes = const ScreenSizeSettings.portrait(),
}) {
  MobileLayoutSize result;

  if (width > sizes.watch && width <= sizes.smallMobile) {
    result = MobileLayoutSize.small;
  } else if (width > sizes.smallMobile && width <= sizes.mediumMobile) {
    result = MobileLayoutSize.medium;
  } else {
    result = MobileLayoutSize.large;
  }

  return result;
}