init method

  1. @override
Future<void> init()
override

Implementation

@override
Future<void> init() async {
  Directory? dir;
  hasInit = true;
  if (storagePath == null) {
    dir = await getApplicationSupportDirectory();
  }
  final store =
      await newHiveDefaultCacheStore(path: storagePath ?? dir!.path);
  _cacheStore = await store.cache<FeedEntryModel>(
    name: name,
    maxEntries: cacheMaxEntries,
    fromEncodable: (json) => FeedEntryModel.fromJson(json),
    sampler: const FullSampler(),
    evictionPolicy: const FifoEvictionPolicy(),
  );
}