getErrorCodesFromString function
Returns the error codes from value
.
Implementation
ErrorCodes? getErrorCodesFromString(String value) {
final errorCodes = ErrorCodes.values.where((e) =>
e.toString() == value ||
e.toString() == 'ErrorCodes.${value.toUpperCase()}');
if (errorCodes.isNotEmpty) return errorCodes.first;
return null;
}