FDateField constructor
- FDateFieldController? controller,
- FDateFieldStyle style(
- FDateFieldStyle style
- DateTime? initialDate,
- FocusNode? focusNode,
- TextInputAction? textInputAction,
- TextAlign textAlign,
- TextAlignVertical? textAlignVertical,
- TextDirection? textDirection,
- bool autofocus,
- bool expands,
- VoidCallback? onEditingComplete,
- ValueChanged<
DateTime> ? onSubmit, - MouseCursor? mouseCursor,
- bool canRequestFocus,
- bool clearable,
- int baselineInputYear,
- FFieldBuilder<
FDateFieldStyle> builder, - FFieldIconBuilder<
FDateFieldStyle> ? prefixBuilder, - FFieldIconBuilder<
FDateFieldStyle> ? suffixBuilder, - FDateFieldCalendarProperties calendar,
- 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 date selection through both an input field and a calendar popover.
The input field supports arrow key navigation:
- Up/Down arrows: Increment/decrement values
- Left/Right arrows: Move between date segments
The textInputAction
property can be used to specify the action button on the soft keyboard. 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 onEditingComplete
callback is called when the user submits the input field, such as by pressing the done
button on the keyboard.
The onSubmit
callback is called when the user submits a valid date value.
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 baselineInputYear
is used as a reference point for two-digit year input. Years will be interpreted as
being within 80 years before or 20 years after this year.
The calendar
property can be used to customize the appearance and behavior of the calendar popover.
See also:
- FDateField.calendar - Creates a date field with only a calendar.
- FDateField.input - Creates a date field with only an input field.
Implementation
factory FDateField({
FDateFieldController? controller,
FDateFieldStyle Function(FDateFieldStyle style)? style,
DateTime? initialDate,
FocusNode? focusNode,
TextInputAction? textInputAction,
TextAlign textAlign,
TextAlignVertical? textAlignVertical,
TextDirection? textDirection,
bool autofocus,
bool expands,
VoidCallback? onEditingComplete,
ValueChanged<DateTime>? onSubmit,
MouseCursor? mouseCursor,
bool canRequestFocus,
bool clearable,
int baselineInputYear,
FFieldBuilder<FDateFieldStyle> builder,
FFieldIconBuilder<FDateFieldStyle>? prefixBuilder,
FFieldIconBuilder<FDateFieldStyle>? suffixBuilder,
FDateFieldCalendarProperties calendar,
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,
}) = _InputDateField;