MonthpickerController class

Global controller of the dialog. It holds the initial parameters passed on the widget creation.

Constructors

MonthpickerController({DateTime? initialDate, DateTime? firstDate, DateTime? lastDate, Locale? locale, bool selectableMonthPredicate(DateTime)?, ButtonStyle? monthStylePredicate(DateTime)?, ButtonStyle? yearStylePredicate(int)?, required bool capitalizeFirstLetter, Color? headerColor, Color? headerTextColor, Color? selectedMonthBackgroundColor, Color? selectedMonthTextColor, Color? unselectedMonthTextColor, Color? currentMonthTextColor, required double selectedMonthPadding, Color? backgroundColor, Widget? confirmWidget, Widget? cancelWidget, double? customHeight, required double customWidth, required bool yearFirst, required double roundedCornersRadius, required bool forceSelectedDate, required int animationMilliseconds, required bool hideHeaderRow, required ThemeData theme, required bool useMaterial3, double? textScaleFactor, double? arrowSize, required bool forcePortrait, Widget? customDivider, required bool blockScrolling, required BorderSide dialogBorderSide})

Properties

animationMilliseconds int
final
arrowSize double?
final
backgroundColor Color?
final
blockScrolling bool
final
cancelWidget Widget?
final
capitalizeFirstLetter bool
final
confirmWidget Widget?
final
currentMonthTextColor Color?
final
customDivider Widget?
final
customHeight double?
final
customWidth double
final
dialogBorderSide BorderSide
final
firstDate DateTime?
final
forcePortrait bool
final
forceSelectedDate bool
final
hashCode int
The hash code for this object.
no setterinherited
headerColor Color?
final
headerTextColor Color?
final
hideHeaderRow bool
final
initialDate DateTime?
final
lastDate DateTime?
final
locale Locale?
final
localFirstDate DateTime?
getter/setter pair
localLastDate DateTime?
getter/setter pair
monthPageController PageController?
getter/setter pair
monthPageCount int
getter/setter pair
monthSelectorState GlobalKey<MonthSelectorState>
final
monthStylePredicate → (ButtonStyle? Function(DateTime)?)
final
roundedCornersRadius double
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
selectableMonthPredicate → (bool Function(DateTime)?)
final
selectedDate DateTime
getter/setter pair
selectedMonthBackgroundColor Color?
final
selectedMonthPadding double
final
selectedMonthTextColor Color?
final
textScaleFactor double?
final
theme ThemeData
final
unselectedMonthTextColor Color?
final
useMaterial3 bool
final
yearFirst bool
final
yearItemCount int
getter/setter pair
yearPageController PageController?
getter/setter pair
yearPageCount int
getter/setter pair
yearSelectorState GlobalKey<YearSelectorState>
final
yearStylePredicate → (ButtonStyle? Function(int)?)
final

Methods

cancelFunction(BuildContext context) → void
function to cancel selecting a month
dispose() → void
Function to dispose year and month pages when the dialog closes.
firstPossibleMonth(int year) → void
function to get first possible month after selecting a year
getMonthPageCount(DateTime? firstDate, DateTime? lastDate) int
month pages count
getYearItemCount(DateTime? firstDate, DateTime? lastDate) int
year item count
getYearPageCount(DateTime? firstDate, DateTime? lastDate) int
year pages count
initialize() → void
Function to initialize the controller when the dialog is created.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
okFunction(BuildContext context) → void
function to confirm selecting a month
onDownButtonPressed() → void
function to move the page when down header button is pressed
onUpButtonPressed() → void
function to move the page when up header button is pressed
toString() String
A string representation of this object.
inherited

Operators

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