CreateDatePicker class
Constructors
CreateDatePicker ({Key ? key , ViewState initialViewState = ViewState.date , DateTime ? initialDate , DateTime ? minDateTime , DateTime ? maxDateTime , List <DateTime > restrictedDates = const [] , List <String > weekLabels = const ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'] , List <String > monthLabels = const ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'] , double ? width , double elevation = 1 , dynamic builder (DateTime selectedDate , ViewState viewState , Widget leftArrow , Widget rightArrow , Widget dateViewButton , Widget monthViewButton , Widget yearViewButton , Widget weekday , Widget dateMonthYear , Widget dateGrid , Widget monthGrid , Widget yearGrid )?, dynamic leftArrowBuilder (dynamic previous () )?, dynamic rightArrowBuilder (dynamic next () )?, dynamic dateViewButtonBuilder (dynamic selectDateView (), DateTime selectedDate , bool isSelected )?, dynamic monthViewButtonBuilder (dynamic selectMonthView (), DateTime selectedDate , bool isSelected )?, dynamic yearViewButtonBuilder (dynamic selectYearView (), DateTime selectedDate , bool isSelected )?, dynamic weekdayCellBuilder (String day , bool isToday )?, dynamic dateCellBuilder (dynamic selectdate (), bool isSelected , bool isInTheCurrentMonth , bool isAvailable , int day )?, dynamic monthCellBuilder (dynamic selectMonth (), String month , bool isSelected , bool isAvailable )?, dynamic yearCellBuilder (dynamic selectYear (), int year , bool isSelected , bool isAvailable )?, dynamic onViewStateChanged (ViewState viewState )?, required dynamic onSelectedDateChanged (DateTime date ) })
A customizable date picker widget that allows users to select dates, months, or years.
Properties
builder
→ dynamic Function(DateTime selectedDate , ViewState viewState , Widget leftArrow , Widget rightArrow , Widget dateViewButton , Widget monthViewButton , Widget yearViewButton , Widget weekday , Widget dateMonthYear , Widget dateGrid , Widget monthGrid , Widget yearGrid ) ?
Custom builder for the entire picker. Here you can place all the component where ever you want, and to customize it use the builder for each component.
final
dateCellBuilder
→ dynamic Function(dynamic selectdate (), bool isSelected , bool isInTheCurrentMonth , bool isAvailable , int day ) ?
Custom builder for the date cells.
final
dateViewButtonBuilder
→ dynamic Function(dynamic selectDateView (), DateTime selectedDate , bool isSelected ) ?
Custom builder for the button to switch to the date view.
final
elevation
→ double
final
hashCode
→ int
The hash code for this object.
no setter inherited
initialDate
→ DateTime ?
The initially selected date.
final
initialViewState
→ ViewState
The initial view state of the picker (date, month, or year).
final
key
→ Key ?
Controls how one widget replaces another widget in the tree.
final inherited
leftArrowBuilder
→ dynamic Function(dynamic previous () ) ?
Custom builder for the left navigation arrow.
final
maxDateTime
→ DateTime ?
The maximum selectable date.
final
minDateTime
→ DateTime ?
The minimum selectable date.
final
monthCellBuilder
→ dynamic Function(dynamic selectMonth (), String month , bool isSelected , bool isAvailable ) ?
Custom builder for the month cells.
final
monthLabels
→ List <String >
Labels for the months of the year (e.g., January, February).
Must contain exactly 12 items.
final
monthViewButtonBuilder
→ dynamic Function(dynamic selectMonthView (), DateTime selectedDate , bool isSelected ) ?
Custom builder for the button to switch to the month view.
final
onSelectedDateChanged
→ dynamic Function(DateTime date )
Callback triggered when the selected date changes.
final
onViewStateChanged
→ dynamic Function(ViewState viewState ) ?
Callback triggered when the view state changes.
final
Offset for the popup menu.
final
Position of the popup menu (above or below the trigger).
final
Custom builder for the popup displaying the selected date.
final
restrictedDates
→ List <DateTime >
A list of dates that cannot be selected.
final
rightArrowBuilder
→ dynamic Function(dynamic next () ) ?
Custom builder for the right navigation arrow.
final
runtimeType
→ Type
A representation of the runtime type of the object.
no setter inherited
weekdayCellBuilder
→ dynamic Function(String day , bool isToday ) ?
Custom builder for the weekday cells.
final
weekLabels
→ List <String >
Labels for the days of the week (e.g., Sunday, Monday).
Must contain exactly 7 items.
final
width
→ double ?
The width of the picker.
final
yearCellBuilder
→ dynamic Function(dynamic selectYear (), int year , bool isSelected , bool isAvailable ) ?
Custom builder for the year cells.
final
yearViewButtonBuilder
→ dynamic Function(dynamic selectYearView (), DateTime selectedDate , bool isSelected ) ?
Custom builder for the button to switch to the year view.
final