ShadertoySiteClient class

A Shadertoy site API client

Provides an implementation of the ShadertoySite thus allowing the creation of a client to access all the methods provided by the shadertoy site API Please note that most of the implementations provided rely on some stability on the website design since data extraction is in some cases performed with web scrapping

Implemented types

Constructors

ShadertoySiteClient(ShadertoySiteOptions options, {Dio? client})
Creates a ShadertoySiteClient

Properties

client → Dio
Provides the Dio client instance build as part of this Shadertoy client instance
no setterinherited
context → ShadertoyContext
The ShadertoyContext object stores Shadertoy website contextual information
finalinherited
cookies Future<List<Cookie>>
Provides the list of Cookie received
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
loggedIn Future<bool>
Returns true when logged in, false otherwise
no setteroverride
options ShadertoySiteOptions
A object inheriting from ShadertoyHttpOptions
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

catchDioError<R extends APIResponse>(Future<R> future, R handle(DioError)) Future<R>
Catches and handles a DioError error in a future
inherited
clearCookies() → void
Clears the cookies
inherited
downloadMedia(String inputPath) Future<DownloadFileResponse>
Returns a DownloadFileResponse for a path inputPath
override
downloadShaderPicture(String shaderId) Future<DownloadFileResponse>
Returns a DownloadFileResponse for a shader with id shaderId
override
findAllShaderIds() Future<FindShaderIdsResponse>
Returns a FindShaderIdsResponse with all the shader id's
findAllShaderIdsByPlaylistId(String playlistId) Future<FindShaderIdsResponse>
Returns a FindShaderIdsResponse with all the shader id's for the playlist playlistId
findAllShaderIdsByUserId(String userId) Future<FindShaderIdsResponse>
Returns a FindShaderIdsResponse with all the shader id's for the user userId
findCommentsByShaderId(String shaderId) Future<FindCommentsResponse>
Returns a FindCommentsResponse for a shader with id shaderId
findPlaylistById(String playlistId) Future<FindPlaylistResponse>
Returns a FindPlaylistResponse for a playlist with playlistId
findShaderById(String shaderId) Future<FindShaderResponse>
Returns a FindShaderResponse for the shader with shaderId
findShaderIds({String? term, Set<String>? filters, Sort? sort, int? from, int? num}) Future<FindShaderIdsResponse>
Returns a filtered FindShaderIdsResponse with a list of shader ids.
findShaderIdsByPlaylistId(String playlistId, {int? from, int? num}) Future<FindShaderIdsResponse>
Returns a FindShaderIdsResponse with a list of shader ids.
findShaderIdsByUserId(String userId, {Set<String>? filters, Sort? sort, int? from, int? num}) Future<FindShaderIdsResponse>
Returns a filtered FindShaderIdsResponse with a list of shader ids. for the user userId
findShaders({String? term, Set<String>? filters, Sort? sort, int? from, int? num}) Future<FindShadersResponse>
Returns a filtered FindShadersResponse with a list of shaders
findShadersByIdSet(Set<String> ids) Future<FindShadersResponse>
Returns a FindShadersResponse for each shader id in shaderIds
findShadersByPlaylistId(String playlistId, {int? from, int? num}) Future<FindShadersResponse>
Returns a FindShadersResponse with a list of shaders. for the playlist playlistId
findShadersByUserId(String userId, {Set<String>? filters, Sort? sort, int? from, int? num}) Future<FindShadersResponse>
Returns a filtered FindShadersResponse for user userId
findUserById(String userId) Future<FindUserResponse>
Returns a FindUserResponse for user with userId
getPlaylistQuery(String playlistId, int num, {int? from}) String
Builds the playlist url used in the call to Shadertoy playlist page.
getResultsQuery(int num, {String? term, Set<String>? filters, Sort? sort, int? from}) String
Gets the results query
getUserQuery(String userId, {Set<String>? filters, Sort? sort, int? from}) String
Builds the user query url used in the call to Shadertoy user page in order to obtain both the user and the his shaders data.
isDioError(Object error) bool
Helper function to test if an object is a DioError
inherited
jsonResponse<R extends APIResponse>(Response response, R handler(dynamic data), {String? context, String? target}) → R
Reads the response and returns the appropiate object.
inherited
login() Future<LoginResponse>
Performs a login in shadertoy website
override
logout() Future<LogoutResponse>
Performs a logout in shadertoy website
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pooled<R>(Pool pool, FutureOr<R> fn()) Future<R>
Makes a call using a Pool
inherited
pooledRetry<R>(Pool pool, FutureOr<R> fn(), {RetryOptions? retryOptions}) Future<R>
Makes a call using a Pool whith retry semantics in case of error
inherited
toResponseError(DioError de, {String? context, String? target}) → ResponseError
Converts a DioError to a ResponseError
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited