SfHijriDateRangePicker constructor
SfHijriDateRangePicker({
- Key? key,
- HijriDatePickerView view = HijriDatePickerView.month,
- DateRangePickerSelectionMode selectionMode = DateRangePickerSelectionMode.single,
- double headerHeight = 40,
- Color? todayHighlightColor,
- Color? backgroundColor,
- HijriDateTime? initialSelectedDate,
- List<
HijriDateTime> ? initialSelectedDates, - HijriDateRange? initialSelectedRange,
- List<
HijriDateRange> ? initialSelectedRanges, - bool toggleDaySelection = false,
- bool enablePastDates = true,
- String confirmText = 'OK',
- String cancelText = 'CANCEL',
- bool showActionButtons = false,
- DateRangePickerSelectionShape selectionShape = DateRangePickerSelectionShape.circle,
- bool enableMultiView = false,
- HijriDatePickerController? controller,
- HijriDatePickerViewChangedCallback? onViewChanged,
- DateRangePickerSelectionChangedCallback? onSelectionChanged,
- VoidCallback? onCancel,
- dynamic onSubmit()?,
- DateRangePickerHeaderStyle headerStyle = const DateRangePickerHeaderStyle(),
- HijriDatePickerYearCellStyle yearCellStyle = const HijriDatePickerYearCellStyle(),
- HijriDatePickerMonthViewSettings monthViewSettings = const HijriDatePickerMonthViewSettings(),
- HijriDateTime? initialDisplayDate,
- HijriDateTime? minDate,
- HijriDateTime? maxDate,
- HijriDatePickerMonthCellStyle monthCellStyle = const HijriDatePickerMonthCellStyle(),
- double viewSpacing = 20,
- double selectionRadius = -1,
- Color? selectionColor,
- Color? startRangeSelectionColor,
- Color? endRangeSelectionColor,
- Color? rangeSelectionColor,
- TextStyle? selectionTextStyle,
- TextStyle? rangeTextStyle,
- String? monthFormat,
- HijriDateRangePickerCellBuilder? cellBuilder,
- bool showTodayButton = false,
- HijriDatePickerSelectableDayPredicate? selectableDayPredicate,
- ExtendableRangeSelectionDirection extendableRangeSelectionDirection = ExtendableRangeSelectionDirection.both,
Creates a material design date range picker.
To restrict the date navigation and selection interaction use minDate
,
maxDate
, the dates beyond this will be restricted.
When the selected dates or ranges change, the widget will call the
onSelectionChanged
callback with new selected dates or ranges.
When the visible view changes, the widget will call the onViewChanged
callback with the current view and the current view visible dates.
Implementation
SfHijriDateRangePicker({
Key? key,
HijriDatePickerView view = HijriDatePickerView.month,
this.selectionMode = DateRangePickerSelectionMode.single,
this.headerHeight = 40,
this.todayHighlightColor,
this.backgroundColor,
HijriDateTime? initialSelectedDate,
List<HijriDateTime>? initialSelectedDates,
HijriDateRange? initialSelectedRange,
List<HijriDateRange>? initialSelectedRanges,
this.toggleDaySelection = false,
this.enablePastDates = true,
this.showNavigationArrow = false,
this.confirmText = 'OK',
this.cancelText = 'CANCEL',
this.showActionButtons = false,
this.selectionShape = DateRangePickerSelectionShape.circle,
this.navigationDirection = DateRangePickerNavigationDirection.horizontal,
this.navigationMode = DateRangePickerNavigationMode.snap,
this.allowViewNavigation = true,
this.enableMultiView = false,
this.controller,
this.onViewChanged,
this.onSelectionChanged,
this.onCancel,
this.onSubmit,
this.headerStyle = const DateRangePickerHeaderStyle(),
this.yearCellStyle = const HijriDatePickerYearCellStyle(),
this.monthViewSettings = const HijriDatePickerMonthViewSettings(),
HijriDateTime? initialDisplayDate,
HijriDateTime? minDate,
HijriDateTime? maxDate,
this.monthCellStyle = const HijriDatePickerMonthCellStyle(),
double viewSpacing = 20,
this.selectionRadius = -1,
this.selectionColor,
this.startRangeSelectionColor,
this.endRangeSelectionColor,
this.rangeSelectionColor,
this.selectionTextStyle,
this.rangeTextStyle,
this.monthFormat,
this.cellBuilder,
this.showTodayButton = false,
this.selectableDayPredicate,
this.extendableRangeSelectionDirection =
ExtendableRangeSelectionDirection.both,
}) : initialSelectedDate =
controller != null && controller.selectedDate != null
? controller.selectedDate
: initialSelectedDate,
initialSelectedDates =
controller != null && controller.selectedDates != null
? controller.selectedDates
: initialSelectedDates,
initialSelectedRange =
controller != null && controller.selectedRange != null
? controller.selectedRange
: initialSelectedRange,
initialSelectedRanges =
controller != null && controller.selectedRanges != null
? controller.selectedRanges
: initialSelectedRanges,
view = controller != null && controller.view != null
? controller.view!
: view,
initialDisplayDate =
controller != null && controller.displayDate != null
? controller.displayDate!
: initialDisplayDate ?? HijriDateTime.now(),
minDate = minDate ?? HijriDateTime(1356, 01, 01),
maxDate = maxDate ?? HijriDateTime(1499, 12, 30),
viewSpacing = enableMultiView ? viewSpacing : 0,
super(key: key);