getErrorCodesFromString function
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;
}