FDateField.calendar constructor
- FDateFieldController? controller,
- FDateFieldStyle style(
- FDateFieldStyle 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 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 errorBuilder(
- BuildContext context,
- String message
- 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;