FlatpickrOptions class

Flatpickr configuration options.

Annotations
  • @JS()
  • @anonymous

Constructors

FlatpickrOptions({String altFormat = 'F j, Y', bool altInput = false, String altInputClass = '', bool allowInput = false, HtmlElement? appendTo, String ariaDateFormat = 'F j, Y', bool clickOpens = true, String dateFormat = 'Y-m-d', dynamic defaultDate, int defaultHour = 12, int defaultMinute = 0, List disable = const [], bool disableMobile = false, List enable = const [], bool enableTime = false, bool enableSeconds = false, Function? formatDate, int hourIncrement = 1, bool inline = false, dynamic locale = 'en', dynamic maxDate, dynamic minDate, int minuteIncrement = 5, String mode = 'single', String nextArrow = '>', bool noCalendar = false, dynamic onChange, dynamic onValueUpdate, dynamic onClose, dynamic onOpen, dynamic onReady, dynamic parseDate(String dateString)?, String? position, String prevArrow = '<', bool shorthandCurrentMonth = false, int showMonths = 1, bool static = false, bool time_24hr = false, bool weekNumbers = false, bool wrap = false, String monthSelectorType = 'dropdown'})
factory

Properties

allowInput bool
Allows the user to enter a date directly input the input field. By default, direct entry is disabled.
getter/setter pair
altFormat String
Exactly the same as dateFormat, but for the altInput field.
getter/setter pair
altInput bool
Show the user a readable date (as per altFormat), but return something totally different to the server.
getter/setter pair
altInputClass String
This class will be added to the input element created by the altInput option. Note that altInput already inherits classes from the original input.
getter/setter pair
appendTo HtmlElement
Instead of body, appends the calendar to the specified node instead.
getter/setter pair
ariaDateFormat String
Defines how the date will be formatted in the aria-label for calendar days, using the same tokens as dateFormat. If you change this, you should choose a value that will make sense if a screen reader reads it out loud.
getter/setter pair
clickOpens bool
Whether clicking on the input should open the picker. You could disable this if you wish to open the calendar manually with Flatpickr.open()
getter/setter pair
dateFormat String
A string of characters which are used to define how the date will be displayed in the input box.
getter/setter pair
defaultDate ↔ dynamic
Initial selected date(s).
getter/setter pair
defaultHour int
Initial value of the hour element.
getter/setter pair
defaultMinute int
Initial value of the minute element.
getter/setter pair
disable List
Dates unavailable for selection.
getter/setter pair
disableMobile bool
Set disableMobile to true to always use the non-native picker.
getter/setter pair
enable List
Dates avalable for selection.
getter/setter pair
enableSeconds bool
Enables seconds in the time picker.
getter/setter pair
enableTime bool
Enables time picker.
getter/setter pair
formatDate Function
Allows using a custom date formatting function instead of the built-in.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
hourIncrement int
Adjusts the step for the hour input (incl. scrolling).
getter/setter pair
inline bool
Displays the calendar inline.
getter/setter pair
locale ↔ dynamic
Locale string.
getter/setter pair
maxDate ↔ dynamic
The maximum date that a user can pick to (inclusive).
getter/setter pair
minDate ↔ dynamic
The minimum date that a user can start picking from (inclusive).
getter/setter pair
minuteIncrement int
Adjusts the step for the minute input (incl. scrolling).
getter/setter pair
mode String
single, multiple, or range
getter/setter pair
monthSelectorType String
How the month should be displayed in the header of the calendar. Supported values: "dropdown" or "static"
getter/setter pair
nextArrow String
HTML for the arrow icon, used to switch months.
getter/setter pair
noCalendar bool
Hides the day selection in calendar. Use it along with enableTime to create a time picker.
getter/setter pair
onChange ↔ dynamic
Function(s) to trigger on every date selection
getter/setter pair
onClose ↔ dynamic
Function(s) to trigger on every time the calendar is closed.
getter/setter pair
onOpen ↔ dynamic
Function(s) to trigger on every time the calendar is opened.
getter/setter pair
onReady ↔ dynamic
Function to trigger when the calendar is ready.
getter/setter pair
onValueUpdate ↔ dynamic
Function(s) to trigger when the input value is updated with a new date string.
getter/setter pair
parseDate ↔ dynamic Function(String dateString)
Function that expects a date string and must return a Date object
getter/setter pair
position String
Where the calendar is rendered relative to the input. Supported values: auto, above or below.
getter/setter pair
prevArrow String
HTML for the left arrow icon.
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shorthandCurrentMonth bool
Show the month using the shorthand version (ie, Sep instead of September).
getter/setter pair
showMonths int
The number of months showed.
getter/setter pair
static bool
Position the calendar inside the wrapper and next to the input element.
getter/setter pair
time_24hr bool
Displays time picker in 24 hour mode without AM/PM selection when enabled.
getter/setter pair
weekNumbers bool
Enables display ofc week numbers in calendar.
getter/setter pair
wrap bool
flatpickr can parse an input group of textboxes and buttons, common in Bootstrap and other frameworks.
getter/setter pair

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

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