PersianDatePicker class

Inheritance

Constructors

PersianDatePicker({Key? key, double? widthWithPadding, required void onSubmitDate(Jalali selectedDate), Jalali? chosenDate, TextStyle weekTitlesTextStyle = const TextStyle(fontSize: TextSizes.bodyLarge, color: Colours.hint), ButtonStyle headerButtonsStyle = const ButtonStyle(backgroundColor: MaterialStatePropertyAll(Colours.primary), foregroundColor: MaterialStatePropertyAll(Colours.main), shape: MaterialStatePropertyAll(RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(10))))), Widget headerPreviousButtonChild = const Text(Strings.previousMonth, style: TextStyle(fontSize: TextSizes.bodyMedium, color: Colours.main)), Widget headerNextButtonChild = const Text(Strings.nextMonth, style: TextStyle(fontSize: TextSizes.bodyMedium, color: Colours.main)), TextStyle headerMonthDisplayTextStyle = const TextStyle(fontSize: TextSizes.titleSmall, color: Colours.title), Color dateBackgroundColor = Colours.secondary, TextStyle dateTextStyle = const TextStyle(fontSize: TextSizes.bodyMedium, color: Colours.title), SelectedDateStyle selectedDateStyle = const SelectedDateStyle(visibility: SelectedDateVisibility.stroke, color: Colours.primary), required void onEmptyDateSubmit(), ButtonStyle submitButtonStyle = const ButtonStyle(backgroundColor: MaterialStatePropertyAll(Colours.primary), foregroundColor: MaterialStatePropertyAll(Colours.main), shape: MaterialStatePropertyAll(RoundedRectangleBorder(borderRadius: BorderRadius.all(Radius.circular(10))))), Widget submitButtonChild = const Text(Strings.confirm, style: TextStyle(fontSize: TextSizes.bodyMedium, color: Colours.main))})
const

Properties

chosenDate → Jalali?
Simply pass a date if you wish to have a date to be selected initially. This is pretty useful for situations where user has saved a date in your state management
final
dateBackgroundColor Color
The Color for days background
final
dateTextStyle TextStyle
TextStyle for day numbers
final
hashCode int
The hash code for this object.
no setterinherited
headerButtonsStyle ButtonStyle
ButtonStyle for header navigator buttons
final
headerMonthDisplayTextStyle TextStyle
TextStyle for month display text on top (bold text is recommended)
final
headerNextButtonChild Widget
Child widget of header left button
final
headerPreviousButtonChild Widget
Child widget of header right button
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
onEmptyDateSubmit → void Function()
This gets called when user has no selected date and taps the Submit button.
final
onSubmitDate → void Function(Jalali selectedDate)
This gets called when user selects a date and taps the Submit button. use selectedDate.formatter to access all details of the user's selected date
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedDateStyle SelectedDateStyle
The visibility type and color for selected date
final
submitButtonChild Widget
Child widget of submit button
final
submitButtonStyle ButtonStyle
ButtonStyle for the button in the bottom
final
weekTitlesTextStyle TextStyle
TextStyle for week titles.
final
widthWithPadding double?
Leave this empty if you want your PersianDatePicker to contain the whole width of the screen
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<PersianDatePicker>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited