FDateField.input constructor

FDateField.input({
  1. FDateFieldController? controller,
  2. FDateFieldStyle style(
    1. FDateFieldStyle style
    )?,
  3. DateTime? initialDate,
  4. bool autofocus = false,
  5. FocusNode? focusNode,
  6. FFieldBuilder<FDateFieldStyle> builder = _fieldBuilder,
  7. FFieldIconBuilder<FDateFieldStyle>? prefixBuilder = defaultIconBuilder,
  8. FFieldIconBuilder<FDateFieldStyle>? suffixBuilder,
  9. TextInputAction? textInputAction,
  10. TextAlign textAlign = TextAlign.start,
  11. TextAlignVertical? textAlignVertical,
  12. TextDirection? textDirection,
  13. bool expands = false,
  14. VoidCallback? onEditingComplete,
  15. ValueChanged<DateTime>? onSubmit,
  16. MouseCursor? mouseCursor,
  17. bool canRequestFocus = true,
  18. bool clearable = false,
  19. int baselineInputYear = 2000,
  20. Widget? label,
  21. Widget? description,
  22. bool enabled = true,
  23. ValueChanged<DateTime?>? onChange,
  24. FormFieldSetter<DateTime>? onSaved,
  25. VoidCallback? onReset,
  26. AutovalidateMode autovalidateMode = AutovalidateMode.onUnfocus,
  27. String? forceErrorText,
  28. Widget errorBuilder(
    1. BuildContext context,
    2. String message
    ) = FFormFieldProperties.defaultErrorBuilder,
  29. Key? key,
})

Creates a date field that wraps a text input field.

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.

See also:

Implementation

factory FDateField.input({
  FDateFieldController? controller,
  FDateFieldStyle Function(FDateFieldStyle style)? style,
  DateTime? initialDate,
  bool autofocus = false,
  FocusNode? focusNode,
  FFieldBuilder<FDateFieldStyle> builder = _fieldBuilder,
  FFieldIconBuilder<FDateFieldStyle>? prefixBuilder = defaultIconBuilder,
  FFieldIconBuilder<FDateFieldStyle>? suffixBuilder,
  TextInputAction? textInputAction,
  TextAlign textAlign = TextAlign.start,
  TextAlignVertical? textAlignVertical,
  TextDirection? textDirection,
  bool expands = false,
  VoidCallback? onEditingComplete,
  ValueChanged<DateTime>? onSubmit,
  MouseCursor? mouseCursor,
  bool canRequestFocus = true,
  bool clearable = false,
  int baselineInputYear = 2000,
  Widget? label,
  Widget? description,
  bool enabled = true,
  ValueChanged<DateTime?>? onChange,
  FormFieldSetter<DateTime>? onSaved,
  VoidCallback? onReset,
  AutovalidateMode autovalidateMode = AutovalidateMode.onUnfocus,
  String? forceErrorText,
  Widget Function(BuildContext context, String message) errorBuilder = FFormFieldProperties.defaultErrorBuilder,
  Key? key,
}) => _InputDateField(
  controller: controller,
  style: style,
  initialDate: initialDate,
  autofocus: autofocus,
  focusNode: focusNode,
  builder: builder,
  prefixBuilder: prefixBuilder,
  suffixBuilder: suffixBuilder,
  clearable: clearable,
  textInputAction: textInputAction,
  textAlign: textAlign,
  textAlignVertical: textAlignVertical,
  textDirection: textDirection,
  expands: expands,
  onEditingComplete: onEditingComplete,
  onSubmit: onSubmit,
  mouseCursor: mouseCursor,
  canRequestFocus: canRequestFocus,
  baselineInputYear: baselineInputYear,
  calendar: null,
  label: label,
  description: description,
  enabled: enabled,
  onChange: onChange,
  onSaved: onSaved,
  onReset: onReset,
  autovalidateMode: autovalidateMode,
  forceErrorText: forceErrorText,
  errorBuilder: errorBuilder,
  key: key,
);