Files
be_happy_public/lib/presentation/state/notifications_state.dart
Polyanka 182be1049b some fix
# Conflicts:
#	lib/presentation/navigation/app_router.dart
#	pubspec.yaml
2026-08-11 00:23:16 +03:00

43 lines
1.3 KiB
Dart

import '../../domain/entities/client_notification.dart';
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,
);
}
}