AppKitDatePicker class

A widget that provides a date picker control.

The AppKitDatePicker widget allows users to select a date or time from a calendar interface. It is a stateful widget that maintains the selected date and updates the UI accordingly.

Example usage:

  AppKitDatePicker(
    canRequestFocus: true,
    autofocus: false,
    date: left(_selectedDateRange.start),
    minimumDate: _minimumDate,
    maximumDate: _maximumDate,
    dateElements: AppKitDateElements.monthDayYear,
    timeElements:
        AppKitTimeElements.hourMinuteSecond,
    semanticLabel: 'Date Picker',
    type: AppKitDatePickerType.textual,
    onChanged:
        (Either<DateTime, DateTimeRange> d) {
      debugPrint('Date Changed ($d)');
    },
  );
Inheritance

Constructors

AppKitDatePicker({Key? key, required AppKitDatePickerType type, AppKitDateElements dateElements = AppKitDateElements.monthDayYear, AppKitTimeElements timeElements = AppKitTimeElements.none, DateTime? minimumDate, DateTime? maximumDate, String? semanticLabel, TextStyle? textStyle, Color? color, OnDateChanged? onChanged, bool canRequestFocus = true, bool autofocus = false, bool drawBackground = true, bool drawBorder = true, AppKitDatePickerSelectionType selectionType = AppKitDatePickerSelectionType.single, Either<DateTime, DateTimeRange>? date})

Properties

autofocus → bool
Whether the date picker should automatically gain focus when the widget is displayed.
final
canRequestFocus → bool
Indicates whether the date picker can request focus.
final
color → Color?
The color to use for the date picker.
final
dateElements → AppKitDateElements
The elements of the date picker related to date selection.
final
drawBackground → bool
Whether to draw the background of the date picker.
final
drawBorder → bool
Whether to draw the border of the date picker.
final
hashCode → int
The hash code for this object.
no setterinherited
initialDateTime → Either<DateTime, DateTimeRange>
The initial date or date range to be selected in the date picker. This can be either a single DateTime or a DateTimeRange.
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maximumDate → DateTime?
The maximum selectable date for the date picker.
final
minimumDate → DateTime?
The minimum selectable date for the date picker.
final
onChanged → OnDateChanged?
Callback that is called when the selected date changes.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
selectionType → AppKitDatePickerSelectionType
The type of selection for the date picker (e.g., single date, date range).
final
semanticLabel → String?
The semantic label for the date picker, used for accessibility.
final
textStyle → TextStyle?
The text style to use for the date picker text.
final
timeElements → AppKitTimeElements
The elements of the date picker related to time selection.
final
type → AppKitDatePickerType
The type of the date picker, which determines its appearance and behavior.
final

Methods

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