dateTileBuilder method

Widget dateTileBuilder (
  1. DateTime date,
  2. DateTime selectedDate,
  3. int rowIndex
)

Implementation

Widget dateTileBuilder(DateTime date, DateTime selectedDate, int rowIndex) {
  bool isDateOutOfRange = checkOutOfRangeStatus(date);
  String dayName = dayLabels[date.weekday - 1];
  if (widget.dateTileBuilder != null) {
    return Expanded(
      child: SlideFadeTransition(
        delay: 30 + (30 * rowIndex),
        id: "${date.day}${date.month}${date.year}",
        curve: Curves.ease,
        child: InkWell(
          customBorder: CircleBorder(),
          onTap: () => onDateTap(date),
          child: Container(
            child: widget.dateTileBuilder(date, selectedDate, rowIndex, dayName, isDateMarked(date), isDateOutOfRange),
          ),
        ),
      ),
    );
  }

  bool isSelectedDate = date.compareTo(selectedDate) == 0;
  var normalStyle = TextStyle(fontSize: 17, fontWeight: FontWeight.w800, color: isDateOutOfRange ? Colors.black26 : Colors.black54);
  return Expanded(
    child: SlideFadeTransition(
      delay: 30 + (30 * rowIndex),
      id: "${date.day}${date.month}${date.year}",
      curve: Curves.ease,
      child: InkWell(
        onTap: () => onDateTap(date),
        child: Container(
          alignment: Alignment.center,
          padding: EdgeInsets.only(top: 8, left: 5, right: 5, bottom: 5),
          decoration: BoxDecoration(
            color: !isSelectedDate ? Colors.transparent : Colors.blue,
            borderRadius: BorderRadius.all(Radius.circular(60)),
          ),
          child: Column(
            children: [
              Text(
                dayLabels[date.weekday - 1],
                style: TextStyle(
                  fontSize: 14.5,
                  color: !isSelectedDate ? Colors.black : Colors.white,
                ),
              ),
              Text(date.day.toString(), style: !isSelectedDate ? normalStyle : selectedDateStyle),
            ],
          ),
        ),
      ),
    ),
  );
}