HorizontalWeekCalendar constructor

HorizontalWeekCalendar({
  1. Key? key,
  2. dynamic onDateChange(
    1. DateTime
    )?,
  3. dynamic onWeekChange(
    1. List<DateTime>
    )?,
  4. Color? activeBackgroundColor,
  5. Color? inactiveBackgroundColor,
  6. Color? disabledBackgroundColor = Colors.grey,
  7. Color? activeTextColor = Colors.white,
  8. Color? inactiveTextColor = Colors.white,
  9. Color? disabledTextColor = Colors.white,
  10. Color? activeNavigatorColor,
  11. Color? inactiveNavigatorColor,
  12. Color? monthColor,
  13. WeekStartFrom? weekStartFrom = WeekStartFrom.monday,
  14. BorderRadiusGeometry? borderRadius,
  15. ScrollPhysics? scrollPhysics = const ClampingScrollPhysics(),
  16. bool? showNavigationButtons = true,
  17. String? monthFormat,
  18. required DateTime minDate,
  19. required DateTime maxDate,
  20. required DateTime initialDate,
  21. bool showTopNavbar = true,
})

Creates a HorizontalWeekCalendar widget.

Assertions:

  • minDate must be before maxDate
  • initialDate must be between minDate and maxDate

Implementation

HorizontalWeekCalendar({
  super.key,
  this.onDateChange,
  this.onWeekChange,
  this.activeBackgroundColor,
  this.inactiveBackgroundColor,
  this.disabledBackgroundColor = Colors.grey,
  this.activeTextColor = Colors.white,
  this.inactiveTextColor = Colors.white,
  this.disabledTextColor = Colors.white,
  this.activeNavigatorColor,
  this.inactiveNavigatorColor,
  this.monthColor,
  this.weekStartFrom = WeekStartFrom.monday,
  this.borderRadius,
  this.scrollPhysics = const ClampingScrollPhysics(),
  this.showNavigationButtons = true,
  this.monthFormat,
  required this.minDate,
  required this.maxDate,
  required this.initialDate,
  this.showTopNavbar = true,
})  :
      // assert(minDate != null && maxDate != null),
      assert(minDate.isBefore(maxDate)),
      assert(
          minDate.isBefore(initialDate) && (initialDate).isBefore(maxDate)),
      super();