downloadShaderPicture method

  1. @override
Future<DownloadFileResponse> downloadShaderPicture(
  1. String shaderId
)
override

Returns a DownloadFileResponse for a shader with id shaderId

On success DownloadFileResponse.bytes has the corresponding byte list and a null error

In case of error the error field has the corresponding ResponseError structure and a null DownloadFileResponse.bytes

Implementation

@override
Future<DownloadFileResponse> downloadShaderPicture(String shaderId) {
  return catchDioError<DownloadFileResponse>(
      client
          .get<List<int>>('/${context.getShaderPicturePath(shaderId)}',
              options: Options(responseType: ResponseType.bytes))
          .then((response) => DownloadFileResponse(bytes: response.data)),
      (de) => DownloadFileResponse(
          error:
              toResponseError(de, context: contextShader, target: shaderId)));
}