CachedMovieService class

A cached service that wraps MovieService with Hive caching capabilities.

Constructors

CachedMovieService.new(MovieService _movieService, HiveMovieCacheService _cacheService, {bool cachingEnabled = true, bool cacheOnlyMode = false})
Creates a new CachedMovieService instance.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

clearAllCache() Future<void>
Clears all cached data.
clearCache(CacheCategory category) Future<void>
Clears cache for a specific category.
dispose() → void
Disposes the service and its resources.
forceRefresh(CacheCategory category) Future<List<Movie>>
Forces refresh of cached data for a specific category.
forceRefreshAll() Future<Map<CacheCategory, List<Movie>>>
Forces refresh for all movie categories.
getCacheStats() Future<Map<CacheCategory, Map<String, dynamic>>>
Gets cache metadata for all categories.
getCacheStatsForCategory(CacheCategory category) Future<Map<String, dynamic>?>
Gets cache metadata for a specific category.
getMovieDetails(int movieId) Future<Movie>
Gets detailed information about a specific movie (no caching for details).
getNowPlayingMovies() Future<List<Movie>>
Get now playing movies with caching.
getNowPlayingMoviesWithCacheInfo() Future<CacheResult<List<Movie>>>
Get now playing movies with cache information.
getPopularMovies() Future<List<Movie>>
Get popular movies with caching.
getPopularMoviesWithCacheInfo() Future<CacheResult<List<Movie>>>
Get popular movies with cache information.
getTopRatedMovies() Future<List<Movie>>
Get top rated movies with caching.
getTopRatedMoviesWithCacheInfo() Future<CacheResult<List<Movie>>>
Get top rated movies with cache information.
getUpcomingMovies() Future<List<Movie>>
Get upcoming movies with caching.
getUpcomingMoviesWithCacheInfo() Future<CacheResult<List<Movie>>>
Get upcoming movies with cache information.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
searchMovies(String query) Future<List<Movie>>
Searches for movies (no caching for search results).
setCacheOnlyMode(bool cacheOnly) → void
Enables or disables offline mode.
setCachingEnabled(bool enabled) → void
Enables or disables caching.
toString() String
A string representation of this object.
inherited
updateApiKey() Future<void>
Updates the API key in the underlying service.

Operators

operator ==(Object other) bool
The equality operator.
inherited