The movies providers expose paginatedDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/juuaaann456/DMI-Practica06/llms.txt
Use this file to discover all available pages before exploring further.
List<Movie> state using Riverpod’s NotifierProvider. Every list-based provider shares the same MoviesNotifier class and differs only in which repository method it calls.
Provider overview
| Provider | Type | State | Repository method |
|---|---|---|---|
nowPlayingMoviesProvider | NotifierProvider | List<Movie> | getNowPlaying |
popularMoviesProvider | NotifierProvider | List<Movie> | getPopular |
upcomingMoviesProvider | NotifierProvider | List<Movie> | getUpcoming |
topratedMoviesProvider | NotifierProvider | List<Movie> | getTopRated |
mexicanMoviesProvider | NotifierProvider | List<Movie> | getMexicanMovies |
movieSlideShowProvider | Provider | List<Movie> | Derived — first 6 now-playing movies |
intialLoadingProvider | Provider | bool | Derived — true while any list is empty |
List providers
Each of the five list providers is declared withNotifierProvider and created with a MoviesNotifier that captures its specific fetch callback.
movies_providers.dart
Derived providers
movieSlideShowProvider
A read-only Provider<List<Movie>> that derives its value from nowPlayingMoviesProvider. It returns an empty list while now-playing movies are loading, otherwise it returns the first six entries for use in a hero slideshow.
movie_slideshow_provider.dart
intialLoadingProvider
A read-only Provider<bool> that returns true as long as any of the five movie lists is still empty. Widgets use this to show a full-screen loading indicator before the first page of data arrives.
initialLoading_provider.dart
MoviesNotifier
MoviesNotifier extends Riverpod’s Notifier<List<Movie>>. It accumulates pages of movies into its state list and guards against concurrent fetches with the isLoading flag.
movies_providers.dart
Fields
Tracks the last page number that was successfully fetched. Incremented before each API call inside
loadNextPage().Guard flag that prevents duplicate in-flight requests. Set to
true at the start of loadNextPage() and back to false once the fetch completes.Methods
build()
Called once by Riverpod when the notifier is first read. Resolves the fetchMoreMovies callback from the _callbackBuilder closure (which has access to ref) and returns an empty list as the initial state.
loadNextPage()
Appends the next page of movies to state. If a fetch is already in progress (isLoading == true), the call returns immediately. Otherwise it increments currentPage, awaits the API call, and spreads the results onto the existing state list.
Usage in a widget
CallloadNextPage() once on first build (or when the user scrolls to the bottom) by reading the notifier from ref.
home_screen.dart
All providers are exported from
lib/presentation/providers/providers.dart. Import that barrel file instead of individual provider files.