SfCalendar(
headerHeight: 60,
minDate: DateTime.now().add(Duration(days: 365)),
onTap: (CalendarTapDetails details) {
setState(() {
_current_datetime = details.date;
//pass in the date to this method
//search the hasAvailableSpots array for the date
//if it does, then the clicked date has reservations (not enough to make it a black out) for that day
//get the value from the key weve looked up in the map
//subtract that value from the number or max anglers allowed to update the current number of anglers allowed text on the date screen
String date = DateFormat("[yyyy-MM-dd]").format(_current_datetime);
//return the elemenet tapped
//will set num current anglers allowed to max num anglers allowed minus the number returned from how many spots are left for that property on that day
number_of_current_anglers_allowed_for_date = widget.property.maxNumberOfAnglersAllowed - _getHowManySpotsAreLeftForThatDay(date);
});
},
blackoutDates: black_out_dates,
blackoutDatesTextStyle: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 13,
color: Colors.red,
decoration: TextDecoration.lineThrough),
view: CalendarView.month,
firstDayOfWeek: 7,
dataSource: MeetingDataSource(_getDataSource()),
initialSelectedDate: DateTime.now(),
showNavigationArrow: true,
monthViewSettings: MonthViewSettings(
monthCellStyle: MonthCellStyle(
textStyle: TextStyle(fontWeight: FontWeight.w400, color: Colors.black),
trailingDatesTextStyle: TextStyle(fontWeight: FontWeight.w100, color: Colors.black),
leadingDatesTextStyle: TextStyle(fontWeight: FontWeight.w100, color: Colors.black),
),
navigationDirection: MonthNavigationDirection.vertical,
showTrailingAndLeadingDates: true,
// numberOfWeeksInView:4,
dayFormat: 'EEE',
appointmentDisplayMode: MonthAppointmentDisplayMode.appointment,
),
),
```
SfCalendar(
headerHeight: 60,
// minDate: DateTime.now().subtract(Duration(hours: 12)),
minDate: DateTime.now()),
maxDate: DateTime.now().add(Duration(days: 365)),
onTap: (CalendarTapDetails details) {
setState(() {
_current_datetime = details.date;
String date = DateFormat("[yyyy-MM-dd]").format(_current_datetime);
number_of_current_anglers_allowed_for_date = widget.property.maxNumberOfAnglersAllowed - _getHowManySpotsAreLeftForThatDay(date);
});
},
blackoutDates: black_out_dates,
blackoutDatesTextStyle: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 13,
color: Colors.red,
decoration: TextDecoration.lineThrough),
view: CalendarView.month,
firstDayOfWeek: 7,
dataSource: MeetingDataSource(_getDataSource()),
initialSelectedDate: DateTime.now(),
showNavigationArrow: true,
monthViewSettings: MonthViewSettings(
monthCellStyle: MonthCellStyle(
textStyle: TextStyle(fontWeight: FontWeight.w400, color: Colors.black),
trailingDatesTextStyle: TextStyle(fontWeight: FontWeight.w100, color: Colors.black),
leadingDatesTextStyle: TextStyle(fontWeight: FontWeight.w100, color: Colors.black),
),
navigationDirection: MonthNavigationDirection.vertical,
showTrailingAndLeadingDates: true,
dayFormat: 'EEE',
appointmentDisplayMode: MonthAppointmentDisplayMode.appointment,
),
),