DatePickerWidget constructor

DatePickerWidget({
  1. Key? key,
  2. DateTime? firstDate,
  3. DateTime? lastDate,
  4. DateTime? initialDate,
  5. String? dateFormat = DATETIME_PICKER_DATE_FORMAT,
  6. DateTimePickerLocale? locale = DATETIME_PICKER_LOCALE_DEFAULT,
  7. DateTimePickerTheme? pickerTheme = DateTimePickerTheme.Default,
  8. DateVoidCallback? onCancel,
  9. DateValueCallback? onChange,
  10. DateValueCallback? onConfirm,
  11. bool looping = false,
})

Implementation

DatePickerWidget({
  Key? key,
  this.firstDate,
  this.lastDate,
  this.initialDate,
  this.dateFormat = DATETIME_PICKER_DATE_FORMAT,
  this.locale = DATETIME_PICKER_LOCALE_DEFAULT,
  this.pickerTheme = DateTimePickerTheme.Default,
  this.onCancel,
  this.onChange,
  this.onConfirm,
  this.looping = false,
}) : super(key: key) {
  DateTime minTime = firstDate ?? DateTime.parse(DATE_PICKER_MIN_DATETIME);
  DateTime maxTime = lastDate ?? DateTime.parse(DATE_PICKER_MAX_DATETIME);
  assert(minTime.compareTo(maxTime) < 0);
}