getByCode static method

StatusCode? getByCode(
  1. int code
)

Get HTTP status code from code

Implementation

static StatusCode? getByCode(final int code) {
  for (final StatusCode statusCode in StatusCode.values) {
    if (statusCode.code == code) {
      return statusCode;
    }
  }
  return null;
}