core library

Core is the library which will handle the core functionality related to the clash royale SDK.

Classes

Constants
A set of constants which will be used in the SDK.
Core
Provides a Core object which will be used to handle all the core related work. Like initializing MQTT, making request, etc.
DefaultResult
Provides a DefaultResult which contains the error or any message which will be used to send an BreakingBadQuotesException to the application.
Ensure
Provides Ensure object which will check all the parameters if they are valid or not.
Fiber<T>
Provides a Fibre object.
ILogger
The abstract class which will be used to make the calls for printing any messages on the console.
INetworkingModule
A network module which will be used to handle the request.
IRequestHandler
A class which will be used to start the request.
IResponse
A class which will contain the response of the IRequestHandler.
LazyLogger
The main class which will initiate the log calls.
Level
Represents the level of a log record.
Log
Inner logger class which will be used for printing the logs.
NetworkingModule
Provides a NetworkingModule to the Core.
Parameters
Represents all the data necessary to make a request to the API.
QuotesParams
A parameter class which will be used to get a single quote from Breaking Bad.
Request
Provides a Request which will contain the details for the request which needs to be done.
RequestHandler
Provides the RequestHandler.
Response
A response class which will contains all the required details of the request made.
Result
Represents the response from an API.
Results

Enums

RequestType
A set of RequestType which will be used to make different calls

Mixins

Quotes
A mixin for Quotes which will get the quotes from the Breaking Bad.

Extensions

RequestTypeExtension on RequestType
An extension on RequestType to get the details related to the request like the type and other time out parameters.

Functions

defaultFlow<P extends Parameters, R>({required Core core, required P params, required BodyDeserializer<R> serializer}) Future<R>
A method which will be used to make the http request from the given params and return the response of the type R.
getExceptionFromAny(dynamic error) BreakingBadQuotesException
Returns the BreakingBadQuotesException if any error occurs.
getExceptionFromDefaultResult(DefaultResult result) BreakingBadQuotesException
Returns the BreakingBadQuotesException by checking the DefaultResult.
injectLogger(String id) LazyLogger
Get a logger from the provider.
provideLogger<R>(ILogger logger, Future<R> body()) Future<R>
Provides a logger to the code inside body.
resultsFromMap(List str) List<Results>
resultsToMap(List<Results> data) String

Typedefs

BodyDeserializer<T> = T Function(dynamic body)
The body deserializer which will be used to parse the response body to the specified T class.

Exceptions / Errors

BreakingBadQuotesException
An exception thrown by the Clash Royale API SDK.
ForbiddenException
An exception thrown when a feature is not available for particular user.
InvalidArgumentsException
An exception thrown when some argument is invalid.
InvariantException
Exception thrown when one of the invariants of a method is broken.
MethodDisabledException
An exception thrown when a disabled API has been requested.
RequestCancelException
When the request was canceled due to some error.
RequestFailureException
When unable to complete the request
RequestOtherException
When some other exception has occurred which is unknown.
RequestTimeoutException
When the request timeout exception has occurred
UnknownException
An exception thrown when something unexpected happens in the SDK.