DateTimePicker constructor

DateTimePicker({
  1. Key? key,
  2. PickerOptions<DateTime>? options,
  3. WheelOptions? wheelOptions,
  4. double height = kPickerDefaultHeight,
  5. double width = double.infinity,
  6. double? itemWidth,
  7. DateTimePickerUnit unit = const DateTimePickerUnit.all(),
  8. bool dual = true,
  9. DateTimePickerContentBuilder? itemBuilder,
  10. DateTimePickerChanged? onChanged,
  11. DateTime? startDate,
  12. DateTime? defaultDate,
  13. DateTime? endDate,
})

Implementation

DateTimePicker({
  super.key,
  super.options,
  super.wheelOptions,
  super.height = kPickerDefaultHeight,
  super.width = double.infinity,
  super.itemWidth,
  this.unit = const DateTimePickerUnit.all(),
  this.dual = true,
  this.itemBuilder,
  this.onChanged,
  DateTime? startDate,
  DateTime? defaultDate,
  DateTime? endDate,
})  : startDate =
          startDate ?? DateTime.now().subtract(const Duration(days: 1)),
      defaultDate = defaultDate ?? DateTime.now(),
      endDate = endDate ?? DateTime.now();