TimePickerModel constructor
- required TimeOfDay initialTime,
- required DateTime selectedDate,
- Color primaryColor = defaultPrimaryColor,
- Color backgroundColor = defaultBackgroundColor,
- Color textColor = const Color.fromARGB(255, 30, 85, 139),
- Color errorColor = defaultErrorColor,
- Color disabledColor = defaultDisabledColor,
- String confirmText = 'Confirm',
- String cancelText = 'Cancel',
- String chooseTimeText = 'Choose Time',
- String hourLabel = 'hour',
- 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;
}