FavoritesServiceManager class
Manager that switches between local and POD storage based on user preferences.
- Inheritance
-
- Object
- ChangeNotifier
- FavoritesServiceManager
Constructors
- FavoritesServiceManager.new(SharedPreferences _prefs, BuildContext _context, Widget _child)
- Creates a new FavoritesServiceManager instance.
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
- prefs → SharedPreferences
-
Gets the SharedPreferences instance.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
toWatchMovies
→ Stream<
List< Movie> > -
Stream of to-watch movies from the active service.
no setter
-
watchedMovies
→ Stream<
List< Movie> > -
Stream of watched movies from the active service.
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.
-
disablePodStorage(
) → Future< void> - Disables POD storage and reverts to local storage.
-
dispose(
) → void -
Discards any resources used by the object. After this is called, the
object is not in a usable state and should be discarded (calls to
addListener will throw after the object is disposed).
override
-
enablePodStorage(
) → Future< bool> - Enables POD storage and migrates data.
-
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). This is only relevant for POD storage.
-
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). This is only relevant for POD storage.
-
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
-
refreshUIStreams(
) → Future< void> - Refreshes UI streams with latest data from POD. This ensures the UI shows the most current data after app restart.
-
reloadPodDataAfterInit(
) → Future< void> - Reloads POD data after app folders are initialised.
-
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.
-
syncWithPod(
) → Future< void> - Syncs data with POD if POD storage is enabled.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited