CreateDatePicker class

Inheritance

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, Offset? popupMenuOffset, PopupMenuPosition popupMenuPosition = PopupMenuPosition.under, dynamic builder(DateTime selectedDate, ViewState viewState, Widget leftArrow, Widget rightArrow, Widget popupSelectedDate, 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 popupSelectedDateBuilder(DateTime selectedDate)?, 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 popupSelectedDate, 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 setterinherited
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.
finalinherited
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
popupMenuOffset Offset?
Offset for the popup menu.
final
popupMenuPosition PopupMenuPosition
Position of the popup menu (above or below the trigger).
final
popupSelectedDateBuilder → dynamic Function(DateTime selectedDate)?
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 setterinherited
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

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() State<CreateDatePicker>
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