HorizontalWeekCalendar constructor
HorizontalWeekCalendar({
- Key? key,
- dynamic onDateChange()?,
- dynamic onWeekChange()?,
- Color? activeBackgroundColor,
- HorizontalWeekCalenderController? controller,
- Color? inactiveBackgroundColor,
- Color? disabledBackgroundColor = Colors.grey,
- Color? activeTextColor = Colors.white,
- Color? inactiveTextColor = Colors.white,
- Color? disabledTextColor = Colors.white,
- Color? monthColor,
- WeekStartFrom? weekStartFrom = WeekStartFrom.monday,
- BorderRadiusGeometry? borderRadius = const BorderRadius.all(Radius.circular(8)),
- ScrollPhysics? scrollPhysics = const ClampingScrollPhysics(),
- String? monthFormat,
- required DateTime minDate,
- required DateTime maxDate,
- required DateTime initialDate,
- double? carouselHeight,
- double? itemMarginHorizontal,
- Color? itemBorderColor,
- bool translateNumbers = false,
- String languageCode = 'en',
- List<
String> ? customDayNames, - List<
String> ? customMonthNames, - TextStyle? dayTextStyle,
- TextStyle? dayNameTextStyle,
- TextStyle? monthTextStyle,
- bool showGregorianUnderHijri = false,
- String gregorianDayFormat = 'd',
- TextStyle? gregorianDayTextStyle,
- double gregorianDayOpacity = 0.6,
- bool useHijriDates = false,
- HijriDate? hijriMinDate,
- HijriDate? hijriMaxDate,
- 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();