getCached<T> method
Future<Result<T> >
getCached<T>(
- String path, {
- Map<
String, dynamic> ? queryParameters, - FutureOr<
T> onSuccess(- dynamic data
- FutureOr<
T> onError(- dynamic data
override
Implementation
@override
Future<Result<T>> getCached<T>(
String path, {
Map<String, dynamic>? queryParameters,
FutureOr<T> Function(dynamic data)? onSuccess,
FutureOr<T> Function(dynamic data)? onError,
}) async {
final requestOptions = RequestOptions(
path: path,
queryParameters: queryParameters,
headers: _dio.options.headers,
);
return CacheResult(
data: await _resolveResult(
(await cacheHandler.get(requestOptions)),
onSuccess,
),
);
}