hiveCacheServiceProvider top-level property

Provider<HiveMovieCacheService> hiveCacheServiceProvider
final

Provider for the Hive movie cache service.

This creates a singleton instance of HiveMovieCacheService that can be accessed throughout the application. The service will be automatically initialised when first accessed and disposed when the provider is disposed.

Implementation

final hiveCacheServiceProvider = Provider<HiveMovieCacheService>((ref) {
  final service = HiveMovieCacheService();

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

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

  return service;
});