get method

Future get(
  1. RequestOptions options
)

Implementation

Future<dynamic> get(RequestOptions options) async {
  final cacheKey = _generateCacheKey(options);

  final data = await _storage.get(cacheKey);

  if (data == null) {
    return null;
  }

  final cacheModel = CacheModel.fromMap(data);

  if (cacheModel.isExpired) {
    await _storage.delete(cacheKey);

    return null;
  }

  return cacheModel.value;
}