ApiRequest class

Constructors

ApiRequest()
factory

Properties

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

Methods

clearCache(String endpoint, {Map<String, dynamic>? params}) → void
Clears cached API responses for a specific endpoint
getNamedDio(String name) → Dio
getThirdPartyDio(String baseUrl, {Map<String, String>? headers}) → Dio
Returns a new Dio instance for third-party API requests
initialize({required String baseUrl, Map<String, String>? globalHeaders, List<Interceptor>? interceptors}) Future<void>
Initializes API Client
initializeMultipleClients({required Map<String, String> baseUrls, Map<String, String>? globalHeaders, List<Interceptor>? interceptors}) Future<void>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
request({required String endpoint, required RequestMethod method, Map<String, dynamic>? params, Object? data, Map<String, String>? headers, String? contentType, Duration? cacheDuration, bool forceRefresh = false, bool isThirdParty = false, String? thirdPartyBaseUrl, String clientName = 'consumer'}) Future
General API request handler
toString() String
A string representation of this object.
inherited

Operators

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