TimePickerModel constructor

TimePickerModel({
  1. required TimeOfDay initialTime,
  2. required DateTime selectedDate,
  3. Color primaryColor = defaultPrimaryColor,
  4. Color backgroundColor = defaultBackgroundColor,
  5. Color textColor = const Color.fromARGB(255, 30, 85, 139),
  6. Color errorColor = defaultErrorColor,
  7. Color disabledColor = defaultDisabledColor,
  8. String confirmText = 'Confirm',
  9. String cancelText = 'Cancel',
  10. String chooseTimeText = 'Choose Time',
  11. String hourLabel = 'hour',
  12. String minuteLabel = 'min',
})

Creates a new TimePickerModel with the specified parameters.

@param initialTime The initial time value that the time picker will display when first shown. @param selectedDate The date context for the time picker, used to determine if future times should be restricted. @param primaryColor The primary color used for highlights, headers, selected values, and the confirm button. @param backgroundColor The background color of the time picker dialog. @param textColor The general text color used throughout the time picker. @param errorColor The color used to indicate errors in input validation. @param disabledColor The color used for disabled elements like buttons. @param confirmText The text to display on the confirm button. @param cancelText The text to display on the cancel button. @param chooseTimeText The text to display as the header/title of the time picker. @param hourLabel The label text displayed above the hour selection wheel. @param minuteLabel The label text displayed above the minute selection wheel.

Implementation

TimePickerModel({
  required this.initialTime,
  required this.selectedDate,
  this.primaryColor = defaultPrimaryColor,
  this.backgroundColor = defaultBackgroundColor,
  this.textColor = const Color.fromARGB(255, 30, 85, 139),
  this.errorColor = defaultErrorColor,
  this.disabledColor = defaultDisabledColor,
  this.confirmText = 'Confirm',
  this.cancelText = 'Cancel',
  this.chooseTimeText = 'Choose Time',
  this.hourLabel = 'hour',
  this.minuteLabel = 'min',
}) {
  _selectedHour = initialTime.hour;
  _selectedMinute = initialTime.minute;
}