init method

CacheItem<Serializable> init(
  1. GetStorage storage, {
  2. bool resetMode = false,
})

Implementation

CacheItem init(final GetStorage storage, {final bool resetMode = false}) {
  this.storage = storage;
  if (resetMode) {
    clear();
  }
  final data = storage.read(key);
  if (data == null) {
    _log("Initialized Cache for: $key", type: PenType.success);
    storage.write(key, value);
  }
  return this;
}