Skip to content

Commit ee8bbfc

Browse files
committed
feat(content_management): add sorting to create headline bloc
- Implement ascending sort by name for sources, topics, and countries - Update readAll() calls in Future.wait to include sorting option
1 parent 1b72464 commit ee8bbfc

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

lib/content_management/bloc/create_headline/create_headline_bloc.dart

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,15 @@ class CreateHeadlineBloc
5151
topicsResponse,
5252
countriesResponse,
5353
] = await Future.wait([
54-
_sourcesRepository.readAll(),
55-
_topicsRepository.readAll(),
56-
_countriesRepository.readAll(),
54+
_sourcesRepository.readAll(
55+
sort: [const SortOption('name', SortOrder.asc)],
56+
),
57+
_topicsRepository.readAll(
58+
sort: [const SortOption('name', SortOrder.asc)],
59+
),
60+
_countriesRepository.readAll(
61+
sort: [const SortOption('name', SortOrder.asc)],
62+
),
5763
]);
5864

5965
final sources = (sourcesResponse as PaginatedResponse<Source>).items;

0 commit comments

Comments
 (0)