movieServiceProvider top-level property
final
Provider for the movie service.
Implementation
final movieServiceProvider = Provider<MovieService>((ref) {
final apiKeyService = ref.watch(apiKeyServiceProvider);
// Watch the API key to trigger recreation when it changes.
ref.watch(apiKeyProvider);
final movieService = MovieService(apiKeyService);
// Ensure proper disposal.
ref.onDispose(() {
movieService.dispose();
});
return movieService;
});