gridCount method

int gridCount({
  1. int mobile = 2,
  2. int tablet = 3,
  3. int desktop = 4,
})

Calculate grid column count based on device type

Implementation

int gridCount({int mobile = 2, int tablet = 3, int desktop = 4}) {
  if (isDesktop) return desktop;
  if (isTablet) return tablet;
  return mobile;
}