MonthYearPicker class

A widget that displays month and year pickers using wheel scroll views.

Inheritance

Constructors

MonthYearPicker({Key? key, required List<String> months, required List<int> years, required FixedExtentScrollController monthController, required FixedExtentScrollController yearController, required int selectedMonthIndex, required int selectedYearIndex, required ValueChanged<int> onMonthChanged, required ValueChanged<int> onYearChanged, Color? primaryColor, Color? unselectedTextColor, TextStyle? pickerTextStyle, String? fontFamily})
const

Properties

fontFamily String?
Global font family that applies across all text. This will be merged into pickerTextStyle if provided.
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
monthController FixedExtentScrollController
Controller for the month picker scroll view.
final
months List<String>
List of month abbreviations (e.g., 'Jan', 'Feb', ...).
final
onMonthChanged ValueChanged<int>
Callback when month selection changes.
final
onYearChanged ValueChanged<int>
Callback when year selection changes.
final
pickerTextStyle TextStyle?
Text style for picker text. If null, uses Theme.of(context).textTheme.headlineSmall.
final
primaryColor Color?
Primary color for selected items. If null, uses Theme.of(context).colorScheme.primary.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectedMonthIndex int
Currently selected month index.
final
selectedYearIndex int
Currently selected year index.
final
unselectedTextColor Color?
Color for unselected text. If null, uses Theme.of(context).textTheme.bodyMedium?.color with opacity.
final
yearController FixedExtentScrollController
Controller for the year picker scroll view.
final
years List<int>
List of available years.
final

Methods

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