getColumnCount static method
Returns the appropriate column count based on available width.
Implementation
static int getColumnCount(
double width, {
int mobileColumns = 2,
int tabletColumns = 3,
int desktopColumns = 4,
int wideDesktopColumns = 5,
}) {
if (width > 1400) return wideDesktopColumns;
if (width > 1000) return desktopColumns;
if (width > 600) return tabletColumns;
return mobileColumns;
}