prestashop_api library

You can make APIs public here.

Classes

BackgroundTransformer
The default Transformer for Dio.
BaseConfig
BaseOptions
The base config for the Dio instance, used by Dio.options.
CancelToken
Controls cancellation of Dio's requests.
Category
Dio
Dio enables you to make HTTP requests easily.
DioMixin
Display<T extends DisplayEnumValue>
ErrorInterceptorHandler
The handler for interceptors to handle error occurred during the request.
Filter<T extends FilterEnumValue>
FormData
A class to create readable "multipart/form-data" streams. It can be used to submit forms and file uploads to http server.
Headers
The headers class for requests and responses.
HttpClientAdapter
HttpAdapter is a bridge between Dio and HttpClient.
Id
Use this class when representing a list of IDs as strings. Utilizing a List
Interceptor
Interceptor helps to deal with RequestOptions, Response, and DioException during the lifecycle of a request before it reaches users.
Interceptors
A Queue-Model list for Interceptors.
InterceptorsWrapper
A helper class to create interceptors in ease.
Language
ListParam<T>
Indicates a param being used as queries or form data, and how does it gets formatted.
LogInterceptor
LogInterceptor is used to print logs during network requests. It should be the last interceptor added, otherwise modifications by following interceptors will not be logged. This is because the execution of interceptors is in the order of addition.
MultipartFile
A file to be uploaded as part of a MultipartRequest. This doesn't need to correspond to a physical file.
Options
Every request can pass an Options object which will be merged with Dio.options
PrestashopApi
A Dart package designed to simplify interaction with PrestaShop websites by providing streamlined API integration, automatic model generation, data serialization, and exception handling.
Product
QueuedInterceptor
Interceptor in queue.
QueuedInterceptorsWrapper
A helper class to create queued-interceptors in ease.
ReceivedEntity<T>
RedirectRecord
A record that records the redirection happens during requests, including status code, request method, and the location.
RequestInterceptorHandler
The handler for interceptors to handle before the request has been sent.
RequestOptions
The internal request option class that is the eventual result after BaseOptions and Options are composed.
Response<T>
The Response class contains the payload (could be transformed) that respond from the request, and other information of the response.
ResponseBody
The response wrapper class for adapters.
ResponseInterceptorHandler
The handler for interceptors to handle after respond.
Sort<SortFieldOrder>
SortFieldOrder<T extends SortEnumValue>
StockAvailable
SyncTransformer
If you want to custom the transformation of request/response data, you can provide a Transformer by your self, and replace the transformer by setting the Dio.transformer.
Transformer
Transformer allows changes to the request/response data before it is sent/received to/from the server.
UriBuilder
Caution! Only use productSpecificPrices with the products web service resource.

Enums

CategoryDisplayField
CategoryFilterField
CategorySortField
DioExceptionType
The exception enumeration indicates what type of exception has happened during requests.
FilterCondition
LanguageDisplayField
LanguageFilterField
LanguageSortField
ListFormat
Specifies the array format (a single parameter with multiple parameter or multiple parameters with the same name). and the separator for array items.
ProductDisplayField
ProductFilterField
ProductSortField
Protocol
ResponseType
Indicates which transformation should be applied to the response data.
StockAvailableDisplayField
StockAvailableFilterField
StockAvailableSortField

Mixins

OptionsMixin
The mixin class for options that provides common attributes.

Constants

categoryPath → const String
languagePath → const String
productPath → const String
stockAvailablePath → const String

Functions

buildHeaders(String apiKey) Map<String, String>
categoryToJsonMap<T>(Category category, bool keepEmptyFields) Map<String, dynamic>
Converts a Category object to a JSON-compatible map, optionally keeping empty fields.
getDisplayValue<T extends DisplayEnumValue>(List<T> fields) String
Returns, for example: field1,field2 … Only display fields in brackets full Display all fields
getFilterKey<U extends FilterEnumValue>(U field) String
Returns, for example:
getFilterValue<U extends FilterEnumValue>(Filter<U> filter) String
Returns, for example: 1|5 OR operator: list of possible values 1,10 Interval operator: define interval of possible values Wheels Literal value (not case sensitive) Whe% Begin operator: fields begins with the value (not case sensitive) %els End operator: fields ends with the value (not case sensitive) %hee% Contains operator: fields contains the value (not case sensitive)
getSortValue(List<SortFieldOrder<SortEnumValue>> sortFields) String
Returns, for example: field1_ASC, field2_DESC, field3_ASC The sort value is composed of a field name and the expected order separated by a _
prettyPrint<T>({String? tagText, required dynamic data, required Map<String, dynamic> toJsonMap(T, bool), bool keepEmptyFields = false}) → void
This file contains utility and helper methods used in the package. It provides common functionalities such as logging data in a pretty-printed JSON format, checking for emptiness of values, and parsing error responses from the Prestashop API. The file includes methods like:
productToJsonMap(Product product, bool keepEmptyFields) Map<String, dynamic>
Converts a Product object to a JSON-compatible map, optionally keeping empty fields.

Typedefs

DefaultTransformer = SyncTransformer
DioError = DioException
DioError describes the exception info when a request failed.
DioErrorType = DioExceptionType
Deprecated in favor of DioExceptionType and will be removed in future major versions.
HeaderForEachCallback = void Function(String name, List<String> values)
The signature that iterates header fields.
InterceptorErrorCallback = void Function(DioException error, ErrorInterceptorHandler handler)
The signature of Interceptor.onError.
InterceptorSendCallback = void Function(RequestOptions options, RequestInterceptorHandler handler)
The signature of Interceptor.onRequest.
InterceptorSuccessCallback = void Function(Response response, ResponseInterceptorHandler handler)
The signature of Interceptor.onResponse.
JsonDecodeCallback = FutureOr Function(String)
The callback definition for decoding a JSON string.
JsonEncodeCallback = FutureOr<String> Function(Object)
The callback definition for encoding a JSON object.
ProgressCallback = void Function(int count, int total)
The type of a progress listening callback when sending or receiving data.
RequestEncoder = FutureOr<List<int>> Function(String request, RequestOptions options)
The type of a request encoding callback.
ResponseDecoder = FutureOr<String?> Function(List<int> responseBytes, RequestOptions options, ResponseBody responseBody)
The type of a response decoding callback.
ValidateStatus = bool Function(int? status)
The type of a response status code validate callback.

Exceptions / Errors

DioException
DioException describes the exception info when a request failed.
HostLookupException
NoServerResponseException
NotNullableError<T>
A TypeError thrown by _checkNotNullable.
PrestashopError
RestApiException