FormBuilderDateTimePicker constructor
FormBuilderDateTimePicker({
- Key? key,
- required String name,
- FormFieldValidator<
DateTime> ? validator, - DateTime? initialValue,
- InputDecoration decoration = const InputDecoration(),
- ValueChanged<
DateTime?> ? onChanged, - ValueTransformer<
DateTime?> ? valueTransformer, - bool enabled = true,
- FormFieldSetter<
DateTime> ? onSaved, - AutovalidateMode? autovalidateMode = AutovalidateMode.disabled,
- VoidCallback? onReset,
- FocusNode? focusNode,
- InputType inputType = InputType.both,
- EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
- double cursorWidth = 2.0,
- bool enableInteractiveSelection = true,
- Widget? resetIcon = const Icon(Icons.close),
- TimeOfDay initialTime = const TimeOfDay(hour: 12, minute: 0),
- TextInputType keyboardType = TextInputType.text,
- TextAlign textAlign = TextAlign.start,
- bool autofocus = false,
- bool obscureText = false,
- bool autocorrect = true,
- int? maxLines = 1,
- bool expands = false,
- DatePickerMode initialDatePickerMode = DatePickerMode.day,
- TransitionBuilder? transitionBuilder,
- TextCapitalization textCapitalization = TextCapitalization.none,
- DatePickerEntryMode initialEntryMode = DatePickerEntryMode.calendar,
- TimePickerEntryMode timePickerInitialEntryMode = TimePickerEntryMode.dial,
- DateFormat? format,
- DateTime? initialDate,
- DateTime? firstDate,
- DateTime? lastDate,
- DateTime? currentDate,
- Locale? locale,
- int? maxLength,
- TextDirection? textDirection,
- TextAlignVertical? textAlignVertical,
- ValueChanged<
DateTime?> ? onFieldSubmitted, - TextEditingController? controller,
- TextStyle? style,
- MaxLengthEnforcement maxLengthEnforcement = MaxLengthEnforcement.none,
- List<
TextInputFormatter> ? inputFormatters, - bool showCursor = false,
- int? minLines,
- TextInputAction? textInputAction,
- VoidCallback? onEditingComplete,
- InputCounterWidgetBuilder? buildCounter,
- Radius? cursorRadius,
- Color? cursorColor,
- Brightness? keyboardAppearance,
- String? cancelText,
- String? confirmText,
- String? errorFormatText,
- String? errorInvalidText,
- String? fieldHintText,
- String? fieldLabelText,
- String? helpText,
- RouteSettings? routeSettings,
- StrutStyle? strutStyle,
- SelectableDayPredicate? selectableDayPredicate,
- Offset? anchorPoint,
- EntryModeChangeCallback? onEntryModeChanged,
Creates field for Date
, Time
and DateTime
input
Implementation
FormBuilderDateTimePicker({
super.key,
required super.name,
super.validator,
super.initialValue,
super.decoration,
super.onChanged,
super.valueTransformer,
super.enabled,
super.onSaved,
super.autovalidateMode = AutovalidateMode.disabled,
super.onReset,
super.focusNode,
this.inputType = InputType.both,
this.scrollPadding = const EdgeInsets.all(20.0),
this.cursorWidth = 2.0,
this.enableInteractiveSelection = true,
this.resetIcon = const Icon(Icons.close),
this.initialTime = const TimeOfDay(hour: 12, minute: 0),
this.keyboardType = TextInputType.text,
this.textAlign = TextAlign.start,
this.autofocus = false,
this.obscureText = false,
this.autocorrect = true,
this.maxLines = 1,
this.expands = false,
this.initialDatePickerMode = DatePickerMode.day,
this.transitionBuilder,
this.textCapitalization = TextCapitalization.none,
this.useRootNavigator = true,
this.initialEntryMode = DatePickerEntryMode.calendar,
this.timePickerInitialEntryMode = TimePickerEntryMode.dial,
this.format,
this.initialDate,
this.firstDate,
this.lastDate,
this.currentDate,
this.locale,
this.maxLength,
this.textDirection,
this.textAlignVertical,
this.onFieldSubmitted,
this.controller,
this.style,
this.maxLengthEnforcement = MaxLengthEnforcement.none,
this.inputFormatters,
this.showCursor = false,
this.minLines,
this.textInputAction,
this.onEditingComplete,
this.buildCounter,
this.cursorRadius,
this.cursorColor,
this.keyboardAppearance,
this.cancelText,
this.confirmText,
this.errorFormatText,
this.errorInvalidText,
this.fieldHintText,
this.fieldLabelText,
this.helpText,
this.routeSettings,
this.strutStyle,
this.selectableDayPredicate,
this.anchorPoint,
this.onEntryModeChanged,
}) : super(
builder: (FormFieldState<DateTime?> field) {
final state = field as _FormBuilderDateTimePickerState;
return TextField(
textDirection: textDirection,
textAlign: textAlign,
textAlignVertical: textAlignVertical,
maxLength: maxLength,
autofocus: autofocus,
decoration: state.decoration,
readOnly: true,
enabled: state.enabled,
autocorrect: autocorrect,
controller: state._textFieldController,
focusNode: state.effectiveFocusNode,
inputFormatters: inputFormatters,
keyboardType: keyboardType,
maxLines: maxLines,
obscureText: obscureText,
showCursor: showCursor,
minLines: minLines,
expands: expands,
style: style,
onEditingComplete: onEditingComplete,
buildCounter: buildCounter,
cursorColor: cursorColor,
cursorRadius: cursorRadius,
cursorWidth: cursorWidth,
enableInteractiveSelection: enableInteractiveSelection,
keyboardAppearance: keyboardAppearance,
scrollPadding: scrollPadding,
strutStyle: strutStyle,
textCapitalization: textCapitalization,
textInputAction: textInputAction,
maxLengthEnforcement: maxLengthEnforcement,
);
},
);