clockButtonTypeFromString function

ClockButtonType clockButtonTypeFromString(
  1. String type
)

Converts the provided type string to a ClockButtonType.

Implementation

ClockButtonType clockButtonTypeFromString(String type) {
  switch (type) {
    case 'clockin':
      return ClockButtonType.clockIn;
    case 'clockout':
      return ClockButtonType.clockOut;
    default:
      return ClockButtonType.none;
  }
}