Skip to content

Commit f50d62c

Browse files
committed
feat(content_management): add forceRefresh option to load requests
- Add forceRefresh parameter to LoadHeadlinesRequested, LoadTopicsRequested, and LoadSourcesRequested events - Update props list to include forceRefresh - Documentation: explain the purpose of forceRefresh in bypassing cache
1 parent 6c020a9 commit f50d62c

File tree

1 file changed

+27
-6
lines changed

1 file changed

+27
-6
lines changed

lib/content_management/bloc/content_management_event.dart

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,23 @@ final class ContentManagementTabChanged extends ContentManagementEvent {
2626
/// {@endtemplate}
2727
final class LoadHeadlinesRequested extends ContentManagementEvent {
2828
/// {@macro load_headlines_requested}
29-
const LoadHeadlinesRequested({this.startAfterId, this.limit});
29+
const LoadHeadlinesRequested({
30+
this.startAfterId,
31+
this.limit,
32+
this.forceRefresh = false,
33+
});
3034

3135
/// Optional ID to start pagination after.
3236
final String? startAfterId;
3337

3438
/// Optional maximum number of items to return.
3539
final int? limit;
3640

41+
/// If true, forces a refresh of the data, bypassing the cache.
42+
final bool forceRefresh;
43+
3744
@override
38-
List<Object?> get props => [startAfterId, limit];
45+
List<Object?> get props => [startAfterId, limit, forceRefresh];
3946
}
4047

4148
/// {@template archive_headline_requested}
@@ -57,16 +64,23 @@ final class ArchiveHeadlineRequested extends ContentManagementEvent {
5764
/// {@endtemplate}
5865
final class LoadTopicsRequested extends ContentManagementEvent {
5966
/// {@macro load_topics_requested}
60-
const LoadTopicsRequested({this.startAfterId, this.limit});
67+
const LoadTopicsRequested({
68+
this.startAfterId,
69+
this.limit,
70+
this.forceRefresh = false,
71+
});
6172

6273
/// Optional ID to start pagination after.
6374
final String? startAfterId;
6475

6576
/// Optional maximum number of items to return.
6677
final int? limit;
6778

79+
/// If true, forces a refresh of the data, bypassing the cache.
80+
final bool forceRefresh;
81+
6882
@override
69-
List<Object?> get props => [startAfterId, limit];
83+
List<Object?> get props => [startAfterId, limit, forceRefresh];
7084
}
7185

7286
/// {@template archive_topic_requested}
@@ -88,16 +102,23 @@ final class ArchiveTopicRequested extends ContentManagementEvent {
88102
/// {@endtemplate}
89103
final class LoadSourcesRequested extends ContentManagementEvent {
90104
/// {@macro load_sources_requested}
91-
const LoadSourcesRequested({this.startAfterId, this.limit});
105+
const LoadSourcesRequested({
106+
this.startAfterId,
107+
this.limit,
108+
this.forceRefresh = false,
109+
});
92110

93111
/// Optional ID to start pagination after.
94112
final String? startAfterId;
95113

96114
/// Optional maximum number of items to return.
97115
final int? limit;
98116

117+
/// If true, forces a refresh of the data, bypassing the cache.
118+
final bool forceRefresh;
119+
99120
@override
100-
List<Object?> get props => [startAfterId, limit];
121+
List<Object?> get props => [startAfterId, limit, forceRefresh];
101122
}
102123

103124
/// {@template archive_source_requested}

0 commit comments

Comments
 (0)