approvalRequestTypefromString function

ApprovalRequestType? approvalRequestTypefromString(
  1. String? type
)

Converts a string representation of an approval request type to the corresponding enum value.

The type parameter represents the string value to convert.

Returns the ApprovalRequestType enum value corresponding to the given string, or null if no match is found.

Implementation

ApprovalRequestType? approvalRequestTypefromString(String? type) {
  switch (type) {
    case 'awaiting':
      return ApprovalRequestType.awaiting;
    case 'rejected':
      return ApprovalRequestType.rejected;
    case 'approved':
      return ApprovalRequestType.approved;
    default:
      return null;
  }
}