ImpakRetro class

A class that handles HTTP requests using the Dio package with customizable configurations.

This class allows making HTTP requests (such as GET, POST, etc.) with or without authentication, supports file uploads, and provides mechanisms for handling API errors and timeouts.

Constructors

ImpakRetro({bool userLogger = true, String? baseUrl, Interceptor? loggingInterceptor, String? authToken, int? timeout, TimeUnit? timeUnit})
Constructor for initializing ImpakRetro instance.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

call({required String path, required RequestMethod method, String? baseUrl, void onProgress(int, int)?, Canceller? canceller, bool useAuthToken = true, String? authorizationToken, Map<String, dynamic>? body, Map<String, dynamic>? headers, Map<String, dynamic>? queryParameters}) Future<ImpakResponse>
Makes a generic HTTP request and returns the response.
download({required String path, required String savePath, void onProgress(ReceivedDownloadSize, TotalDownloadSize)?, Canceller? canceller}) Future
formDataCall({required String path, required RequestMethod method, required ImpakRetroFormData formData, String? baseUrl, void onProgress(int, int)?, Canceller? canceller, bool useAuthToken = true, String? authorizationToken, Map<String, dynamic>? headers, Map<String, dynamic>? queryParameters}) Future<ImpakResponse>
Makes a form data HTTP request and returns the response.
init({bool useLogger = true, String? baseUrl, Interceptor? loggingInterceptor, String? authToken, int? timeout, TimeUnit? timeUnit}) → void
Initializes the Dio instance and configuration settings.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
typeSafeCall<T>({required String path, required RequestMethod method, required T successFromJson(dynamic), String? baseUrl, void onProgress(int, int)?, Canceller? canceller, bool useAuthToken = true, String? authorizationToken, Map<String, dynamic>? body, Map<String, dynamic>? headers, Map<String, dynamic>? queryParameters}) Future<ImpakRetroResponse<T>>
Makes a simple HTTP request with a type-safe response and returns the parsed data.
typeSafeFormDataCall<T>({required String path, required RequestMethod method, required ImpakRetroFormData formData, required T successFromJson(dynamic), String? baseUrl, void onProgress(int, int)?, Canceller? canceller, bool useAuthToken = true, String? authorizationToken, Map<String, dynamic>? headers, Map<String, dynamic>? queryParameters}) Future<ImpakRetroResponse<T>>
Makes an HTTP request with form data, and returns a type-safe response.

Operators

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

Static Properties

instance ImpakRetro
Singleton instance of ImpakRetro.
getter/setter pair

Static Methods

setAuthToken(String authToken) → void
Sets the authorization token for all requests.