new project stable version

This commit is contained in:
2026-05-10 19:11:31 +03:00
commit 3616f84556
391 changed files with 23857 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
import '../../../domain/entities/news.dart';
enum NewsStatus { initial, loading, success, failure }
class NewsState {
final NewsStatus status;
final List<NewsEntity> news;
final String? errorMessage;
const NewsState({
required this.status,
this.news = const [],
this.errorMessage,
});
NewsState copyWith({
NewsStatus? status,
List<NewsEntity>? news,
String? errorMessage,
}) {
return NewsState(
status: status ?? this.status,
news: news ?? this.news,
errorMessage: errorMessage ?? this.errorMessage,
);
}
bool get isLoading => status == NewsStatus.loading;
bool get isSuccess => status == NewsStatus.success;
bool get isFailure => status == NewsStatus.failure;
}