hiveCacheServiceFutureProvider top-level property

FutureProvider<HiveMovieCacheService> hiveCacheServiceFutureProvider
final

Provider for accessing the Hive cache service as a FutureProvider. This ensures the service is fully initialised before use.

Implementation

final hiveCacheServiceFutureProvider =
    FutureProvider<HiveMovieCacheService>((ref) async {
  final service = HiveMovieCacheService();
  await service.initialize();

  // Ensure the service is disposed when the provider is disposed.

  ref.onDispose(() {
    service.dispose();
  });

  return service;
});