add notification, fix appbar,fix style subscription
This commit is contained in:
27
lib/presentation/state/notifications_state.dart
Normal file
27
lib/presentation/state/notifications_state.dart
Normal file
@@ -0,0 +1,27 @@
|
||||
import '../../domain/entities/client_notification.dart';
|
||||
|
||||
enum NotificationsStatus { initial, loading, success, failure }
|
||||
|
||||
class NotificationsState {
|
||||
final NotificationsStatus status;
|
||||
final List<ClientNotification> notifications;
|
||||
final String? errorMessage;
|
||||
|
||||
const NotificationsState({
|
||||
this.status = NotificationsStatus.initial,
|
||||
this.notifications = const [],
|
||||
this.errorMessage,
|
||||
});
|
||||
|
||||
NotificationsState copyWith({
|
||||
NotificationsStatus? status,
|
||||
List<ClientNotification>? notifications,
|
||||
String? errorMessage,
|
||||
}) {
|
||||
return NotificationsState(
|
||||
status: status ?? this.status,
|
||||
notifications: notifications ?? this.notifications,
|
||||
errorMessage: errorMessage ?? this.errorMessage,
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user