This commit is contained in:
2026-07-13 01:38:13 +03:00
parent 9eda119527
commit 98c5a7a1d1
54 changed files with 860 additions and 454 deletions

View File

@@ -1,27 +1,43 @@
import '../../domain/entities/client_notification.dart';
enum NotificationsStatus { initial, loading, success, failure }
enum NotificationsStatus { initial, loading, loadingMore, success, failure }
class NotificationsState {
final NotificationsStatus status;
final List<ClientNotification> notifications;
final String? errorMessage;
final int currentPage;
final int totalPages;
final bool hasMore;
final bool isLoadingMore;
const NotificationsState({
this.status = NotificationsStatus.initial,
this.notifications = const [],
this.errorMessage,
this.currentPage = 1,
this.totalPages = 1,
this.hasMore = true,
this.isLoadingMore = false,
});
NotificationsState copyWith({
NotificationsStatus? status,
List<ClientNotification>? notifications,
String? errorMessage,
int? currentPage,
int? totalPages,
bool? hasMore,
bool? isLoadingMore,
}) {
return NotificationsState(
status: status ?? this.status,
notifications: notifications ?? this.notifications,
errorMessage: errorMessage ?? this.errorMessage,
currentPage: currentPage ?? this.currentPage,
totalPages: totalPages ?? this.totalPages,
hasMore: hasMore ?? this.hasMore,
isLoadingMore: isLoadingMore ?? this.isLoadingMore,
);
}
}