CustomApiServices class

Constructors

CustomApiServices({bool enableCache = true, String baseUrl = '', bool showPrint = false, Map<String, dynamic>? defaultHeaders})
factory

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shouldShowPrint bool
getter/setter pair

Methods

cancelAllRequests() → void
cancelRequest(String method, String url) → void
clearAuthToken() → void
clearCache() Future<void>
globalApisGetResponseDio({required String apiUrl, required Map<String, dynamic> request, bool showSuccessMessage = false, bool showErrorMessage = true, bool showPrints = false, bool load = false, bool jsonConversion = true, ApiMethod apiMethod = ApiMethod.post, Map<String, String>? customHeaders, CancelToken? cancelToken}) Future<Response?>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
request({required ApiMethod method, required String url, dynamic requestData, Map<String, dynamic>? headers, void authTokenCallback()?, Map<String, dynamic>? queryParameters, bool useWithoutToken = false, bool cacheResponse = false, Duration cacheDuration = const Duration(minutes: 30), bool forceOffline = false, CancelToken? cancelToken, void onSendProgress(int, int)?, void onReceiveProgress(int, int)?, BuildContext? context, bool showSuccessMessage = false, bool showErrorMessage = true, bool showErrorLog = true, bool showSuccessLog = true}) Future<ResponseModal>
requestAsync({required ApiMethod method, required String url, dynamic requestData, Map<String, dynamic>? headers, Map<String, dynamic>? queryParameters, bool useWithoutToken = false, bool cacheResponse = false, Duration cacheDuration = const Duration(minutes: 30), bool forceOffline = false, CancelToken? cancelToken, void onSendProgress(int sent, int total)?, void onReceiveProgress(int received, int total)?, void onProgressPercentage(double progress)?}) Future<ResponseModal>
setAuthBearerToken(String token) → void
toString() String
A string representation of this object.
inherited
uploadMultipartWithData({required String url, Map<String, dynamic>? body, Map<String, dynamic>? files, Map<String, dynamic>? headers, CancelToken? cancelToken, void onProgressPercentage(double progress)?}) Future
uploadMultipleFiles({required String url, required List<String> filePaths, String fileKey = 'files', Map<String, dynamic>? formData, Map<String, dynamic>? headers, bool useWithoutToken = false, bool cacheResponse = false, bool forceOffline = false, CancelToken? cancelToken, void onSendProgress(int, int)?, void onProgressPercentage(double progress)?}) Future<List<String>>

Operators

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

Static Properties

instance CustomApiServices
no setter