Endpoint class abstract
A base implementation of ApiEndpoint that provides common functionality for API endpoints.
- Implemented types
- Implementers
Constructors
-
Endpoint({Dio? dio, required String method, required String url, int validStatusCode = 200, EndpointAuthOptions? defaultAuthOptions, CacheOptions cacheOptions = const CacheOptions(cacheDuration: Duration.zero), Iterable<
Interceptor> interceptors = const {}}) - Creates an Endpoint instance.
Properties
- cacheOptions → CacheOptions
-
The configuration defining caching options.
final
- defaultAuthOptions → EndpointAuthOptions
-
The default authentication options for the endpoint.
final
- dio → Dio
-
The Dio instance used for making HTTP requests.
final
- domainUrl → String
-
The base URL for the API domain.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- method → String
-
The HTTP method for the API endpoint (e.g., 'GET', 'POST', 'PUT').
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- url → String
-
The URL of the API endpoint.
no setteroverride
- validStatusCode → int
-
The valid status code expected from the API response.
final
Methods
-
call<
T> ({EndpointAuthOptions? authOptions, Map< String, dynamic> ? queryParameters, Map<String, dynamic> ? pathParameters, Object? data, Map<String, dynamic> ? headers, T map(dynamic responseBody)?, EndpointErrorCallback? onError, ProgressCallback? onSendProgress, ProgressCallback? onReceiveProgress, bool isMultipart = false, bool ignoreCache = false, bool nullIfError = true}) → FutureOr<T?> -
Makes an API request to the endpoint and returns the parsed response of type
T.override -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited