SfHijriDateRangePicker constructor

SfHijriDateRangePicker({
  1. Key? key,
  2. HijriDatePickerView view = HijriDatePickerView.month,
  3. DateRangePickerSelectionMode selectionMode = DateRangePickerSelectionMode.single,
  4. double headerHeight = 40,
  5. Color? todayHighlightColor,
  6. Color? backgroundColor,
  7. HijriDateTime? initialSelectedDate,
  8. List<HijriDateTime>? initialSelectedDates,
  9. HijriDateRange? initialSelectedRange,
  10. List<HijriDateRange>? initialSelectedRanges,
  11. bool toggleDaySelection = false,
  12. bool enablePastDates = true,
  13. bool showNavigationArrow = false,
  14. String confirmText = 'OK',
  15. String cancelText = 'CANCEL',
  16. bool showActionButtons = false,
  17. DateRangePickerSelectionShape selectionShape = DateRangePickerSelectionShape.circle,
  18. DateRangePickerNavigationDirection navigationDirection = DateRangePickerNavigationDirection.horizontal,
  19. DateRangePickerNavigationMode navigationMode = DateRangePickerNavigationMode.snap,
  20. bool allowViewNavigation = true,
  21. bool enableMultiView = false,
  22. HijriDatePickerController? controller,
  23. HijriDatePickerViewChangedCallback? onViewChanged,
  24. DateRangePickerSelectionChangedCallback? onSelectionChanged,
  25. VoidCallback? onCancel,
  26. dynamic onSubmit(
    1. Object?
    )?,
  27. DateRangePickerHeaderStyle headerStyle = const DateRangePickerHeaderStyle(),
  28. HijriDatePickerYearCellStyle yearCellStyle = const HijriDatePickerYearCellStyle(),
  29. HijriDatePickerMonthViewSettings monthViewSettings = const HijriDatePickerMonthViewSettings(),
  30. HijriDateTime? initialDisplayDate,
  31. HijriDateTime? minDate,
  32. HijriDateTime? maxDate,
  33. HijriDatePickerMonthCellStyle monthCellStyle = const HijriDatePickerMonthCellStyle(),
  34. double viewSpacing = 20,
  35. double selectionRadius = -1,
  36. Color? selectionColor,
  37. Color? startRangeSelectionColor,
  38. Color? endRangeSelectionColor,
  39. Color? rangeSelectionColor,
  40. TextStyle? selectionTextStyle,
  41. TextStyle? rangeTextStyle,
  42. String? monthFormat,
  43. HijriDateRangePickerCellBuilder? cellBuilder,
  44. bool showTodayButton = false,
  45. HijriDatePickerSelectableDayPredicate? selectableDayPredicate,
  46. 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);