fromValue static method

resvg_error fromValue(
  1. int value
)

Implementation

static resvg_error fromValue(int value) => switch (value) {
      0 => RESVG_OK,
      1 => RESVG_ERROR_NOT_AN_UTF8_STR,
      2 => RESVG_ERROR_FILE_OPEN_FAILED,
      3 => RESVG_ERROR_MALFORMED_GZIP,
      4 => RESVG_ERROR_ELEMENTS_LIMIT_REACHED,
      5 => RESVG_ERROR_INVALID_SIZE,
      6 => RESVG_ERROR_PARSING_FAILED,
      _ => throw ArgumentError("Unknown value for resvg_error: $value"),
    };