FDateField.calendar constructor

const FDateField.calendar({
  1. FDateFieldControl control,
  2. FPopoverControl popoverControl,
  3. FTextFieldSizeVariant size,
  4. FDateFieldStyleDelta style,
  5. String format(
    1. BuildContext context,
    2. DateTime value,
    3. DateFormat format
    ),
  6. TextAlign textAlign,
  7. TextAlignVertical? textAlignVertical,
  8. TextDirection? textDirection,
  9. bool expands,
  10. MouseCursor mouseCursor,
  11. bool canRequestFocus,
  12. bool clearable,
  13. String? hint,
  14. bool autofocus,
  15. FocusNode? focusNode,
  16. Alignment anchor,
  17. Alignment fieldAnchor,
  18. FPortalSpacing spacing,
  19. FPortalOverflow overflow,
  20. Offset offset,
  21. bool useViewPadding,
  22. bool useViewInsets,
  23. FPopoverHideRegion hideRegion,
  24. Object? groupId,
  25. VoidCallback? onTapHide,
  26. bool cutout,
  27. void cutoutBuilder(
    1. Path path,
    2. Rect bounds
    ),
  28. FDateFieldPopoverBuilder popoverBuilder,
  29. ValueWidgetBuilder<FCalendarDayData> dayBuilder,
  30. DateTime? start,
  31. DateTime? end,
  32. DateTime? today,
  33. FCalendarPickerType initialType,
  34. bool autoHide,
  35. FFieldBuilder<FDateFieldStyle> builder,
  36. FFieldIconBuilder<FTextFieldStyle>? prefixBuilder,
  37. FFieldIconBuilder<FTextFieldStyle>? suffixBuilder,
  38. Widget? label,
  39. Widget? description,
  40. bool enabled,
  41. FormFieldSetter<DateTime>? onSaved,
  42. VoidCallback? onReset,
  43. AutovalidateMode autovalidateMode,
  44. String? forceErrorText,
  45. Widget errorBuilder(
    1. BuildContext context,
    2. String message
    ),
  46. Key? formFieldKey,
  47. Key? key,
})

Creates a FDateField that allows a date to be selected using only a calendar.

The format customizes the appearance of the date in the input field.

The hint is displayed when the input field is empty. Defaults to the current locale's FLocalizations.dateFieldHint.

The textAlign property is used to specify the alignment of the text within the input field.

The textAlignVertical property is used to specify the vertical alignment of the text and can be useful when used with a prefix or suffix.

The textDirection property can be used to specify the directionality of the text input.

If expands is true, the input field will expand to fill its parent's height.

The mouseCursor can be used to specify the cursor shown when hovering over the input field.

If canRequestFocus is false, the input field cannot obtain focus but can still be selected.

If clearable is true, the input field will show a clear button when a date is selected. Defaults to false.

The dayBuilder customizes the appearance of calendar day cells. Defaults to FCalendar.defaultDayBuilder.

The start and end parameters define the date range of selectable dates.

The today parameter specifies which date should be considered as "today". If not provided, uses the current date.

The initialType determines the initial calendar view (day, month, year).

When autoHide is true, the calendar will automatically hide after a date is selected.

The anchor and fieldAnchor control the alignment points for the calendar popover positioning. Defaults to Alignment.topLeft and Alignment.bottomLeft respectively.

The spacing property controls the spacing between the input field and the picker popover. Defaults to FPortalSpacing(4).

The overflow function controls how the picker repositions when space is constrained. Defaults to FPortalOverflow.flip.

The offset property controls the offset of the picker popover. Defaults to Offset.zero.

hideRegion controls the region that can be tapped to hide the popover. Defaults to FPopoverHideRegion.excludeChild.

See also:

  • FDateField - Creates a date field with both input field and calendar.
  • FDateField.input - Creates a date field with only an input field.

Implementation

const factory FDateField.calendar({
  FDateFieldControl control,
  FPopoverControl popoverControl,
  FTextFieldSizeVariant size,
  FDateFieldStyleDelta style,
  String Function(BuildContext context, DateTime value, DateFormat format) format,
  TextAlign textAlign,
  TextAlignVertical? textAlignVertical,
  TextDirection? textDirection,
  bool expands,
  MouseCursor mouseCursor,
  bool canRequestFocus,
  bool clearable,
  String? hint,
  bool autofocus,
  FocusNode? focusNode,
  Alignment anchor,
  Alignment fieldAnchor,
  FPortalSpacing spacing,
  FPortalOverflow overflow,
  Offset offset,
  bool useViewPadding,
  bool useViewInsets,
  FPopoverHideRegion hideRegion,
  Object? groupId,
  VoidCallback? onTapHide,
  bool cutout,
  void Function(Path path, Rect bounds) cutoutBuilder,
  FDateFieldPopoverBuilder popoverBuilder,
  ValueWidgetBuilder<FCalendarDayData> dayBuilder,
  DateTime? start,
  DateTime? end,
  DateTime? today,
  FCalendarPickerType initialType,
  bool autoHide,
  FFieldBuilder<FDateFieldStyle> builder,
  FFieldIconBuilder<FTextFieldStyle>? prefixBuilder,
  FFieldIconBuilder<FTextFieldStyle>? suffixBuilder,
  Widget? label,
  Widget? description,
  bool enabled,
  FormFieldSetter<DateTime>? onSaved,
  VoidCallback? onReset,
  AutovalidateMode autovalidateMode,
  String? forceErrorText,
  Widget Function(BuildContext context, String message) errorBuilder,
  Key? formFieldKey,
  Key? key,
}) = _CalendarDateField;