ShadDatePicker class
A customizable date picker widget with a button and popover calendar.
The ShadDatePicker widget combines a button with a popover calendar, allowing users to select a single date or a date range. It supports extensive customization for both the button and calendar, integrating with ShadTheme for consistent styling. Use named constructors like ShadDatePicker.range for range selection or ShadDatePicker.raw for full control.
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- ShadDatePicker
- Available extensions
Constructors
-
ShadDatePicker({Key? key, Widget? placeholder, ShadPopoverController? popoverController, DateTime? selected, bool? closeOnSelection, String formatDate(DateTime)?, bool? allowDeselection, Widget? header, Object? groupId, ShadDecoration? calendarDecoration, EdgeInsetsGeometry? popoverPadding, List<
DateTime> ? multipleSelected, ValueChanged<DateTime?> ? onChanged, ValueChanged<List< ? onMultipleChanged, bool? showOutsideDays, DateTime? initialMonth, String formatMonthYear(DateTime)?, String formatMonth(DateTime)?, String formatYear(DateTime)?, String formatWeekday(DateTime)?, bool? showWeekNumbers, int? weekStartsOn, bool? fixedWeeks, bool? hideWeekdayNames, int numberOfMonths = 1, DateTime? fromMonth, DateTime? toMonth, ValueChanged<DateTime> >DateTime> ? onMonthChanged, bool reverseMonths = false, int? min, int? max, bool selectableDayPredicate(DateTime day)?, ValueChanged<ShadDateTimeRange?> ? onRangeChanged, ShadCalendarCaptionLayout? captionLayout, double? yearSelectorMinWidth, double? monthSelectorMinWidth, EdgeInsetsGeometry? yearSelectorPadding, EdgeInsetsGeometry? monthSelectorPadding, ShadDecoration? decoration, double? spacingBetweenMonths, double? runSpacingBetweenMonths, BoxConstraints? monthConstraints, double? calendarHeaderHeight, EdgeInsetsGeometry? calendarHeaderPadding, double? captionLayoutGap, TextStyle? calendarHeaderTextStyle, EdgeInsetsGeometry? weekdaysPadding, TextStyle? weekdaysTextStyle, TextAlign? weekdaysTextAlign, String? weekNumbersHeaderText, TextStyle? weekNumbersHeaderTextStyle, TextStyle? weekNumbersTextStyle, TextAlign? weekNumbersTextAlign, double? dayButtonSize, double? dayButtonOutsideMonthOpacity, EdgeInsetsGeometry? dayButtonPadding, ShadDecoration? dayButtonDecoration, TextStyle? selectedDayButtonTextStyle, TextStyle? insideRangeDayButtonTextStyle, TextStyle? dayButtonTextStyle, ShadButtonVariant? dayButtonVariant, ShadButtonVariant? selectedDayButtonVariant, ShadButtonVariant? insideRangeDayButtonVariant, ShadButtonVariant? todayButtonVariant, double? gridMainAxisSpacing, double? gridCrossAxisSpacing, TextStyle? dayButtonOutsideMonthTextStyle, ShadButtonVariant? dayButtonOutsideMonthVariant, ShadButtonVariant? selectedDayButtonOusideMonthVariant, bool closeOnTapOutside = true, FocusNode? focusNode, ShadAnchorBase? anchor, List<Effect> ? effects, List<BoxShadow> ? shadows, ShadDecoration? popoverDecoration, ImageFilter? filter, Object? areaGroupId, bool useSameGroupIdForChild = true, VoidCallback? onPressed, VoidCallback? onLongPress, Widget? leading, Widget? buttonChild, ShadButtonVariant? buttonVariant, ShadButtonSize? size, MouseCursor? cursor, double? width, double? height, EdgeInsetsGeometry? buttonPadding, Color? backgroundColor, Color? hoverBackgroundColor, Color? foregroundColor, Color? hoverForegroundColor, bool autofocus = false, FocusNode? buttonFocusNode, Color? pressedBackgroundColor, Color? pressedForegroundColor, List<BoxShadow> ? buttonShadows, Gradient? gradient, TextDecoration? textDecoration, TextDecoration? hoverTextDecoration, ShadDecoration? buttonDecoration, bool enabled = true, ShadStatesController? statesController, double? gap, MainAxisAlignment? mainAxisAlignment, CrossAxisAlignment? crossAxisAlignment, ShadHoverStrategies? hoverStrategies, ValueChanged<bool> ? onHoverChange, ValueChanged<TapDownDetails> ? onTapDown, ValueChanged<TapUpDetails> ? onTapUp, VoidCallback? onTapCancel, ValueChanged<TapDownDetails> ? onSecondaryTapDown, ValueChanged<TapUpDetails> ? onSecondaryTapUp, VoidCallback? onSecondaryTapCancel, ValueChanged<LongPressStartDetails> ? onLongPressStart, VoidCallback? onLongPressCancel, VoidCallback? onLongPressUp, ValueChanged<LongPressDownDetails> ? onLongPressDown, ValueChanged<LongPressEndDetails> ? onLongPressEnd, VoidCallback? onDoubleTap, ValueChanged<TapDownDetails> ? onDoubleTapDown, VoidCallback? onDoubleTapCancel, Duration? longPressDuration, TextDirection? textDirection, ValueChanged<bool> ? onFocusChange, IconData? iconData, bool? expands, Duration? popoverReverseDuration, TextStyle? buttonTextStyle, Widget? trailing}) -
Creates a single-date picker widget with a button and popover calendar.
const
-
ShadDatePicker.range({Key? key, ShadPopoverController? popoverController, Widget? placeholder, ShadDateTimeRange? selected, String formatDateRange(ShadDateTimeRange)?, bool? closeOnSelection, bool? allowDeselection, Widget? header, Object? groupId, ShadDecoration? calendarDecoration, EdgeInsetsGeometry? popoverPadding, List<
DateTime> ? multipleSelected, ValueChanged<DateTime?> ? onChanged, ValueChanged<List< ? onMultipleChanged, bool? showOutsideDays, DateTime? initialMonth, String formatMonthYear(DateTime)?, String formatMonth(DateTime)?, String formatYear(DateTime)?, String formatWeekday(DateTime)?, bool? showWeekNumbers, int? weekStartsOn, bool? fixedWeeks, bool? hideWeekdayNames, int numberOfMonths = 1, DateTime? fromMonth, DateTime? toMonth, ValueChanged<DateTime> >DateTime> ? onMonthChanged, bool reverseMonths = false, int? min, int? max, bool selectableDayPredicate(DateTime day)?, ValueChanged<ShadDateTimeRange?> ? onRangeChanged, ShadCalendarCaptionLayout? captionLayout, double? yearSelectorMinWidth, double? monthSelectorMinWidth, EdgeInsetsGeometry? yearSelectorPadding, EdgeInsetsGeometry? monthSelectorPadding, ShadDecoration? decoration, double? spacingBetweenMonths, double? runSpacingBetweenMonths, BoxConstraints? monthConstraints, double? calendarHeaderHeight, EdgeInsetsGeometry? calendarHeaderPadding, double? captionLayoutGap, TextStyle? calendarHeaderTextStyle, EdgeInsetsGeometry? weekdaysPadding, TextStyle? weekdaysTextStyle, TextAlign? weekdaysTextAlign, String? weekNumbersHeaderText, TextStyle? weekNumbersHeaderTextStyle, TextStyle? weekNumbersTextStyle, TextAlign? weekNumbersTextAlign, double? dayButtonSize, double? dayButtonOutsideMonthOpacity, EdgeInsetsGeometry? dayButtonPadding, ShadDecoration? dayButtonDecoration, TextStyle? selectedDayButtonTextStyle, TextStyle? insideRangeDayButtonTextStyle, TextStyle? dayButtonTextStyle, ShadButtonVariant? dayButtonVariant, ShadButtonVariant? selectedDayButtonVariant, ShadButtonVariant? insideRangeDayButtonVariant, ShadButtonVariant? todayButtonVariant, double? gridMainAxisSpacing, double? gridCrossAxisSpacing, TextStyle? dayButtonOutsideMonthTextStyle, ShadButtonVariant? dayButtonOutsideMonthVariant, ShadButtonVariant? selectedDayButtonOusideMonthVariant, bool closeOnTapOutside = true, FocusNode? focusNode, ShadAnchorBase? anchor, List<Effect> ? effects, List<BoxShadow> ? shadows, ShadDecoration? popoverDecoration, ImageFilter? filter, Object? areaGroupId, bool useSameGroupIdForChild = true, VoidCallback? onPressed, VoidCallback? onLongPress, Widget? leading, Widget? buttonChild, ShadButtonVariant? buttonVariant, ShadButtonSize? size, MouseCursor? cursor, double? width, double? height, EdgeInsetsGeometry? buttonPadding, Color? backgroundColor, Color? hoverBackgroundColor, Color? foregroundColor, Color? hoverForegroundColor, bool autofocus = false, FocusNode? buttonFocusNode, Color? pressedBackgroundColor, Color? pressedForegroundColor, List<BoxShadow> ? buttonShadows, Gradient? gradient, TextDecoration? textDecoration, TextDecoration? hoverTextDecoration, ShadDecoration? buttonDecoration, bool enabled = true, ShadStatesController? statesController, double? gap, MainAxisAlignment? mainAxisAlignment, CrossAxisAlignment? crossAxisAlignment, ShadHoverStrategies? hoverStrategies, ValueChanged<bool> ? onHoverChange, ValueChanged<TapDownDetails> ? onTapDown, ValueChanged<TapUpDetails> ? onTapUp, VoidCallback? onTapCancel, ValueChanged<TapDownDetails> ? onSecondaryTapDown, ValueChanged<TapUpDetails> ? onSecondaryTapUp, VoidCallback? onSecondaryTapCancel, ValueChanged<LongPressStartDetails> ? onLongPressStart, VoidCallback? onLongPressCancel, VoidCallback? onLongPressUp, ValueChanged<LongPressDownDetails> ? onLongPressDown, ValueChanged<LongPressEndDetails> ? onLongPressEnd, VoidCallback? onDoubleTap, ValueChanged<TapDownDetails> ? onDoubleTapDown, VoidCallback? onDoubleTapCancel, Duration? longPressDuration, TextDirection? textDirection, ValueChanged<bool> ? onFocusChange, IconData? iconData, bool? expands, Duration? popoverReverseDuration, TextStyle? buttonTextStyle, Widget? trailing}) -
Creates a date range picker widget with a button and popover calendar.
const
-
ShadDatePicker.raw({Key? key, required ShadDatePickerVariant variant, ShadPopoverController? popoverController, DateTime? selected, bool? closeOnSelection, String formatDate(DateTime)?, bool? allowDeselection, ShadDateTimeRange? selectedRange, Widget? header, Object? groupId, ShadDecoration? calendarDecoration, EdgeInsetsGeometry? popoverPadding, List<
DateTime> ? multipleSelected, ValueChanged<DateTime?> ? onChanged, ValueChanged<List< ? onMultipleChanged, bool? showOutsideDays, DateTime? initialMonth, String formatMonthYear(DateTime)?, String formatMonth(DateTime)?, String formatYear(DateTime)?, String formatWeekday(DateTime)?, bool? showWeekNumbers, int? weekStartsOn, bool? fixedWeeks, bool? hideWeekdayNames, int numberOfMonths = 1, DateTime? fromMonth, DateTime? toMonth, ValueChanged<DateTime> >DateTime> ? onMonthChanged, bool reverseMonths = false, int? min, int? max, bool selectableDayPredicate(DateTime day)?, ValueChanged<ShadDateTimeRange?> ? onRangeChanged, ShadCalendarCaptionLayout? captionLayout, double? yearSelectorMinWidth, double? monthSelectorMinWidth, EdgeInsetsGeometry? yearSelectorPadding, EdgeInsetsGeometry? monthSelectorPadding, ShadDecoration? decoration, double? spacingBetweenMonths, double? runSpacingBetweenMonths, BoxConstraints? monthConstraints, double? calendarHeaderHeight, EdgeInsetsGeometry? calendarHeaderPadding, double? captionLayoutGap, TextStyle? calendarHeaderTextStyle, EdgeInsetsGeometry? weekdaysPadding, TextStyle? weekdaysTextStyle, TextAlign? weekdaysTextAlign, String? weekNumbersHeaderText, TextStyle? weekNumbersHeaderTextStyle, TextStyle? weekNumbersTextStyle, TextAlign? weekNumbersTextAlign, double? dayButtonSize, double? dayButtonOutsideMonthOpacity, EdgeInsetsGeometry? dayButtonPadding, ShadDecoration? dayButtonDecoration, TextStyle? selectedDayButtonTextStyle, TextStyle? insideRangeDayButtonTextStyle, TextStyle? dayButtonTextStyle, ShadButtonVariant? dayButtonVariant, ShadButtonVariant? selectedDayButtonVariant, ShadButtonVariant? insideRangeDayButtonVariant, ShadButtonVariant? todayButtonVariant, double? gridMainAxisSpacing, double? gridCrossAxisSpacing, TextStyle? dayButtonOutsideMonthTextStyle, ShadButtonVariant? dayButtonOutsideMonthVariant, ShadButtonVariant? selectedDayButtonOusideMonthVariant, bool closeOnTapOutside = true, FocusNode? focusNode, ShadAnchorBase? anchor, List<Effect> ? effects, List<BoxShadow> ? shadows, ShadDecoration? popoverDecoration, ImageFilter? filter, Object? areaGroupId, bool useSameGroupIdForChild = true, VoidCallback? onPressed, VoidCallback? onLongPress, Widget? leading, Widget? buttonChild, ShadButtonVariant? buttonVariant, ShadButtonSize? size, MouseCursor? cursor, double? width, double? height, EdgeInsetsGeometry? buttonPadding, Color? backgroundColor, Color? hoverBackgroundColor, Color? foregroundColor, Color? hoverForegroundColor, bool autofocus = false, FocusNode? buttonFocusNode, Color? pressedBackgroundColor, Color? pressedForegroundColor, List<BoxShadow> ? buttonShadows, Gradient? gradient, TextDecoration? textDecoration, TextDecoration? hoverTextDecoration, ShadDecoration? buttonDecoration, bool enabled = true, ShadStatesController? statesController, double? gap, MainAxisAlignment? mainAxisAlignment, CrossAxisAlignment? crossAxisAlignment, ShadHoverStrategies? hoverStrategies, ValueChanged<bool> ? onHoverChange, ValueChanged<TapDownDetails> ? onTapDown, ValueChanged<TapUpDetails> ? onTapUp, VoidCallback? onTapCancel, ValueChanged<TapDownDetails> ? onSecondaryTapDown, ValueChanged<TapUpDetails> ? onSecondaryTapUp, VoidCallback? onSecondaryTapCancel, ValueChanged<LongPressStartDetails> ? onLongPressStart, VoidCallback? onLongPressCancel, VoidCallback? onLongPressUp, ValueChanged<LongPressDownDetails> ? onLongPressDown, ValueChanged<LongPressEndDetails> ? onLongPressEnd, VoidCallback? onDoubleTap, ValueChanged<TapDownDetails> ? onDoubleTapDown, VoidCallback? onDoubleTapCancel, Duration? longPressDuration, TextDirection? textDirection, ValueChanged<bool> ? onFocusChange, IconData? iconData, String formatDateRange(ShadDateTimeRange)?, Widget? placeholder, bool? expands, Duration? popoverReverseDuration, TextStyle? buttonTextStyle, Widget? trailing}) -
Creates a date picker widget with a specified
variant, offering full customization.const
Properties
- allowDeselection → bool?
-
Whether to allow deselection of the selected date.
final
- anchor → ShadAnchorBase?
-
The position of the
popoverin the global coordinate system.final - areaGroupId → Object?
-
An optional group ID that groups ShadMouseAreas together so that they
operate as one region. If any member of a group is hit by a particular
hover, then all members will have their
onEnteroronExitcalled.final - autofocus → bool
-
Whether the button should automatically receive focus when the widget is
built. Defaults to false; managed by focusNode.
final
- backgroundColor → Color?
-
The background color of the button when not hovered or pressed, overriding
the theme default if provided. Changes based on variant if not
explicitly set.
final
-
The back navigation button src, defaults to LucideIcons.chevronLeft
final
-
The main content widget of the button, typically a Text widget.
Styled with the foreground color and theme text styles.
final
-
Custom decoration for the button, merged with theme defaults if provided.
Allows advanced styling beyond basic colors and shadows.
final
-
The focus node for keyboard navigation, created internally if not
provided. Enables focus handling and shortcuts like Enter key activation.
final
-
Padding around the button's content, overriding size-based defaults
if specified. Controls internal spacing within the button.
final
-
The list of box shadows applied to the button, overriding the theme
default if provided. Enhances visual depth and elevation.
final
-
The text style applied to the button's
childwhen it is a Text widget, overriding the theme default if provided. Allows customization of font size, weight, and other text properties.final -
The variant of the button, one of ShadButtonVariant options (primary,
destructive, etc.). Determines the visual style applied through the
ShadTheme.
final
- calendarDecoration → ShadDecoration?
-
The decoration of the calendar.
Defaults to
ShadDecoration.none.final - calendarHeaderHeight → double?
-
The height of the header, defaults to 38
final
- calendarHeaderPadding → EdgeInsetsGeometry?
-
The padding of the header, defaults to
EdgeInsets.only(bottom: 16)final - calendarHeaderTextStyle → TextStyle?
-
The text style of the header, defaults to
effectiveTextTheme.smallfinal - captionLayout → ShadCalendarCaptionLayout?
-
The layout of the caption, defaults to ShadCalendarCaptionLayout.label.
final
- captionLayoutGap → double?
-
The gap between the caption layout elements, defaults to 8
final
- closeOnSelection → bool?
-
Whether to close the popover when a date is selected.
Defaults to
true.final - closeOnTapOutside → bool
-
Closes the popover when the user taps outside, defaults to true.
final
- crossAxisAlignment → CrossAxisAlignment?
-
The cross axis alignment of the button's content within its Row.
Defaults to CrossAxisAlignment.center if not specified.
final
- cursor → MouseCursor?
-
The mouse cursor displayed over the button, overriding the theme default
if specified. Typically SystemMouseCursors.click when enabled.
final
- dayButtonDecoration → ShadDecoration?
-
The decoration of the day buttons, defaults to
final
- dayButtonOutsideMonthOpacity → double?
-
The opacity of the day buttons outside the month, defaults to .5
final
- dayButtonOutsideMonthTextStyle → TextStyle?
-
The text style of the day buttons outside the month, defaults to
textTheme.mutedfinal - dayButtonOutsideMonthVariant → ShadButtonVariant?
-
The variant of the day buttons outside the month, defaults to
ShadButtonVariant.ghost
final
- dayButtonPadding → EdgeInsetsGeometry?
-
The padding of the day buttons, defaults to EdgeInsets.zero
final
- dayButtonSize → double?
-
The size of the day buttons, defaults to 36
final
- dayButtonTextStyle → TextStyle?
-
The text style of the day button, defaults to
final
- dayButtonVariant → ShadButtonVariant?
-
The variant of the day button, defaults to ShadButtonVariant.ghost
final
- decoration → ShadDecoration?
-
The decoration of the calendar, defaults to
final
-
effects
→ List<
Effect> ? -
The animation effects applied to the
popover. Defaults toFadeEffect(), ScaleEffect(begin: Offset(.95, .95), end: Offset(1, 1)), MoveEffect(begin: Offset(0, 2), end: Offset(0, 0)).final - enabled → bool
-
Whether the button is interactive, defaults to true.
If false, the button is disabled, visually dimmed, and non-responsive.
final
- expands → bool?
-
Whether the
childexpands to fill available space along the main axis. Defaults to false if not specified.final - filter → ImageFilter?
-
The filter of the
popover. Ifnull, falls back toShadPopoverTheme.final - fixedWeeks → bool?
-
Display six weeks per months, regardless the month’s number of weeks.
final
- focusNode → FocusNode?
-
The focus node of the child, the
popoverwill be shown when focused.final -
The footer of the date picker.
final
- foregroundColor → Color?
-
The color of the button's content (e.g., text, icons) when not hovered or
pressed.
Overrides the theme default if provided; required in theme if not set.
final
- formatDate → String Function(DateTime)?
-
A function that formats the selected date.
final
- formatDateRange → String Function(ShadDateTimeRange)?
-
A function that formats the selected date range.
final
- formatMonth → String Function(DateTime)?
-
The format to use for the month, defaults to 'LLLL'.
final
- formatMonthYear → String Function(DateTime)?
-
The format to use for the month, defaults to 'LLLL y'.
final
- formatWeekday → String Function(DateTime)?
-
The format to use for the weekday, defaults to 'EE'.
final
- formatYear → String Function(DateTime)?
-
The format to use for the year, defaults to 'y'.
final
-
The forward navigation button src, defaults to LucideIcons.chevronRight
final
- fromMonth → DateTime?
-
The month to start the calendar from, defaults to null.
final
- gap → double?
-
The gap between the button's items (e.g., leading,
child, trailing). Defaults to 8 pixels if not specified.final - gradient → Gradient?
-
The gradient applied to the button's background, overriding the theme
default if provided. Supersedes backgroundColor if both are set.
final
- gridCrossAxisSpacing → double?
-
The cross axis spacing of the grid, defaults to 0
final
- gridMainAxisSpacing → double?
-
The main axis spacing of the grid, defaults to 8
final
- groupId → Object?
-
The group id of the
popover, defaults toUniqueKey().final - hashCode → int
-
The hash code for this object.
no setterinherited
- header → Widget?
-
The header of the date picker.
final
- height → double?
-
The explicit minimum height of the button, overriding size-based defaults.
If null, it falls back to theme or size-specific minimums. When set to 0,
or a value smaller than the child's height the button's height will be
determined by its child.
final
-
Whether to hide the navigation buttons, defaults to false.
final
- hideWeekdayNames → bool?
-
Hide the month’s head displaying the weekday names, defaults to false.
final
- hoverBackgroundColor → Color?
-
The background color of the button when hovered, overriding the theme
default if provided.
Applied during mouse hover for visual feedback.
final
- hoverForegroundColor → Color?
-
The color of the button's content when hovered, overriding the theme
default if provided.
Applied during mouse hover for visual feedback.
final
- hoverStrategies → ShadHoverStrategies?
-
The strategies for handling hover behavior, overriding the theme default
if provided. Controls how hover states are detected and applied.
final
- hoverTextDecoration → TextDecoration?
-
The text decoration applied to the button's text when hovered, overriding
the theme default if provided. Applied during mouse hover for visual
feedback.
final
- iconData → IconData?
-
The icon of the date picker button, defaults to LucideIcons.calendar.
final
- initialMonth → DateTime?
-
The month to show by default, defaults to the current month.
final
- insideRangeDayButtonTextStyle → TextStyle?
-
The text style of the inside range day button, defaults to
final
- insideRangeDayButtonVariant → ShadButtonVariant?
-
The variant of the inside range day button, defaults to
ShadButtonVariant.secondary
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- leading → Widget?
-
The widget displayed before the main
child, typically an icon or small graphic. Positioned according to mainAxisAlignment and textDirection.final - longPressDuration → Duration?
-
The duration required to trigger a long press, overriding the theme
default if provided. Controls the timing of onLongPress and related
callbacks.
final
- mainAxisAlignment → MainAxisAlignment?
-
The main axis alignment of the button's content within its Row.
Defaults to MainAxisAlignment.center if not specified.
final
- max → int?
-
The maximum amount of days that can be selected.
final
- min → int?
-
The minimum amount of days that can be selected.
final
- monthConstraints → BoxConstraints?
-
The month constraints, defaults to
BoxConstraints(maxWidth: 252)orBoxConstraints(maxWidth: 310)depending on the hideNavigation and captionLayout values.final - monthSelectorMinWidth → double?
-
The minimum width of the month selector, defaults to 64
final
- monthSelectorPadding → EdgeInsetsGeometry?
-
The padding of the month selector, defaults to
EdgeInsets.symmetric(horizontal: 8, vertical: 4)final -
multipleSelected
→ List<
DateTime> ? -
The dates that are currently selected, defaults to null.
final
-
The opacity of the navigation button when disabled, defaults to .5
final
-
The navigation button icon size, defaults to 16
final
-
The padding of the navigation button, defaults to EdgeInsets.zero
final
-
The navigation button size, defaults to 28
final
- numberOfMonths → int
-
The number of displayed months, defaults to 1.
final
-
onChanged
→ ValueChanged<
DateTime?> ? -
Called when the user selects a date.
final
- onDoubleTap → VoidCallback?
-
Callback invoked when a double tap occurs.
For advanced gesture handling.
final
- onDoubleTapCancel → VoidCallback?
-
Callback invoked when a double tap is canceled.
For advanced gesture handling.
final
-
onDoubleTapDown
→ ValueChanged<
TapDownDetails> ? -
Callback invoked when a double tap begins, providing details.
For advanced gesture handling.
final
-
onFocusChange
→ ValueChanged<
bool> ? -
Callback invoked when the focus state changes, providing the new focus
value. Complements internal focus state management.
final
-
onHoverChange
→ ValueChanged<
bool> ? -
Callback invoked when the hover state changes, providing the new hover
value. Complements internal hover state management.
final
- onLongPress → VoidCallback?
-
The callback invoked when the button is long-pressed, adding long-press
functionality if provided. Controlled by longPressDuration for timing.
final
- onLongPressCancel → VoidCallback?
-
Callback invoked when a long press is canceled.
Part of long-press gesture handling.
final
-
onLongPressDown
→ ValueChanged<
LongPressDownDetails> ? -
Callback invoked when a long press is detected, providing details.
Part of long-press gesture handling.
final
-
onLongPressEnd
→ ValueChanged<
LongPressEndDetails> ? -
Callback invoked when a long press ends, providing details.
Part of long-press gesture handling.
final
-
onLongPressStart
→ ValueChanged<
LongPressStartDetails> ? -
Callback invoked when a long press begins, providing details.
Part of long-press gesture handling.
final
- onLongPressUp → VoidCallback?
-
Callback invoked when a long press ends by lifting.
Part of long-press gesture handling.
final
-
onMonthChanged
→ ValueChanged<
DateTime> ? -
A callback that is called when the month changes.
final
-
onMultipleChanged
→ ValueChanged<
List< ?DateTime> > -
Called when the user selects multiple dates.
final
- onPressed → VoidCallback?
-
The callback invoked when the button is tapped.
final
-
onRangeChanged
→ ValueChanged<
ShadDateTimeRange?> ? -
Called when the user selects a range of dates.
final
- onSecondaryTapCancel → VoidCallback?
-
Callback invoked when a secondary tap is canceled.
For advanced gesture handling.
final
-
onSecondaryTapDown
→ ValueChanged<
TapDownDetails> ? -
Callback invoked when a secondary (e.g., right-click) tap begins,
providing tap details. For advanced gesture handling.
final
-
onSecondaryTapUp
→ ValueChanged<
TapUpDetails> ? -
Callback invoked when a secondary tap ends, providing tap details.
For advanced gesture handling.
final
- onTapCancel → VoidCallback?
-
Callback invoked when a tap is canceled.
Resets the pressed state.
final
-
onTapDown
→ ValueChanged<
TapDownDetails> ? -
Callback invoked when a tap begins, providing tap details.
Triggers the pressed state visually.
final
-
onTapUp
→ ValueChanged<
TapUpDetails> ? -
Callback invoked when a tap ends, providing tap details.
Ends the pressed state visually.
final
- placeholder → Widget?
-
The placeholder of the date picker, shown when no date is selected.
final
- popoverController → ShadPopoverController?
-
The ShadPopoverController to use.
final
- popoverDecoration → ShadDecoration?
-
The decoration of the
popover.final - popoverPadding → EdgeInsetsGeometry?
-
The padding of the
popover, defaults toEdgeInsets.symmetric(horizontal: 12, vertical: 6).final - popoverReverseDuration → Duration?
-
The duration of the popover's exit animation.
final
- pressedBackgroundColor → Color?
-
The background color of the button when pressed, overriding the theme
default if provided. Applied during tap or long-press interactions.
final
- pressedForegroundColor → Color?
-
The foreground color of the button when pressed, overriding the theme
default if provided. Applied to content during tap or long-press
interactions.
final
- reverseMonths → bool
-
Whether to reverse the months, defaults to false.
final
- runSpacingBetweenMonths → double?
-
The run spacing between months, defaults to 16
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectableDayPredicate → bool Function(DateTime day)?
-
A function that determines whether a day is selectable.
final
- selected → DateTime?
-
The selected date, defaults to
null.final - selectedDayButtonOusideMonthVariant → ShadButtonVariant?
-
The variant of the selected day buttons outside the month, defaults to
ShadButtonVariant.secondary
final
- selectedDayButtonTextStyle → TextStyle?
-
The text style of the selected day button, defaults to
final
- selectedDayButtonVariant → ShadButtonVariant?
-
The variant of the selected day button, defaults to
ShadButtonVariant.primary
final
- selectedRange → ShadDateTimeRange?
-
The selected range, defaults to
null.final -
shadows
→ List<
BoxShadow> ? -
The shadows applied to the
popover, defaults to ShadShadows.md.final - showOutsideDays → bool?
-
Whether to show days outside the current month, defaults to true.
final
- showWeekNumbers → bool?
-
Whether to show week numbers, defaults to false.
final
- size → ShadButtonSize?
-
The size of the button, one of ShadButtonSize options (regular, sm, lg).
Affects dimensions and padding unless overridden by width, height, or
padding.final - spacingBetweenMonths → double?
-
The spacing between months, defaults to 16
final
- statesController → ShadStatesController?
-
The controller for managing button states (e.g., hovered, pressed,
focused). If null, an internal controller is created.
final
- textDecoration → TextDecoration?
-
The text decoration applied to the button's text when not hovered,
overriding the theme default if provided. E.g., TextDecoration.underline
for styling.
final
- textDirection → TextDirection?
-
The text direction for the button's content, overriding the default if
specified. Can be set to TextDirection.ltr or TextDirection.rtl.
final
- todayButtonVariant → ShadButtonVariant?
-
The variant of the today button, defaults to ShadButtonVariant.secondary
final
- toMonth → DateTime?
-
The month to end the calendar with, defaults to null.
final
- trailing → Widget?
-
The widget displayed after the main
child, typically an icon or small graphic. Positioned according to mainAxisAlignment and textDirection.final - useSameGroupIdForChild → bool
-
Whether the groupId should be used for the child widget, defaults to
true. This teams that taps on the child widget will be handled as inside the popover.final - variant → ShadDatePickerVariant
-
The variant of the date picker.
final
- weekdaysPadding → EdgeInsetsGeometry?
-
The padding of the weekdays, defaults to
EdgeInsets.only(bottom: 8)final - weekdaysTextAlign → TextAlign?
-
The text align of the weekdays, defaults to TextAlign.center
final
- weekdaysTextStyle → TextStyle?
-
The text style of the weekdays, defaults to
textTheme.muted.copyWith(fontSize: 12.8)final - weekNumbersHeaderText → String?
-
The header text of the week numbers, defaults to
#final - weekNumbersHeaderTextStyle → TextStyle?
-
The header text style of the week numbers, defaults to
textTheme.muted.copyWith(fontSize: 12.8)final - weekNumbersTextAlign → TextAlign?
-
The text align of the week numbers, defaults to TextAlign.center
final
- weekNumbersTextStyle → TextStyle?
-
The text style of the week numbers, defaults to
textTheme.muted.copyWith(fontSize: 12.8)final - weekStartsOn → int?
-
Which day of the week is the first day of the week.
final
- width → double?
-
The explicit minimum width of the button, overriding size-based defaults.
If null, it falls back to theme or size-specific minimums. When set to 0,
or a value smaller than the child's width the button's width will be
determined by its child.
final
- yearSelectorMinWidth → double?
-
The minimum width of the year selector, defaults to 64
final
- yearSelectorPadding → EdgeInsetsGeometry?
-
The padding of the year selector, defaults to
EdgeInsets.symmetric(horizontal: 8, vertical: 4)final
Methods
-
animate(
{Key? key, List< Effect> ? effects, AnimateCallback? onInit, AnimateCallback? onPlay, AnimateCallback? onComplete, bool? autoPlay, Duration? delay, AnimationController? controller, Adapter? adapter, double? target, double? value}) → Animate -
Available on Widget, provided by the AnimateWidgetExtensions extension
Wraps the target Widget in an Animate instance, and returns the instance for chaining calls. Ex.myWidget.animate()is equivalent toAnimate(child: myWidget). -
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< ShadDatePicker> -
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
-
positionedWith(
ShadPosition position) → Widget -
Available on Widget, provided by the PositionedExt extension
-
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