WeekView<T extends Object?> constructor
const
WeekView<T extends Object?> ({
- Key? key,
- EventController<
T> ? controller, - EventTileBuilder<
T> ? eventTileBuilder, - Duration pageTransitionDuration = const Duration(milliseconds: 300),
- Curve pageTransitionCurve = Curves.ease,
- double heightPerMinute = 1,
- double timeLineOffset = 0,
- bool showLiveTimeLineInAllDays = false,
- bool showVerticalLines = true,
- double? width,
- DateTime? minDay,
- DateTime? maxDay,
- DateTime? initialDay,
- HourIndicatorSettings? hourIndicatorSettings,
- CustomHourLinePainter? hourLinePainter,
- HourIndicatorSettings? halfHourIndicatorSettings,
- HourIndicatorSettings? quarterHourIndicatorSettings,
- DateWidgetBuilder? timeLineBuilder,
- double? timeLineWidth,
- LiveTimeIndicatorSettings? liveTimeIndicatorSettings,
- CalendarPageChangeCallBack? onPageChange,
- WeekPageHeaderBuilder? weekPageHeaderBuilder,
- EventArranger<
T> ? eventArranger, - double weekTitleHeight = 50,
- DateWidgetBuilder? weekDayBuilder,
- WeekNumberBuilder? weekNumberBuilder,
- Color backgroundColor = Colors.white,
- double scrollOffset = 0.0,
- CellTapCallback<
T> ? onEventTap, - CellTapCallback<
T> ? onEventLongTap, - DatePressCallback? onDateLongPress,
- DateTapCallback? onDateTap,
- List<
WeekDays> weekDays = WeekDays.values, - bool showWeekends = true,
- WeekDays startDay = WeekDays.monday,
- MinuteSlotSize minuteSlotSize = MinuteSlotSize.minutes60,
- DetectorBuilder<
Object?> ? weekDetectorBuilder, - StringProvider? headerStringBuilder,
- StringProvider? timeLineStringBuilder,
- String weekDayStringBuilder()?,
- String weekDayDateStringBuilder()?,
- HeaderStyle headerStyle = const HeaderStyle(),
- SafeAreaOption safeAreaOption = const SafeAreaOption(),
- FullDayEventBuilder<
T> ? fullDayEventBuilder, - int startHour = 0,
- HeaderTitleCallback? onHeaderTitleTap,
- bool showHalfHours = false,
- bool showQuarterHours = false,
- double emulateVerticalOffsetBy = 0,
- bool showWeekDayAtBottom = false,
- ScrollPhysics? pageViewPhysics,
- CellTapCallback<
T> ? onEventDoubleTap, - int endHour = Constants.hoursADay,
- String fullDayHeaderTitle = '',
- FullDayHeaderTextConfig? fullDayHeaderTextConfig,
- bool keepScrollOffset = false,
Main widget for week view.
Implementation
const WeekView({
Key? key,
this.controller,
this.eventTileBuilder,
this.pageTransitionDuration = const Duration(milliseconds: 300),
this.pageTransitionCurve = Curves.ease,
this.heightPerMinute = 1,
this.timeLineOffset = 0,
this.showLiveTimeLineInAllDays = false,
this.showVerticalLines = true,
this.width,
this.minDay,
this.maxDay,
this.initialDay,
this.hourIndicatorSettings,
this.hourLinePainter,
this.halfHourIndicatorSettings,
this.quarterHourIndicatorSettings,
this.timeLineBuilder,
this.timeLineWidth,
this.liveTimeIndicatorSettings,
this.onPageChange,
this.weekPageHeaderBuilder,
this.eventArranger,
this.weekTitleHeight = 50,
this.weekDayBuilder,
this.weekNumberBuilder,
this.backgroundColor = Colors.white,
this.scrollOffset = 0.0,
this.onEventTap,
this.onEventLongTap,
this.onDateLongPress,
this.onDateTap,
this.weekDays = WeekDays.values,
this.showWeekends = true,
this.startDay = WeekDays.monday,
this.minuteSlotSize = MinuteSlotSize.minutes60,
this.weekDetectorBuilder,
this.headerStringBuilder,
this.timeLineStringBuilder,
this.weekDayStringBuilder,
this.weekDayDateStringBuilder,
this.headerStyle = const HeaderStyle(),
this.safeAreaOption = const SafeAreaOption(),
this.fullDayEventBuilder,
this.startHour = 0,
this.onHeaderTitleTap,
this.showHalfHours = false,
this.showQuarterHours = false,
this.emulateVerticalOffsetBy = 0,
this.showWeekDayAtBottom = false,
this.pageViewPhysics,
this.onEventDoubleTap,
this.endHour = Constants.hoursADay,
this.fullDayHeaderTitle = '',
this.fullDayHeaderTextConfig,
this.keepScrollOffset = false,
}) : assert(!(onHeaderTitleTap != null && weekPageHeaderBuilder != null),
"can't use [onHeaderTitleTap] & [weekPageHeaderBuilder] simultaneously"),
assert((timeLineOffset) >= 0,
"timeLineOffset must be greater than or equal to 0"),
assert(width == null || width > 0,
"Calendar width must be greater than 0."),
assert(timeLineWidth == null || timeLineWidth > 0,
"Time line width must be greater than 0."),
assert(
heightPerMinute > 0, "Height per minute must be greater than 0."),
assert(
weekDetectorBuilder == null || onDateLongPress == null,
"""If you use [weekPressDetectorBuilder]
do not provide [onDateLongPress]""",
),
assert(
startHour <= 0 || startHour != endHour,
"startHour must be greater than 0 or startHour should not equal to endHour",
),
assert(
endHour <= Constants.hoursADay || endHour < startHour,
"End hour must be less than 24 or startHour must be less than endHour",
),
super(key: key);