attendanceLogTypeFromString function

AttendanceLogType? attendanceLogTypeFromString(
  1. String type
)

Converts a string type to the corresponding AttendanceLogType enum value.

Implementation

AttendanceLogType? attendanceLogTypeFromString(String type) {
  switch (type) {
    case 'present':
      return AttendanceLogType.present;
    case 'late':
      return AttendanceLogType.late;
    case 'early_clock_out':
      return AttendanceLogType.earlyClockOut;
    case 'leave':
      return AttendanceLogType.leave;
    case 'holiday':
      return AttendanceLogType.holiday;
    case 'absent':
      return AttendanceLogType.absent;
    default:
      return null;
  }
}