static ErrorCode? fromCode(String code) { for (var value in values) { if (value.code == code) return value; } return null; }