ResponsiveStaggeredGrid.count constructor
ResponsiveStaggeredGrid.count({
- Key? key,
- int crossAxisCount = 120,
- double mainAxisSpacing = 7,
- double crossAxisSpacing = 4,
- AxisDirection? axisDirection = AxisDirection.down,
- EdgeInsetsGeometry? contantPadding,
- required List<
ResponsiveStaggeredGridTile> children,
Implementation
ResponsiveStaggeredGrid.count({
super.key,
int crossAxisCount = 120,
double mainAxisSpacing = 7,
double crossAxisSpacing = 4,
AxisDirection? axisDirection = AxisDirection.down,
EdgeInsetsGeometry? contantPadding,
required List<ResponsiveStaggeredGridTile> children,
}) : super(builder: (LayoutSize layoutSize, BuildContext context,
BoxConstraints boxConstraints) {
children.sort((a, b) =>
a.index.get(layoutSize).compareTo(b.index.get(layoutSize)));
return Padding(
padding: contantPadding ?? EdgeInsets.zero,
child: StaggeredGrid.count(
crossAxisCount: crossAxisCount,
mainAxisSpacing: mainAxisSpacing,
crossAxisSpacing: crossAxisSpacing,
axisDirection: axisDirection,
children:
children.map((child) => child.build(layoutSize)).toList(),
),
);
});