DateTextField constructor
DateTextField({
- Key? key,
- ValueNotifier<
DateTime?> ? controller, - FocusNode? focusNode,
- InputDecoration decoration = const InputDecoration(),
- TextInputType? keyboardType,
- TextInputAction? textInputAction,
- TextCapitalization textCapitalization = TextCapitalization.none,
- TextStyle? style,
- TextAlign textAlign = TextAlign.start,
- TextDirection? textDirection,
- bool autofocus = false,
- bool obscureText = false,
- bool autocorrect = true,
- int maxLines = 1,
- int? maxLength,
- bool maxLengthEnforced = true,
- ValueChanged<
String> ? onChanged, - VoidCallback? onEditingComplete,
- ValueChanged<
String> ? onSubmitted, - List<
TextInputFormatter> ? inputFormatters, - bool enabled = true,
- double cursorWidth = 2.0,
- Radius? cursorRadius,
- Color? cursorColor,
- Brightness? keyboardAppearance,
- EdgeInsets scrollPadding = const EdgeInsets.all(20.0),
- bool enableInteractiveSelection = true,
- GestureTapCallback? onTap,
- VoidCallback? clearButtonAction,
- Color? clearButtonColor,
- IconData? clearButtonIcon,
- DateTimePickerMode dateTimePickerMode = DateTimePickerMode.BOTH,
- String dateFormat = DATE_FORMAT,
- DateTime? defaultDate,
- OnDateTimeSelected? onDateTimeSelected,
- Locale? locale,
Implementation
DateTextField({
this.key,
ValueNotifier<DateTime?>? controller,
this.focusNode,
this.decoration = const InputDecoration(),
this.keyboardType,
this.textInputAction,
this.textCapitalization = TextCapitalization.none,
this.style,
this.textAlign = TextAlign.start,
this.textDirection,
this.autofocus = false,
this.obscureText = false,
this.autocorrect = true,
this.maxLines = 1,
this.maxLength,
this.maxLengthEnforced = true,
this.onChanged,
this.onEditingComplete,
this.onSubmitted,
this.inputFormatters,
this.enabled = true,
this.cursorWidth = 2.0,
this.cursorRadius,
this.cursorColor,
this.keyboardAppearance,
this.scrollPadding = const EdgeInsets.all(20.0),
this.enableInteractiveSelection = true,
this.onTap,
this.clearButtonAction,
this.clearButtonColor,
this.clearButtonIcon,
this.dateTimePickerMode = DateTimePickerMode.BOTH,
this.dateFormat = DATE_FORMAT,
this.defaultDate,
this.onDateTimeSelected,
this.locale,
}) : controller = controller ??= ValueNotifier<DateTime?>(defaultDate) {
if (controller.value != null) {
textController.text = Intl.DateFormat(dateFormat, locale?.toString())
.format(controller.value!);
}
}