CustomApiServices class

Constructors

CustomApiServices.new({bool enableCache = true, String baseUrl = '', 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

Methods

cancelAllRequests() → void
cancelRequest(String method, String url) → void
clearAuthToken() → void
clearCache() Future<void>
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
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>>
uploadSingleFile({required String url, required String filePath, String fileKey = 'file', 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<String>

Operators

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

Static Properties

instance CustomApiServices
no setter