ModWheelDatePicker class

A customizable wheel-based date picker widget.

Supports different modes: full date (day/month/year), month/year only, or year only.

Inheritance

Constructors

ModWheelDatePicker({Key? key, ModWheelDatePickerType type = ModWheelDatePickerType.dayMonthYear, DateTime? initialDate, ModWheelDatePickerController? controller, ValueChanged<DateTime>? onDateChanged, int minYear = 1900, int maxYear = 2100, double height = 150, double? width, TextStyle? selectedStyle, TextStyle? unselectedStyle, bool showDividers = false, Color? dividerColor, Color? backgroundColor, BorderRadius? borderRadius, bool enableHapticFeedback = true, ModHapticFeedbackType hapticFeedbackType = ModHapticFeedbackType.vibrate, bool useShortMonthNames = false, List<String>? customMonthNames, double itemSize = 40, bool enableAnimation = true, Duration animationDuration = const Duration(milliseconds: 500), bool dayMonthYearOrder = true})
const
ModWheelDatePicker.dayMonthYear({Key? key, DateTime? initialDate, ModWheelDatePickerController? controller, ValueChanged<DateTime>? onDateChanged, int minYear = 1900, int maxYear = 2100, double height = 150, double? width, TextStyle? selectedStyle, TextStyle? unselectedStyle, bool showDividers = false, Color? dividerColor, Color? backgroundColor, BorderRadius? borderRadius, bool enableHapticFeedback = true, ModHapticFeedbackType hapticFeedbackType = ModHapticFeedbackType.vibrate, bool useShortMonthNames = false, List<String>? customMonthNames, double itemSize = 40, bool enableAnimation = true, Duration animationDuration = const Duration(milliseconds: 500), bool dayMonthYearOrder = true})
Creates a date picker with day, month, and year wheels.
const
ModWheelDatePicker.monthYear({Key? key, DateTime? initialDate, ModWheelDatePickerController? controller, ValueChanged<DateTime>? onDateChanged, int minYear = 1900, int maxYear = 2100, double height = 150, double? width, TextStyle? selectedStyle, TextStyle? unselectedStyle, bool showDividers = false, Color? dividerColor, Color? backgroundColor, BorderRadius? borderRadius, bool enableHapticFeedback = true, ModHapticFeedbackType hapticFeedbackType = ModHapticFeedbackType.vibrate, bool useShortMonthNames = false, List<String>? customMonthNames, double itemSize = 40, bool enableAnimation = true, Duration animationDuration = const Duration(milliseconds: 500)})
Creates a date picker with month and year wheels only.
const
ModWheelDatePicker.yearOnly({Key? key, DateTime? initialDate, ModWheelDatePickerController? controller, ValueChanged<DateTime>? onDateChanged, int minYear = 1900, int maxYear = 2100, double height = 150, double? width, TextStyle? selectedStyle, TextStyle? unselectedStyle, Color? backgroundColor, BorderRadius? borderRadius, bool enableHapticFeedback = true, ModHapticFeedbackType hapticFeedbackType = ModHapticFeedbackType.vibrate, double itemSize = 40, bool enableAnimation = true, Duration animationDuration = const Duration(milliseconds: 500)})
Creates a date picker with year wheel only.
const

Properties

animationDuration Duration
Duration of the animation for initial value display.
final
backgroundColor Color?
Background color of the picker.
final
borderRadius BorderRadius?
Border radius of the picker container.
final
controller ModWheelDatePickerController?
External controller for programmatically setting the date.
final
customMonthNames List<String>?
Custom month names. If null, uses default names based on locale.
final
dayMonthYearOrder bool
Whether to order as day-month-year (true) or month-day-year (false).
final
dividerColor Color?
The color of the dividers.
final
enableAnimation bool
Enables or disables animation for initial value display.
final
enableHapticFeedback bool
Enables or disables haptic feedback.
final
hapticFeedbackType ModHapticFeedbackType
Type of haptic feedback to be used.
final
hashCode int
The hash code for this object.
no setterinherited
height double
Height of the date picker.
final
initialDate DateTime?
The initial date to display.
final
itemSize double
Size of each item in the wheel.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxYear int
The maximum year to display in the year picker.
final
minYear int
The minimum year to display in the year picker.
final
onDateChanged ValueChanged<DateTime>?
Callback function that is triggered when the date changes.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedStyle TextStyle?
Text style for the selected item.
final
showDividers bool
Whether to show a divider between wheels.
final
type ModWheelDatePickerType
The type of date picker to display.
final
unselectedStyle TextStyle?
Text style for unselected items.
final
useShortMonthNames bool
Whether to use short month names (e.g., "Jan" instead of "January").
final
width double?
Width of the date picker. If null, uses available width.
final

Methods

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