51 lines
1.1 KiB
Dart
51 lines
1.1 KiB
Dart
import 'package:equatable/equatable.dart';
|
|
|
|
class NotificationItem extends Equatable {
|
|
final String id;
|
|
final String title;
|
|
final String body;
|
|
final DateTime date;
|
|
final bool isRead;
|
|
final String category; // 'finance', 'event', 'system'
|
|
|
|
const NotificationItem({
|
|
required this.id,
|
|
required this.title,
|
|
required this.body,
|
|
required this.date,
|
|
this.isRead = false,
|
|
required this.category,
|
|
});
|
|
|
|
@override
|
|
List<Object?> get props => [id, title, body, date, isRead, category];
|
|
}
|
|
|
|
abstract class NotificationState extends Equatable {
|
|
const NotificationState();
|
|
|
|
@override
|
|
List<Object?> get props => [];
|
|
}
|
|
|
|
class NotificationInitial extends NotificationState {}
|
|
|
|
class NotificationLoading extends NotificationState {}
|
|
|
|
class NotificationLoaded extends NotificationState {
|
|
final List<NotificationItem> items;
|
|
|
|
const NotificationLoaded({required this.items});
|
|
|
|
@override
|
|
List<Object?> get props => [items];
|
|
}
|
|
|
|
class NotificationError extends NotificationState {
|
|
final String message;
|
|
const NotificationError(this.message);
|
|
|
|
@override
|
|
List<Object?> get props => [message];
|
|
}
|