FavoritesServiceAdapter class

Adapter that makes FavoritesServiceManager look like FavoritesService. This allows us to integrate POD storage without changing all existing screens. Includes caching functionality for better performance.

Inheritance

Constructors

FavoritesServiceAdapter.new(FavoritesServiceManager _manager)

Properties

hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
isPodStorageEnabled bool
Checks if POD storage is currently enabled.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
toWatchMovies Stream<List<Movie>>
Stream of to-watch movies.
no setteroverride
watchedMovies Stream<List<Movie>>
Stream of watched movies.
no setteroverride

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
addToWatch(Movie movie) Future<void>
Adds a movie to the to-watch list.
override
addToWatched(Movie movie) Future<void>
Adds a movie to the watched list.
override
clearAllCaches() → void
Clear all caches.
dispose() → void
Disposes the stream controllers.
override
disposeCache() → void
Clear all caches (no stream controllers to dispose).
forceRefreshToWatch() Future<List<Movie>>
Force refresh to-watch cache.
forceRefreshWatched() Future<List<Movie>>
Force refresh watched cache.
getCacheStats() Map<String, dynamic>
Get cache statistics for debugging.
getMovieComments(Movie movie) Future<String?>
Gets the personal comments for a movie.
override
getMovieFilePath(Movie movie) String?
Gets the file path for a movie file (used for sharing). Local storage doesn't have shareable file paths, so this returns null.
override
getPersonalRating(Movie movie) Future<double?>
Gets the user's personal rating for a movie.
override
getToWatch() Future<List<Movie>>
Retrieves the list of to-watch movies.
override
getWatched() Future<List<Movie>>
Retrieves the list of watched movies.
override
hasMovieFile(Movie movie) Future<bool>
Checks if a movie file exists (i.e. user has interacted with this movie). For local storage, this checks if the user has either a rating or comment.
override
isInToWatch(Movie movie) Future<bool>
Checks if a movie is in the to-watch list.
override
isInWatched(Movie movie) Future<bool>
Checks if a movie is in the watched list.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
removeFromToWatch(Movie movie) Future<void>
Removes a movie from the to-watch list.
override
removeFromWatched(Movie movie) Future<void>
Removes a movie from the watched list.
override
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
removeMovieComments(Movie movie) Future<void>
Removes the personal comments for a movie.
override
removePersonalRating(Movie movie) Future<void>
Removes the user's personal rating for a movie.
override
setMovieComments(Movie movie, String comments) Future<void>
Sets the personal comments for a movie.
override
setPersonalRating(Movie movie, double rating) Future<void>
Sets the user's personal rating for a movie.
override
toString() String
A string representation of this object.
inherited

Operators

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