HorizontalWeekCalendar constructor

HorizontalWeekCalendar({
  1. Key? key,
  2. dynamic onDateChange(
    1. DateTime
    )?,
  3. dynamic onWeekChange(
    1. List<DateTime>
    )?,
  4. Color? activeBackgroundColor,
  5. HorizontalWeekCalenderController? controller,
  6. Color? inactiveBackgroundColor,
  7. Color? disabledBackgroundColor = Colors.grey,
  8. Color? activeTextColor = Colors.white,
  9. Color? inactiveTextColor = Colors.white,
  10. Color? disabledTextColor = Colors.white,
  11. Color? activeNavigatorColor,
  12. Color? inactiveNavigatorColor,
  13. Color? monthColor,
  14. WeekStartFrom? weekStartFrom = WeekStartFrom.monday,
  15. BorderRadiusGeometry? borderRadius = const BorderRadius.all(Radius.circular(8)),
  16. ScrollPhysics? scrollPhysics = const ClampingScrollPhysics(),
  17. bool? showNavigationButtons = true,
  18. String? monthFormat,
  19. required DateTime minDate,
  20. required DateTime maxDate,
  21. required DateTime initialDate,
  22. bool showTopNavbar = true,
  23. double? carouselHeight,
  24. double? itemMarginHorizontal,
  25. Color? itemBorderColor,
  26. bool translateNumbers = false,
  27. String languageCode = 'en',
  28. List<String>? customDayNames,
  29. List<String>? customMonthNames,
  30. TextStyle? dayTextStyle,
  31. TextStyle? dayNameTextStyle,
  32. TextStyle? monthTextStyle,
  33. bool showGregorianUnderHijri = false,
  34. String gregorianDayFormat = 'd',
  35. TextStyle? gregorianDayTextStyle,
  36. double gregorianDayOpacity = 0.6,
  37. bool useHijriDates = false,
  38. HijriDate? hijriMinDate,
  39. HijriDate? hijriMaxDate,
  40. HijriDate? hijriInitialDate,
})

controll the date jump

jumpPre()
Jump scoll calender to left

jumpNext()
Jump calender to right date

Implementation

HorizontalWeekCalendar({
  super.key,
  this.onDateChange,
  this.onWeekChange,
  this.activeBackgroundColor,
  this.controller,
  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 = const BorderRadius.all(Radius.circular(8)),
  this.scrollPhysics = const ClampingScrollPhysics(),
  this.showNavigationButtons = true,
  this.monthFormat,
  required this.minDate,
  required this.maxDate,
  required this.initialDate,
  this.showTopNavbar = true,
  this.carouselHeight,
  this.itemMarginHorizontal,
  this.itemBorderColor,
  this.translateNumbers = false,
  this.languageCode = 'en',
  this.customDayNames,
  this.customMonthNames,
  this.dayTextStyle,
  this.dayNameTextStyle,
  this.monthTextStyle,
  this.showGregorianUnderHijri = false,
  this.gregorianDayFormat = 'd',
  this.gregorianDayTextStyle,
  this.gregorianDayOpacity = 0.6,
  this.useHijriDates = false,
  this.hijriMinDate,
  this.hijriMaxDate,
  this.hijriInitialDate,
})  :
      // Gregorian calendar validations
      assert(minDate.isBefore(maxDate)),
      assert(
          minDate.isBefore(initialDate) && (initialDate).isBefore(maxDate)),
      // Hijri calendar validations
      assert(
          !useHijriDates ||
              (hijriMinDate != null &&
                  hijriMaxDate != null &&
                  hijriInitialDate != null),
          'When useHijriDates is true, hijriMinDate, hijriMaxDate, and hijriInitialDate must be provided'),
      super();