SfHijriDateRangePicker class Null safety

A material design date range picker.

A SfHijriDateRangePicker can be used to select single date, multiple dates, and range of dates in month view alone and provided month, year and decade view options to quickly navigate to the desired date, it supports minDate,maxDate and disabled date to restrict the date selection.

Default displays the HijriDatePickerView.month view with single selection mode.

Set the view property with the desired HijriDatePickerView to navigate to different views, or tap the SfHijriDateRangePicker header to navigate to the next different view in the hierarchy.

The hierarchy of views is followed by

To change the selection mode, set the selectionMode property with the DateRangePickerSelectionMode option.

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.

Requires one of its ancestors to be a Material widget. This is typically provided by a Scaffold widget.

Requires one of its ancestors to be a MediaQuery widget. Typically, a MediaQuery widget is introduced by the MaterialApp or WidgetsApp widget at the top of your application widget tree.

Note: The picker widget allows to customize its appearance using SfDateRangePickerThemeData available from SfDateRangePickerTheme widget or the SfTheme.dateRangePickerTheme widget. It can also be customized using the properties available in DateRangePickerHeaderStyle, DateRangePickerViewHeaderStyle, HijriDatePickerMonthViewSettings, HijriDatePickerYearCellStyle, HijriDatePickerMonthCellStyle

See also:

class MyApp extends StatefulWidget {
 MyAppState createState() => MyAppState();

class MyAppState extends State<MyApp> {
 Widget build(BuildContext context) {
   return MaterialApp(
     home: Scaffold(
       body: SfHijriDateRangePicker(
         view: HijriDatePickerView.month,
         selectionMode: DateRangePickerSelectionMode.range,
         minDate: HijriDateTime(1440, 02, 05),
         maxDate: HijriDateTime(1450, 12, 06),
         onSelectionChanged: (DateRangePickerSelectionChangedArgs args) {
           final dynamic value = args.value;
         onViewChanged: (HijriDatePickerViewChangedArgs args) {
           final HijriDateRange visibleDates = args.visibleDateRange;
           final HijriDatePickerView view = args.view;


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, bool showNavigationArrow = false, String confirmText = 'OK', String cancelText = 'CANCEL', bool showActionButtons = false, DateRangePickerSelectionShape selectionShape = DateRangePickerSelectionShape.circle, DateRangePickerNavigationDirection navigationDirection = DateRangePickerNavigationDirection.horizontal, DateRangePickerNavigationMode navigationMode = DateRangePickerNavigationMode.snap, bool allowViewNavigation = true, bool enableMultiView = false, HijriDatePickerController? controller, HijriDatePickerViewChangedCallback? onViewChanged, DateRangePickerSelectionChangedCallback? onSelectionChanged, VoidCallback? onCancel, dynamic onSubmit(Object)?, 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})
Creates a material design date range picker. [...]


allowViewNavigation bool
Used to enable or disable the view switching between HijriDatePickerView through interaction in the SfHijriDateRangePicker header. [...]
backgroundColor Color?
The color to fill the background of the SfHijriDateRangePicker. [...]
cancelText String
Text that displays on the cancel button. [...]
cellBuilder HijriDateRangePickerCellBuilder?
A builder that builds a widget that replaces the cell in a month, year, and decade views. The month cell, year cell, decade cell, was differentiated by picker view. [...]
confirmText String
Text that displays on the confirm button. [...]
controller HijriDatePickerController?
An object that used for programmatic date navigation, date and range selection and view switching in SfHijriDateRangePicker. [...]
enableMultiView bool
Used to enable or disable showing multiple views [...]
enablePastDates bool
Allows to disable the dates falls before the today date in SfHijriDateRangePicker. [...]
endRangeSelectionColor Color?
The color which fills the SfHijriDateRangePicker selection view of the range end date. [...]
hashCode int
The hash code for this object. [...]
@nonVirtual, read-only, inherited
headerHeight double
The height for header view to layout within this in SfHijriDateRangePicker. [...]
headerStyle DateRangePickerHeaderStyle
Sets the style for customizing the SfHijriDateRangePicker header view. [...]
initialDisplayDate HijriDateTime
The initial date to show on the SfHijriDateRangePicker [...]
initialSelectedDate HijriDateTime?
The date to initially select on the SfHijriDateRangePicker. [...]
initialSelectedDates List<HijriDateTime>?
The collection of dates to initially select on the SfHijriDateRangePicker. [...]
initialSelectedRange HijriDateRange?
The date range to initially select on the SfHijriDateRangePicker. [...]
initialSelectedRanges List<HijriDateRange>?
The date ranges to initially select on the SfHijriDateRangePicker. [...]
key Key?
Controls how one widget replaces another widget in the tree. [...]
final, inherited
maxDate HijriDateTime
The maximum date as much as the SfHijriDateRangePicker will navigate. [...]
minDate HijriDateTime
The minimum date as much as the SfHijriDateRangePicker will navigate. [...]
monthCellStyle HijriDatePickerMonthCellStyle
Options to customize the month cells of the SfHijriDateRangePicker. [...]
monthFormat String?
Allows to change the month text format in SfHijriDateRangePicker. [...]
monthViewSettings HijriDatePickerMonthViewSettings
Options to customize the month view of the SfHijriDateRangePicker. [...]
The direction that SfHijriDateRangePicker is navigating in. [...]
Defines the view navigation mode based on its navigationDirection for SfHijriDateRangePicker. [...]
onCancel VoidCallback?
Called whenever the cancel button tapped on date range picker. It reset the selected values to confirmed selected values. [...]
onSelectionChanged DateRangePickerSelectionChangedCallback?
Called when the new dates or date ranges selected. [...]
onSubmit → (dynamic Function?(Object)?)
Called whenever the confirm button tapped on date range picker. The dates or ranges that have been selected are confirmed and the selected value is available in the value argument. [...]
onViewChanged HijriDatePickerViewChangedCallback?
Called when the current visible view or visible date range changes. [...]
rangeSelectionColor Color?
The color which fills the SfHijriDateRangePicker selection view for the range of dates which falls between the HijriDateRange.startDate and HijriDateRange.endDate. [...]
rangeTextStyle TextStyle?
The text style for the text in the selected range or ranges cell of SfHijriDateRangePicker month view. [...]
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited
selectableDayPredicate HijriDatePickerSelectableDayPredicate?
An selectableDayPredicate callback to decide whether the cell is selectable or not in hijri date range picker. [...]
selectionColor Color?
The color which fills the SfHijriDateRangePicker selection view. [...]
selectionMode DateRangePickerSelectionMode
Defines the selection mode for SfHijriDateRangePicker. [...]
selectionRadius double
The radius for the SfHijriDateRangePicker selection circle. [...]
selectionShape DateRangePickerSelectionShape
Defines the shape for the selection view in SfHijriDateRangePicker. [...]
selectionTextStyle TextStyle?
The text style for the text in the selected date or dates cell of SfHijriDateRangePicker. [...]
showActionButtons bool
Displays confirm and cancel buttons on the date range picker to perform the confirm and cancel actions. [...]
showNavigationArrow bool
Displays the navigation arrows on the header view of SfHijriDateRangePicker. [...]
showTodayButton bool
Displays the today button on the bottom of the SfHijriDateRangePicker. [...]
startRangeSelectionColor Color?
The color which fills the SfHijriDateRangePicker selection view of the range start date. [...]
todayHighlightColor Color?
Color that highlights the today date cell in SfHijriDateRangePicker. [...]
toggleDaySelection bool
Allows to deselect a date when the DateRangePickerSelectionMode set as DateRangePickerSelectionMode.single. [...]
view HijriDatePickerView
Defines the view for the SfHijriDateRangePicker. [...]
viewSpacing double
Used to define the spacedouble between multiple views when the enableMultiView is enabled. Otherwise, the viewSpacing value as not applied in SfHijriDateRangePicker. [...]
yearCellStyle HijriDatePickerYearCellStyle
Options to customize the year and decade view of the SfHijriDateRangePicker. [...]


build(BuildContext context) Widget
Describes the part of the user interface represented by this widget. [...]
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree. [...]
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children. [...]
@protected, inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node. [...]
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep. [...]
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object. [...]
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants. [...]
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object. [...]
toStringShort() String
A short, textual description of this widget.


operator ==(Object other) bool
The equality operator. [...]
@nonVirtual, inherited