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
Properties
- authenticator → Authenticator?
-
The authenticator applied to all outgoing requests, or
nullfor none.no setter - debugMode → bool
-
Whether debug mode is enabled. Defaults to
false.no setter - dio → Dio
-
The lazily-initialised
Dioinstance 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
nullto disable debug output.no setter - onLog → LuckyLogCallback?
-
User-supplied logging callback, or
nullto disable logging.no setter - retryPolicy → RetryPolicy?
-
The retry policy applied when a request fails, or
nullfor 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
nullfor 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
nullfor none. -
defaultOptions(
) → Options? -
Returns default Dio
Optionsapplied to every request, ornull. -
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
requestand returns the wrapped LuckyResponse. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited