Connector class abstract

Abstract base class for an entire API integration.

Subclass Connector once per API. It owns the Dio singleton, declares the base URL, and provides default headers, query parameters, and options that are merged into every outgoing Request. Override the various hook getters to enable logging, debug output, or custom interceptors.

Constructors

Connector()

Properties

authenticator Authenticator?
The authenticator applied to all outgoing requests, or null for none.
no setter
debugMode bool
Whether debug mode is enabled. Defaults to false.
no setter
dio → Dio
The lazily-initialised Dio instance shared by all requests.
no setter
enableLogging bool
Whether request/response logging is enabled. Defaults to false.
no setter
hashCode int
The hash code for this object.
no setterinherited
interceptors List<Interceptor>
Additional Dio interceptors to attach to the dio instance.
no setter
onDebug LuckyDebugCallback?
User-supplied debug callback, or null to disable debug output.
no setter
onLog LuckyLogCallback?
User-supplied logging callback, or null to disable logging.
no setter
retryPolicy RetryPolicy?
The retry policy applied when a request fails, or null for no retry.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
throttlePolicy ThrottlePolicy?
The throttle policy applied before every request attempt, or null for no rate limiting.
no setter
throwOnError bool
Whether to throw a LuckyException for HTTP error responses (4xx/5xx).
no setter
useAuth bool
Whether authentication is enabled at the connector level. Defaults to true.
no setter

Methods

defaultHeaders() Map<String, String>?
Returns default headers applied to every request, or null for none.
defaultOptions() → Options?
Returns default Dio Options applied to every request, or null.
defaultQuery() Map<String, dynamic>?
Returns default query parameters applied to every request, or null.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
resolveBaseUrl() String
Returns the base URL for all requests made by this connector.
send(Request request) Future<LuckyResponse>
Sends request and returns the wrapped LuckyResponse.
toString() String
A string representation of this object.
inherited

Operators

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