calendarBuilder function
A FormFieldBuilder that is the default FastCalendar.builder.
Returns an InputDecorator that contains a CalendarDatePicker on any TargetPlatform.
Implementation
Widget calendarBuilder(FormFieldState<DateTime> field) {
field as FastCalendarState;
final FastCalendarState(:decoration, :didChange, :value, :widget) = field;
final calendar = CalendarDatePicker(
currentDate: widget.currentDate,
firstDate: widget.firstDate,
initialCalendarMode: widget.initialCalendarMode,
initialDate: value ?? DateTime.now(),
lastDate: widget.lastDate,
onDateChanged: didChange,
onDisplayedMonthChanged: widget.onDisplayedMonthChanged,
selectableDayPredicate: widget.selectableDayPredicate,
);
if (widget.showInputDecoration) {
return InputDecorator(
decoration: decoration,
child: calendar,
);
}
return calendar;
}