Calendar constructor
Calendar({
- required int limitCount,
- required BuildContext parentBuildContext,
- required Function closeCalendar,
- required Size fullSize,
- bool isIcon = false,
- required double iconSize,
- required double calendarSize,
- Offset? datePickerIconPosition,
- required String format,
- required bool isRange,
- List<
DateTime> ? disabledList, - List<
Map< ? disabledRangeList,String, DateTime?> > - required List<
Map> years, - required Function onSelected,
- required Function getSelectedItems,
- List<
DateTime> ? selectedItems = const [], - Map<
String, DateTime?> ? selectedRangeItem, - required List weekLabelList,
- required List monthLabelList,
- Key? key,
- required bool isYearMonthDropdownReverse,
- required int firstWeekDay,
- required Color headerColor,
- required Color arrowIconAreaColor,
- required Color selectedCircleColor,
- required Color selectedBetweenAreaColor,
- required Color cancelFontColor,
- required LinearGradient okButtonColor,
- required Color bottomSelectedBorderColor,
- required bool isDark,
- required String cancelBtnLabel,
- required String okBtnLabel,
Implementation
Calendar({
required this.limitCount,
required this.parentBuildContext,
required this.closeCalendar,
required this.fullSize,
this.isIcon = false,
required this.iconSize,
required this.calendarSize,
this.datePickerIconPosition,
required this.format,
required this.isRange,
this.disabledList,
this.disabledRangeList,
required this.years,
required this.onSelected,
required this.getSelectedItems,
this.selectedItems = const [],
this.selectedRangeItem,
required this.weekLabelList,
required this.monthLabelList,
this.key,
required this.isYearMonthDropdownReverse,
required this.firstWeekDay,
required this.headerColor,
required this.arrowIconAreaColor,
required this.selectedCircleColor,
required this.selectedBetweenAreaColor,
required this.cancelFontColor,
required this.okButtonColor,
required this.bottomSelectedBorderColor,
required this.isDark,
required this.cancelBtnLabel,
required this.okBtnLabel,
}) {
List<double> monthLabelWidthList = [];
for (var element in monthLabelList) {
monthLabelWidthList.add(element['label']
.toString()
.getTextWidth(
TextStyle(
fontSize: datePickerIconPosition != null
? calendarSize * 0.04
: iconSize * 0.04,
fontWeight: FontWeight.bold),
parentBuildContext)
.width);
}
maxMonthDropdownWidth = monthLabelWidthList.reduce(max);
}