getFormattedTime method

String getFormattedTime()

Returns the selected time formatted as a string in 24-hour format (HH:MM).

The hours and minutes are zero-padded to ensure they are always two digits. @return A string representation of the selected time.

Implementation

String getFormattedTime() {
  return '${_selectedHour.toString().padLeft(2, '0')}:${_selectedMinute.toString().padLeft(2, '0')}';
}