mirror of
				https://gitlab.com/foxixus/neomovies_mobile.git
				synced 2025-10-29 02:38:49 +05:00 
			
		
		
		
	
		
			
	
	
		
			21 lines
		
	
	
		
			605 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
		
		
			
		
	
	
			21 lines
		
	
	
		
			605 B
		
	
	
	
		
			Dart
		
	
	
	
	
	
|  | import 'package:neomovies_mobile/data/api/api_client.dart'; | ||
|  | import 'package:neomovies_mobile/data/models/favorite.dart'; | ||
|  | 
 | ||
|  | class FavoritesRepository { | ||
|  |   final ApiClient _apiClient; | ||
|  | 
 | ||
|  |   FavoritesRepository(this._apiClient); | ||
|  | 
 | ||
|  |   Future<List<Favorite>> getFavorites() async { | ||
|  |     return await _apiClient.getFavorites(); | ||
|  |   } | ||
|  | 
 | ||
|  |   Future<void> addFavorite(String mediaId, String mediaType, String title, String posterPath) async { | ||
|  |     await _apiClient.addFavorite(mediaId, mediaType, title, posterPath); | ||
|  |   } | ||
|  | 
 | ||
|  |   Future<void> removeFavorite(String mediaId) async { | ||
|  |     await _apiClient.removeFavorite(mediaId); | ||
|  |   } | ||
|  | } |