@@ -31,22 +31,22 @@ class HeadlinesSearchLoading extends HeadlinesSearchState {
31
31
/// State when a search has successfully returned results.
32
32
class HeadlinesSearchSuccess extends HeadlinesSearchState {
33
33
const HeadlinesSearchSuccess ({
34
- required this .results,
34
+ required this .items, // Changed from results
35
35
required this .hasMore,
36
36
required this .lastSearchTerm,
37
37
required super .selectedModelType, // The model type for these results
38
38
this .cursor,
39
39
this .errorMessage, // For non-critical errors like pagination failure
40
40
});
41
41
42
- final List <dynamic > results ; // Can hold Headline, Category, Source, Country
42
+ final List <FeedItem > items ; // Changed from List<dynamic> to List<FeedItem>
43
43
final bool hasMore;
44
44
final String ? cursor;
45
45
final String ? errorMessage; // e.g., for pagination errors
46
46
final String lastSearchTerm; // The term that yielded these results
47
47
48
48
HeadlinesSearchSuccess copyWith ({
49
- List <dynamic >? results,
49
+ List <FeedItem >? items, // Changed
50
50
bool ? hasMore,
51
51
String ? cursor,
52
52
String ? errorMessage,
@@ -55,7 +55,7 @@ class HeadlinesSearchSuccess extends HeadlinesSearchState {
55
55
bool clearErrorMessage = false ,
56
56
}) {
57
57
return HeadlinesSearchSuccess (
58
- results : results ?? this .results,
58
+ items : items ?? this .items, // Changed
59
59
hasMore: hasMore ?? this .hasMore,
60
60
cursor: cursor ?? this .cursor,
61
61
errorMessage:
@@ -68,7 +68,7 @@ class HeadlinesSearchSuccess extends HeadlinesSearchState {
68
68
@override
69
69
List <Object ?> get props => [
70
70
...super .props,
71
- results,
71
+ items, // Changed
72
72
hasMore,
73
73
cursor,
74
74
errorMessage,
0 commit comments