RemoteRepository class
for Remote Repository
Owns everything between a described request and a resolved response: retries, de-duplication, cancellation and error normalisation. The transport itself is injected as an ApiProvider, so this class works unchanged over http, a mock, or any other implementation.
- Mixed-in types
Constructors
- RemoteRepository(ApiProvider provider, [String? defaultErrorMessage, RetryPolicy defaultRetryPolicy = RetryPolicy.none, bool deduplicate = true])
Properties
- deduplicate → bool
-
Whether identical in-flight requests share one network call.
final
- defaultErrorMessage → String?
-
final
- defaultRetryPolicy → RetryPolicy
-
Applied when a call supplies no RequestOptions.retry and the request
carries no ApiRequest.retryPolicy of its own.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- provider → ApiProvider
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
close(
) → void - Releases the transport.
-
formatErrorMessage(
dynamic error, String defaultErrorMessage) → ApiError -
Normalises an arbitrary throwable into an ApiError.
inherited
-
handleError<
ResultType, Item> (ApiResponse< ResultType, Item> response) → ApiResponse<ResultType, Item> -
handleRequest<
ResultType, Item> (ApiRequest< ResultType, Item> request, {int? timeout, RequestOptions options = const RequestOptions()}) → Future<ApiResponse< ResultType, Item> > - makes a network request
-
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