getErrorCodesFromString function

ErrorCodes? getErrorCodesFromString(
  1. String value
)

Return the error codes from value.

Implementation

ErrorCodes? getErrorCodesFromString(String value) {
  final errorCodes = ErrorCodes.values
      .where((e) => e.toString() == 'ErrorCodes.$value');

  if (errorCodes.isNotEmpty)
    return errorCodes.first;

  return null;
}