FavoritesService class

A service class that manages the user's movie lists.

Inheritance
Implementers

Constructors

FavoritesService.new(SharedPreferences _prefs)
Creates a new FavoritesService instance.

Properties

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

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.
addToWatched(Movie movie) Future<void>
Adds a movie to the watched list.
dispose() → void
Disposes the stream controllers.
override
getMovieComments(Movie movie) Future<String?>
Gets the personal comments for a movie.
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.
getPersonalRating(Movie movie) Future<double?>
Gets the user's personal rating for a movie.
getToWatch() Future<List<Movie>>
Retrieves the list of to-watch movies.
getWatched() Future<List<Movie>>
Retrieves the list of watched movies.
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.
isInToWatch(Movie movie) Future<bool>
Checks if a movie is in the to-watch list.
isInWatched(Movie movie) Future<bool>
Checks if a movie is in the watched list.
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.
removeFromWatched(Movie movie) Future<void>
Removes a movie from the watched list.
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.
removePersonalRating(Movie movie) Future<void>
Removes the user's personal rating for a movie.
setMovieComments(Movie movie, String comments) Future<void>
Sets the personal comments for a movie.
setPersonalRating(Movie movie, double rating) Future<void>
Sets the user's personal rating for a movie.
toString() String
A string representation of this object.
inherited

Operators

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