DateTimePickerUltraDialog constructor

DateTimePickerUltraDialog({
  1. Key? key,
  2. bool showDatePicker = true,
  3. bool showTimePicker = true,
  4. String title = 'Tap here to open Date Time Dialog',
  5. Widget? titleWidget,
  6. dynamic onChangeDate(
    1. DateTime
    )?,
  7. dynamic onChangeTime(
    1. DateTime
    )?,
  8. dynamic onPress(
    1. DateTime
    )?,
  9. Color iconColor = Colors.grey,
  10. Color color = Colors.orangeAccent,
  11. Color dialogBoxColor = Colors.white,
  12. double borderRadius = 6,
  13. double textBoxwidth = 60,
  14. DateTime? selectedDate,
  15. TimeOfDay? initialTime,
})

Implementation

DateTimePickerUltraDialog({
  super.key,
  this.showDatePicker = true,
  this.showTimePicker = true,
  this.title = 'Tap here to open Date Time Dialog',
  this.titleWidget,
  this.onChangeDate,
  this.onChangeTime,
  this.onPress,
  this.iconColor = Colors.grey,
  this.color = Colors.orangeAccent,
  this.dialogBoxColor = Colors.white,
  this.borderRadius = 6,
  this.textBoxwidth = 60,
  DateTime? selectedDate,
  TimeOfDay? initialTime,
})  : selectedDate = selectedDate ?? DateTime.now(),
      initialTime = initialTime ?? TimeOfDay.now() {
  // Set the default value for initialTime if it's not provided
  // This code executes in the constructor body
  // This approach ensures the object is fully initialized
}