FDateField constructor

FDateField({
  1. FDateFieldController? controller,
  2. FDateFieldStyle style(
    1. FDateFieldStyle style
    )?,
  3. DateTime? initialDate,
  4. FocusNode? focusNode,
  5. TextInputAction? textInputAction,
  6. TextAlign textAlign,
  7. TextAlignVertical? textAlignVertical,
  8. TextDirection? textDirection,
  9. bool autofocus,
  10. bool expands,
  11. VoidCallback? onEditingComplete,
  12. ValueChanged<DateTime>? onSubmit,
  13. MouseCursor? mouseCursor,
  14. bool canRequestFocus,
  15. bool clearable,
  16. int baselineInputYear,
  17. FFieldBuilder<FDateFieldStyle> builder,
  18. FFieldIconBuilder<FDateFieldStyle>? prefixBuilder,
  19. FFieldIconBuilder<FDateFieldStyle>? suffixBuilder,
  20. FDateFieldCalendarProperties calendar,
  21. Widget? label,
  22. Widget? description,
  23. bool enabled,
  24. ValueChanged<DateTime?>? onChange,
  25. FormFieldSetter<DateTime>? onSaved,
  26. VoidCallback? onReset,
  27. AutovalidateMode autovalidateMode,
  28. String? forceErrorText,
  29. Widget errorBuilder(
    1. BuildContext context,
    2. String message
    ),
  30. 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:

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;