DateTimeField constructor

DateTimeField({
  1. required ValueChanged<DateTime?>? onChanged,
  2. Key? key,
  3. DateTime? value,
  4. VoidCallback? onTap,
  5. TextStyle? style,
  6. FocusNode? focusNode,
  7. bool autofocus = false,
  8. bool? enableFeedback,
  9. EdgeInsetsGeometry? padding,
  10. bool hideDefaultSuffixIcon = false,
  11. InputDecoration? decoration,
  12. DateTime? initialPickerDateTime,
  13. CupertinoDatePickerOptions cupertinoDatePickerOptions = const CupertinoDatePickerOptions(),
  14. MaterialDatePickerOptions materialDatePickerOptions = const MaterialDatePickerOptions(),
  15. MaterialTimePickerOptions materialTimePickerOptions = const MaterialTimePickerOptions(),
  16. DateTimeFieldPickerMode mode = DateTimeFieldPickerMode.dateAndTime,
  17. DateTimeFieldPickerPlatform pickerPlatform = DateTimeFieldPickerPlatform.adaptive,
  18. DateTime? firstDate,
  19. DateTime? lastDate,
  20. DateFormat? dateFormat,
})

Implementation

DateTimeField({
  required this.onChanged,
  super.key,
  this.value,
  this.onTap,
  this.style,
  this.focusNode,
  this.autofocus = false,
  this.enableFeedback,
  this.padding,
  this.hideDefaultSuffixIcon = false,
  this.decoration,
  this.initialPickerDateTime,
  this.cupertinoDatePickerOptions = const CupertinoDatePickerOptions(),
  this.materialDatePickerOptions = const MaterialDatePickerOptions(),
  this.materialTimePickerOptions = const MaterialTimePickerOptions(),
  this.mode = DateTimeFieldPickerMode.dateAndTime,
  this.pickerPlatform = DateTimeFieldPickerPlatform.adaptive,
  DateTime? firstDate,
  DateTime? lastDate,
  DateFormat? dateFormat,
})  : dateFormat = dateFormat ?? mode.toDateFormat(),
      firstDate = firstDate ?? kDefaultFirstSelectableDate,
      lastDate = lastDate ?? kDefaultLastSelectableDate;