attach method

  1. @override
Widget? attach(
  1. BuildContext context,
  2. CalendarViewController controller
)
override

Implementation

@override
Widget? attach(BuildContext context, CalendarViewController controller) {
  return RawCalendarView(
    currentDay: controller.currentDay,
    focusedDay: controller.focusedDay,
    firstDay: controller.firstDay,
    lastDay: controller.lastDay,
    headerStyle: const HeaderStyle(
      formatButtonVisible: false,
    ),
    onDaySelected: controller.onNotifyWithDate,
    availableGestures: AvailableGestures.all,
    selectedDayPredicate: (day) => isSameDay(day, controller.currentDay),
    calendarStyle: CalendarStyle(
      selectedDecoration: BoxDecoration(
        color: context.primaryColor,
        shape: BoxShape.circle,
      ),
      todayDecoration: BoxDecoration(
        color: context.primaryColor.withOpacity(0.5),
        shape: BoxShape.circle,
      ),
    ),
  );
}