Skip to content

Commit 6c723b6

Browse files
committed
feat(content_management): add archived content events
- Create ArchivedContentEvent base class - Add events for tab changes and loading archived content - Implement restore and delete events for headlines, topics, and sources
1 parent 392cb69 commit 6c723b6

File tree

1 file changed

+91
-0
lines changed

1 file changed

+91
-0
lines changed
Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
part of 'archived_content_bloc.dart';
2+
3+
sealed class ArchivedContentEvent extends Equatable {
4+
const ArchivedContentEvent();
5+
6+
@override
7+
List<Object?> get props => [];
8+
}
9+
10+
/// Event to change the active archived content tab.
11+
final class ArchivedContentTabChanged extends ArchivedContentEvent {
12+
const ArchivedContentTabChanged(this.tab);
13+
14+
final ArchivedContentTab tab;
15+
16+
@override
17+
List<Object?> get props => [tab];
18+
}
19+
20+
/// Event to request loading of archived headlines.
21+
final class LoadArchivedHeadlinesRequested extends ArchivedContentEvent {
22+
const LoadArchivedHeadlinesRequested({this.startAfterId, this.limit});
23+
24+
final String? startAfterId;
25+
final int? limit;
26+
27+
@override
28+
List<Object?> get props => [startAfterId, limit];
29+
}
30+
31+
/// Event to request loading of archived topics.
32+
final class LoadArchivedTopicsRequested extends ArchivedContentEvent {
33+
const LoadArchivedTopicsRequested({this.startAfterId, this.limit});
34+
35+
final String? startAfterId;
36+
final int? limit;
37+
38+
@override
39+
List<Object?> get props => [startAfterId, limit];
40+
}
41+
42+
/// Event to request loading of archived sources.
43+
final class LoadArchivedSourcesRequested extends ArchivedContentEvent {
44+
const LoadArchivedSourcesRequested({this.startAfterId, this.limit});
45+
46+
final String? startAfterId;
47+
final int? limit;
48+
49+
@override
50+
List<Object?> get props => [startAfterId, limit];
51+
}
52+
53+
/// Event to restore an archived headline.
54+
final class RestoreHeadlineRequested extends ArchivedContentEvent {
55+
const RestoreHeadlineRequested(this.id);
56+
57+
final String id;
58+
59+
@override
60+
List<Object?> get props => [id];
61+
}
62+
63+
/// Event to restore an archived topic.
64+
final class RestoreTopicRequested extends ArchivedContentEvent {
65+
const RestoreTopicRequested(this.id);
66+
67+
final String id;
68+
69+
@override
70+
List<Object?> get props => [id];
71+
}
72+
73+
/// Event to restore an archived source.
74+
final class RestoreSourceRequested extends ArchivedContentEvent {
75+
const RestoreSourceRequested(this.id);
76+
77+
final String id;
78+
79+
@override
80+
List<Object?> get props => [id];
81+
}
82+
83+
/// Event to permanently delete an archived headline.
84+
final class DeleteHeadlineForeverRequested extends ArchivedContentEvent {
85+
const DeleteHeadlineForeverRequested(this.id);
86+
87+
final String id;
88+
89+
@override
90+
List<Object?> get props => [id];
91+
}

0 commit comments

Comments
 (0)