UCalendar constructor

const UCalendar({
  1. required CalendarDataSource<Object?> dataSource,
  2. Key? key,
  3. CalendarView view = CalendarView.month,
  4. int firstDayOfWeek = 1,
  5. DateTime? initialDisplayDate,
  6. DateTime? initialSelectedDate,
  7. DateTime? minDate,
  8. DateTime? maxDate,
  9. bool showNavigationArrow = true,
  10. bool showCurrentTimeIndicator = true,
  11. bool showWeekNumber = false,
  12. bool useJalali = false,
  13. String jalaliDateFormatter(
    1. Jalali
    )?,
  14. Widget monthCellBuilder(
    1. BuildContext,
    2. MonthCellDetails
    )?,
  15. Widget appointmentBuilder(
    1. BuildContext,
    2. CalendarAppointmentDetails
    )?,
  16. TimeSlotViewSettings timeSlotViewSettings = const TimeSlotViewSettings(),
  17. MonthViewSettings monthViewSettings = const MonthViewSettings(),
  18. ScheduleViewSettings scheduleViewSettings = const ScheduleViewSettings(),
  19. Widget? loadingIndicator,
  20. Widget? errorIndicator,
  21. bool showLoading = false,
  22. BoxConstraints? constraints,
  23. EdgeInsets padding = const EdgeInsets.all(8),
  24. Color? backgroundColor,
  25. CalendarController? controller,
  26. void onViewChanged(
    1. ViewChangedDetails
    )?,
  27. void onTap(
    1. CalendarTapDetails
    )?,
  28. void onLongPress(
    1. CalendarLongPressDetails
    )?,
})

Implementation

const UCalendar({
  required this.dataSource,
  super.key,
  this.view = CalendarView.month,
  this.firstDayOfWeek = 1, // Monday
  this.initialDisplayDate,
  this.initialSelectedDate,
  this.minDate,
  this.maxDate,
  this.showNavigationArrow = true,
  this.showCurrentTimeIndicator = true,
  this.showWeekNumber = false,
  this.useJalali = false, // Toggle Jalali date support
  this.jalaliDateFormatter,
  this.monthCellBuilder,
  this.appointmentBuilder,
  this.timeSlotViewSettings = const TimeSlotViewSettings(),
  this.monthViewSettings = const MonthViewSettings(),
  this.scheduleViewSettings = const ScheduleViewSettings(),
  this.loadingIndicator,
  this.errorIndicator,
  this.showLoading = false,
  this.constraints,
  this.padding = const EdgeInsets.all(8),
  this.backgroundColor,
  this.controller,
  this.onViewChanged,
  this.onTap,
  this.onLongPress,
});