DataRepository class abstract
Data repository class that handles all the network calls an local data access
- Mixed in types
Constructors
- DataRepository(LocalRepository localRepository, RemoteRepository remoteRepository, [String? defaultErrorMessage])
Properties
- defaultErrorMessage → String?
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- localRepository → LocalRepository
-
final
- remoteRepository → RemoteRepository
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
formatErrorMessage<
E> (dynamic error, String defaultErrorMessage) → ApiError -
inherited
-
handleRequest<
ResultType, Item> (ApiRequest< ResultType, Item> request, {CacheDescription? cache, int timeout = 50, bool retryWithCache = false, bool retry = false}) → Future<ApiResponse< ResultType, Item> > - manages fetching data, decides where to fetch data from
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
shouldUseCache(
LocalRepository repository, CacheDescription? cache) → Future< bool> -
inherited
-
toString(
) → String -
A string representation of this object.
inherited
-
validateData<
ResultType, Item> (ApiResponse< ResultType, Item> response) → ResultType? -
validate data to be saved to cache is not an empty list
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited