cacheServiceProvider top-level property

Provider<HiveMovieCacheService> cacheServiceProvider
final

Provider for the main application cache service using Hive.

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

Implementation

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

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

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

  return service;
});