Skip to content

Commit 61dfa2b

Browse files
committed
refactor(content_management): add an updatedSource property to the state. This will allow the EditSourceBloc to hold the successfully updated source object, which is the final piece needed before we can refactor the main ContentManagementBloc to handle local updates
1 parent 88f3541 commit 61dfa2b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

lib/content_management/bloc/edit_source/edit_source_state.dart

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ final class EditSourceState extends Equatable {
3232
this.countries = const [],
3333
this.contentStatus = ContentStatus.active,
3434
this.errorMessage,
35+
this.updatedSource,
3536
});
3637

3738
final EditSourceStatus status;
@@ -45,6 +46,7 @@ final class EditSourceState extends Equatable {
4546
final List<Country> countries;
4647
final ContentStatus contentStatus;
4748
final String? errorMessage;
49+
final Source? updatedSource;
4850

4951
/// Returns true if the form is valid and can be submitted.
5052
bool get isFormValid => name.isNotEmpty;
@@ -61,6 +63,7 @@ final class EditSourceState extends Equatable {
6163
List<Country>? countries,
6264
ContentStatus? contentStatus,
6365
String? errorMessage,
66+
Source? updatedSource,
6467
}) {
6568
return EditSourceState(
6669
status: status ?? this.status,
@@ -73,7 +76,8 @@ final class EditSourceState extends Equatable {
7376
headquarters: headquarters != null ? headquarters() : this.headquarters,
7477
countries: countries ?? this.countries,
7578
contentStatus: contentStatus ?? this.contentStatus,
76-
errorMessage: errorMessage ?? this.errorMessage,
79+
errorMessage: errorMessage,
80+
updatedSource: updatedSource ?? this.updatedSource,
7781
);
7882
}
7983

@@ -90,5 +94,6 @@ final class EditSourceState extends Equatable {
9094
countries,
9195
contentStatus,
9296
errorMessage,
97+
updatedSource,
9398
];
9499
}

0 commit comments

Comments
 (0)