removeWithKey method Null safety

void removeWithKey(
  1. String key,
  2. int? ts
)

Implementation

void removeWithKey(String key, int? ts) {
  final existData = _cachedDataMap[key];
  final time = ts ?? DateTime.now().millisecondsSinceEpoch;
  if (existData != null && existData.ts < time) {
    existData
      ..isRemoved = true
      ..ts = time;
  }

  if (_cachedDataMap.isEmpty) (policy as PeriodEviction).stop();
}