UCalendar constructor
const
UCalendar({
- required CalendarDataSource<
Object?> dataSource, - Key? key,
- CalendarView view = CalendarView.month,
- int firstDayOfWeek = 1,
- DateTime? initialDisplayDate,
- DateTime? initialSelectedDate,
- DateTime? minDate,
- DateTime? maxDate,
- bool showCurrentTimeIndicator = true,
- bool showWeekNumber = false,
- bool useJalali = false,
- String jalaliDateFormatter()?,
- Widget monthCellBuilder()?,
- Widget appointmentBuilder()?,
- TimeSlotViewSettings timeSlotViewSettings = const TimeSlotViewSettings(),
- MonthViewSettings monthViewSettings = const MonthViewSettings(),
- ScheduleViewSettings scheduleViewSettings = const ScheduleViewSettings(),
- Widget? loadingIndicator,
- Widget? errorIndicator,
- bool showLoading = false,
- BoxConstraints? constraints,
- EdgeInsets padding = const EdgeInsets.all(8),
- Color? backgroundColor,
- CalendarController? controller,
- void onViewChanged()?,
- void onTap()?,
- void onLongPress()?,
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,
});