news page
This commit is contained in:
27
lib/features/news/domain/repositories/news_repository.dart
Normal file
27
lib/features/news/domain/repositories/news_repository.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
/// Domain Repository Interface: News Repository
|
||||
///
|
||||
/// Defines the contract for news article data operations.
|
||||
/// This is an abstract interface following the Repository Pattern.
|
||||
library;
|
||||
|
||||
import 'package:worker/features/news/domain/entities/news_article.dart';
|
||||
|
||||
/// News Repository Interface
|
||||
///
|
||||
/// Provides methods to fetch and manage news articles.
|
||||
abstract class NewsRepository {
|
||||
/// Get all news articles
|
||||
Future<List<NewsArticle>> getAllArticles();
|
||||
|
||||
/// Get featured article
|
||||
Future<NewsArticle?> getFeaturedArticle();
|
||||
|
||||
/// Get articles by category
|
||||
Future<List<NewsArticle>> getArticlesByCategory(NewsCategory category);
|
||||
|
||||
/// Get a specific article by ID
|
||||
Future<NewsArticle?> getArticleById(String articleId);
|
||||
|
||||
/// Refresh articles from server
|
||||
Future<List<NewsArticle>> refreshArticles();
|
||||
}
|
||||
Reference in New Issue
Block a user