delete method

  1. @override
Future<int> delete(
  1. int id
)
override

Deletes a cache object by id

Implementation

@override
Future<int> delete(int id) async {
  final cacheObject = _cacheObjects.values.firstWhereOrNull(
    (element) => element.id == id,
  );
  if (cacheObject == null) {
    return 0;
  }
  _remove(cacheObject);
  return 1;
}