@@ -32,6 +32,7 @@ final class CreateHeadlineState extends Equatable {
32
32
this .categories = const [],
33
33
this .contentStatus = ContentStatus .active,
34
34
this .errorMessage,
35
+ this .createdHeadline,
35
36
});
36
37
37
38
final CreateHeadlineStatus status;
@@ -45,6 +46,7 @@ final class CreateHeadlineState extends Equatable {
45
46
final List <Category > categories;
46
47
final ContentStatus contentStatus;
47
48
final String ? errorMessage;
49
+ final Headline ? createdHeadline;
48
50
49
51
/// Returns true if the form is valid and can be submitted.
50
52
bool get isFormValid => title.isNotEmpty;
@@ -61,6 +63,7 @@ final class CreateHeadlineState extends Equatable {
61
63
List <Category >? categories,
62
64
ContentStatus ? contentStatus,
63
65
String ? errorMessage,
66
+ Headline ? createdHeadline,
64
67
}) {
65
68
return CreateHeadlineState (
66
69
status: status ?? this .status,
@@ -73,7 +76,8 @@ final class CreateHeadlineState extends Equatable {
73
76
sources: sources ?? this .sources,
74
77
categories: categories ?? this .categories,
75
78
contentStatus: contentStatus ?? this .contentStatus,
76
- errorMessage: errorMessage ?? this .errorMessage,
79
+ errorMessage: errorMessage,
80
+ createdHeadline: createdHeadline ?? this .createdHeadline,
77
81
);
78
82
}
79
83
@@ -90,5 +94,6 @@ final class CreateHeadlineState extends Equatable {
90
94
categories,
91
95
contentStatus,
92
96
errorMessage,
97
+ createdHeadline,
93
98
];
94
99
}
0 commit comments