getLayout method

  1. @override
SliverGridLayout getLayout(
  1. SliverConstraints constraints
)
override

Returns information about the size and position of the tiles in the grid.

Implementation

@override
SliverGridLayout getLayout(SliverConstraints constraints) {
  final double tileWidth =
      (constraints.crossAxisExtent - 2 * horizontalPadding) /
          DateTime.daysPerWeek;
  return _MonthSliverGridLayout(
    crossAxisCount: DateTime.daysPerWeek + 2,
    dayChildWidth: tileWidth,
    edgeChildWidth: horizontalPadding,
    reverseCrossAxis: axisDirectionIsReversed(constraints.crossAxisDirection),
  );
}