WeekView<T extends Object?> constructor

const WeekView<T extends Object?>({
  1. Key? key,
  2. EventController<T>? controller,
  3. EventTileBuilder<T>? eventTileBuilder,
  4. Duration pageTransitionDuration = const Duration(milliseconds: 300),
  5. Curve pageTransitionCurve = Curves.ease,
  6. double heightPerMinute = 1,
  7. double timeLineOffset = 0,
  8. bool showLiveTimeLineInAllDays = false,
  9. bool showVerticalLines = true,
  10. double? width,
  11. DateTime? minDay,
  12. DateTime? maxDay,
  13. DateTime? initialDay,
  14. HourIndicatorSettings? hourIndicatorSettings,
  15. CustomHourLinePainter? hourLinePainter,
  16. HourIndicatorSettings? halfHourIndicatorSettings,
  17. HourIndicatorSettings? quarterHourIndicatorSettings,
  18. DateWidgetBuilder? timeLineBuilder,
  19. double? timeLineWidth,
  20. LiveTimeIndicatorSettings? liveTimeIndicatorSettings,
  21. CalendarPageChangeCallBack? onPageChange,
  22. WeekPageHeaderBuilder? weekPageHeaderBuilder,
  23. EventArranger<T>? eventArranger,
  24. double weekTitleHeight = 50,
  25. DateWidgetBuilder? weekDayBuilder,
  26. WeekNumberBuilder? weekNumberBuilder,
  27. Color backgroundColor = Colors.white,
  28. double scrollOffset = 0.0,
  29. CellTapCallback<T>? onEventTap,
  30. CellTapCallback<T>? onEventLongTap,
  31. DatePressCallback? onDateLongPress,
  32. DateTapCallback? onDateTap,
  33. List<WeekDays> weekDays = WeekDays.values,
  34. bool showWeekends = true,
  35. WeekDays startDay = WeekDays.monday,
  36. MinuteSlotSize minuteSlotSize = MinuteSlotSize.minutes60,
  37. DetectorBuilder<Object?>? weekDetectorBuilder,
  38. StringProvider? headerStringBuilder,
  39. StringProvider? timeLineStringBuilder,
  40. String weekDayStringBuilder(
    1. int
    )?,
  41. String weekDayDateStringBuilder(
    1. int
    )?,
  42. HeaderStyle headerStyle = const HeaderStyle(),
  43. SafeAreaOption safeAreaOption = const SafeAreaOption(),
  44. FullDayEventBuilder<T>? fullDayEventBuilder,
  45. int startHour = 0,
  46. HeaderTitleCallback? onHeaderTitleTap,
  47. bool showHalfHours = false,
  48. bool showQuarterHours = false,
  49. double emulateVerticalOffsetBy = 0,
  50. bool showWeekDayAtBottom = false,
  51. ScrollPhysics? pageViewPhysics,
  52. CellTapCallback<T>? onEventDoubleTap,
  53. int endHour = Constants.hoursADay,
  54. String fullDayHeaderTitle = '',
  55. FullDayHeaderTextConfig? fullDayHeaderTextConfig,
  56. 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);