buildSelectViewType method

dynamic buildSelectViewType(
  1. BuildContext context
)

Implementation

buildSelectViewType(BuildContext context) {
  if (CalendarOptions.of(context).toggleViewType) {
    return InkWell(
      customBorder: const CircleBorder(),
      onTap: () {
        // EventCalendar.dateTime = EventCalendar.calendarProvider.getDateTime();
        if (CalendarOptions.of(context).viewType == ViewType.MONTHLY) {
          CalendarOptions.of(context).viewType = ViewType.DAILY;
        } else {
          CalendarOptions.of(context).viewType = ViewType.MONTHLY;
        }
        onViewTypeChanged?.call(CalendarOptions.of(context).viewType);
      },
      child: Padding(
        padding: const EdgeInsets.all(5),
        child: Icon(
          CalendarOptions.of(context).viewType == ViewType.MONTHLY
              ? Icons.calendar_today
              : Icons.calendar_month,
          size: 18,
          color: HeaderOptions.of(context).calendarIconColor,
        ),
      ),
    );
  }
  return const SizedBox();
}