grid static method
CarpetStyle
grid(
- BuildContext context, {
- double size = 250,
- int wCells = 1,
- int hCells = 1,
- int quiltHeightMultiplier = 1,
Generates a grid-style CarpetStyle for uniform, multi-cell layouts.
Configures fixed cell dimensions across width and height, with responsive tile sizing based on screen width. Integrates with Carpet for gallery or dashboard views, disabling scalar tiles for strict grid alignment. Use in CardSection or Tabs for structured content presentation.
Implementation
static CarpetStyle grid(BuildContext context,
{double size = 250,
int wCells = 1,
int hCells = 1,
int quiltHeightMultiplier = 1}) {
return CarpetStyle().gridView(
tileSize: ((size * pow(MediaQuery.of(context).size.width / 2000, 0.2)) /
wCells)
.round(),
height: hCells,
quiltHeightMultiplier: quiltHeightMultiplier,
width: wCells);
}