attendanceClockTypeFromString function

AttendanceClockType? attendanceClockTypeFromString(
  1. String? type
)

Converts a string to an AttendanceClockType enum value.

Implementation

AttendanceClockType? attendanceClockTypeFromString(String? type) {
  switch (type) {
    /// Matches 'in' or 'clockin' and returns [AttendanceClockType.clockIn].
    case 'in':
    case 'clockin':
      return AttendanceClockType.clockIn;

    /// Matches 'out' or 'clockout' and returns [AttendanceClockType.clockOut].
    case 'out':
    case 'clockout':
      return AttendanceClockType.clockOut;

    /// Returns null for any other input.
    default:
      return null;
  }
}