Calendar constructor

Calendar({
  1. required int limitCount,
  2. required BuildContext parentBuildContext,
  3. required Function closeCalendar,
  4. required Size fullSize,
  5. bool isIcon = false,
  6. required double iconSize,
  7. required double calendarSize,
  8. Offset? datePickerIconPosition,
  9. required String format,
  10. required bool isRange,
  11. List<DateTime>? disabledList,
  12. List<Map<String, DateTime?>>? disabledRangeList,
  13. required List<Map> years,
  14. required Function onSelected,
  15. required Function getSelectedItems,
  16. List<DateTime>? selectedItems = const [],
  17. Map<String, DateTime?>? selectedRangeItem,
  18. required List weekLabelList,
  19. required List monthLabelList,
  20. Key? key,
  21. required bool isYearMonthDropdownReverse,
  22. required int firstWeekDay,
  23. required Color headerColor,
  24. required Color arrowIconAreaColor,
  25. required Color selectedCircleColor,
  26. required Color selectedBetweenAreaColor,
  27. required Color cancelFontColor,
  28. required LinearGradient okButtonColor,
  29. required Color bottomSelectedBorderColor,
  30. required bool isDark,
  31. required String cancelBtnLabel,
  32. 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);
}