FDateField.calendar constructor

FDateField.calendar({
  1. FDateFieldController? controller,
  2. FDateFieldStyle style(
    1. FDateFieldStyle style
    )?,
  3. DateTime? initialDate,
  4. DateFormat? format,
  5. TextAlign textAlign,
  6. TextAlignVertical? textAlignVertical,
  7. TextDirection? textDirection,
  8. bool expands,
  9. MouseCursor mouseCursor,
  10. bool canRequestFocus,
  11. bool clearable,
  12. String? hint,
  13. bool autofocus,
  14. FocusNode? focusNode,
  15. ValueWidgetBuilder<FCalendarDayData> dayBuilder,
  16. DateTime? start,
  17. DateTime? end,
  18. DateTime? today,
  19. FCalendarPickerType initialType,
  20. bool autoHide,
  21. Alignment anchor,
  22. Alignment inputAnchor,
  23. FPortalSpacing spacing,
  24. Offset shift(
    1. Size,
    2. FPortalChildBox,
    3. FPortalBox
    ),
  25. Offset offset,
  26. FPopoverHideRegion hideRegion,
  27. VoidCallback? onTapHide,
  28. FFieldBuilder<FDateFieldStyle> builder,
  29. FFieldIconBuilder<FDateFieldStyle>? prefixBuilder,
  30. FFieldIconBuilder<FDateFieldStyle>? suffixBuilder,
  31. Widget? label,
  32. Widget? description,
  33. bool enabled,
  34. ValueChanged<DateTime?>? onChange,
  35. FormFieldSetter<DateTime>? onSaved,
  36. VoidCallback? onReset,
  37. AutovalidateMode autovalidateMode,
  38. String? forceErrorText,
  39. Widget errorBuilder(
    1. BuildContext context,
    2. String message
    ),
  40. 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. Defaults to the d MMM y in the current locale.

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 inputAnchor 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 shift function controls how the picker repositions when space is constrained. Defaults to FPortalShift.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

factory FDateField.calendar({
  FDateFieldController? controller,
  FDateFieldStyle Function(FDateFieldStyle style)? style,
  DateTime? initialDate,
  DateFormat? format,
  TextAlign textAlign,
  TextAlignVertical? textAlignVertical,
  TextDirection? textDirection,
  bool expands,
  MouseCursor mouseCursor,
  bool canRequestFocus,
  bool clearable,
  String? hint,
  bool autofocus,
  FocusNode? focusNode,
  ValueWidgetBuilder<FCalendarDayData> dayBuilder,
  DateTime? start,
  DateTime? end,
  DateTime? today,
  FCalendarPickerType initialType,
  bool autoHide,
  Alignment anchor,
  Alignment inputAnchor,
  FPortalSpacing spacing,
  Offset Function(Size, FPortalChildBox, FPortalBox) shift,
  Offset offset,
  FPopoverHideRegion hideRegion,
  VoidCallback? onTapHide,
  FFieldBuilder<FDateFieldStyle> builder,
  FFieldIconBuilder<FDateFieldStyle>? prefixBuilder,
  FFieldIconBuilder<FDateFieldStyle>? suffixBuilder,
  Widget? label,
  Widget? description,
  bool enabled,
  ValueChanged<DateTime?>? onChange,
  FormFieldSetter<DateTime>? onSaved,
  VoidCallback? onReset,
  AutovalidateMode autovalidateMode,
  String? forceErrorText,
  Widget Function(BuildContext context, String message) errorBuilder,
  Key? key,
}) = _CalendarDateField;