ApiClientConfig class

Global configuration for the SmartApiClient

Constructors

ApiClientConfig({required String baseUrl, Duration defaultTimeout = const Duration(seconds: 30), Map<String, String> defaultHeaders = const {}, RetryPolicy retryPolicy = const RetryPolicy(), bool enableLogging = false, bool enableOfflineQueue = true, int? maxRateLimitPerMinute, Future<String?> authTokenProvider()?})
Creates an API client configuration
const

Properties

authTokenProvider → Future<String?> Function()?
Function to provide authentication token
final
baseUrl → String
Base URL for all API requests
final
defaultHeaders → Map<String, String>
Default headers to be added to all requests
final
defaultTimeout → Duration
Default timeout for requests
final
enableLogging → bool
Enable or disable request/response logging
final
enableOfflineQueue → bool
Enable or disable offline request queue
final
hashCode → int
The hash code for this object.
no setterinherited
maxRateLimitPerMinute → int?
Maximum number of requests allowed per minute (null means no limit)
final
retryPolicy → RetryPolicy
Retry policy configuration
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

copyWith({String? baseUrl, Duration? defaultTimeout, Map<String, String>? defaultHeaders, RetryPolicy? retryPolicy, bool? enableLogging, bool? enableOfflineQueue, int? maxRateLimitPerMinute, Future<String?> authTokenProvider()?}) → ApiClientConfig
Creates a copy of this configuration with updated values
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
override
validate() → bool
Validates the configuration

Operators

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