Skip to content

Commit 69b04d5

Browse files
committed
refactor(content_management): replace snackbarMessage with itemPendingDeletion
- Remove snackbarMessage field from ContentManagementState - Add itemPendingDeletion field of type FeedItem? - Update copyWith method to use new field - Update props list in Equatable to include new field
1 parent e098322 commit 69b04d5

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

lib/content_management/bloc/content_management_state.dart

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class ContentManagementState extends Equatable {
3636
this.sourcesHasMore = false,
3737
this.exception,
3838
this.lastPendingDeletionId,
39-
this.snackbarMessage,
39+
this.itemPendingDeletion,
4040
});
4141

4242
/// The currently active tab in the content management section.
@@ -85,9 +85,9 @@ class ContentManagementState extends Equatable {
8585
/// Used to trigger the snackbar display.
8686
final String? lastPendingDeletionId;
8787

88-
/// The message to display in the snackbar for pending deletions or other
89-
/// transient messages.
90-
final String? snackbarMessage;
88+
/// The item that was just requested for deletion, used by the UI to show
89+
/// a confirmation snackbar.
90+
final FeedItem? itemPendingDeletion;
9191

9292
/// Creates a copy of this [ContentManagementState] with updated values.
9393
ContentManagementState copyWith({
@@ -106,7 +106,7 @@ class ContentManagementState extends Equatable {
106106
bool? sourcesHasMore,
107107
HttpException? exception,
108108
String? lastPendingDeletionId,
109-
String? snackbarMessage,
109+
FeedItem? itemPendingDeletion,
110110
}) {
111111
return ContentManagementState(
112112
activeTab: activeTab ?? this.activeTab,
@@ -124,7 +124,7 @@ class ContentManagementState extends Equatable {
124124
sourcesHasMore: sourcesHasMore ?? this.sourcesHasMore,
125125
exception: exception,
126126
lastPendingDeletionId: lastPendingDeletionId,
127-
snackbarMessage: snackbarMessage,
127+
itemPendingDeletion: itemPendingDeletion,
128128
);
129129
}
130130

@@ -145,6 +145,6 @@ class ContentManagementState extends Equatable {
145145
sourcesHasMore,
146146
exception,
147147
lastPendingDeletionId,
148-
snackbarMessage,
148+
itemPendingDeletion,
149149
];
150150
}

0 commit comments

Comments
 (0)