Skip to content

Commit 6647397

Browse files
committed
refactor(feed): remove country filter
- Removed country filter - Simplified filter logic
1 parent e74edf7 commit 6647397

File tree

1 file changed

+7
-22
lines changed

1 file changed

+7
-22
lines changed

lib/headlines-feed/view/headlines_filter_page.dart

Lines changed: 7 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import 'package:ht_main/l10n/l10n.dart';
1010
import 'package:ht_main/router/routes.dart';
1111
import 'package:ht_main/shared/constants/constants.dart';
1212
import 'package:ht_shared/ht_shared.dart'
13-
show Category, Country, Source; // Import models from ht_shared
13+
show Category, Source; // Import models from ht_shared, Country removed
1414

1515
/// {@template headlines_filter_page}
1616
/// A full-screen dialog page for selecting headline filters.
@@ -35,7 +35,7 @@ class _HeadlinesFilterPageState extends State<HeadlinesFilterPage> {
3535
/// and are only applied back to the BLoC when the user taps 'Apply'.
3636
late List<Category> _tempSelectedCategories;
3737
late List<Source> _tempSelectedSources;
38-
late List<Country> _tempSelectedCountries;
38+
// late List<Country> _tempSelectedCountries; // Removed
3939

4040
@override
4141
void initState() {
@@ -48,15 +48,15 @@ class _HeadlinesFilterPageState extends State<HeadlinesFilterPage> {
4848
// Create copies of the lists to avoid modifying the BLoC state directly.
4949
_tempSelectedCategories = List.from(currentState.filter.categories ?? []);
5050
_tempSelectedSources = List.from(currentState.filter.sources ?? []);
51-
_tempSelectedCountries = List.from(
52-
currentState.filter.eventCountries ?? [],
53-
);
51+
// _tempSelectedCountries = List.from(
52+
// currentState.filter.eventCountries ?? [],
53+
// ); // Removed
5454
} else {
5555
// Default to empty lists if the feed isn't loaded yet. This might happen
5656
// if the filter page is accessed before the initial feed load completes.
5757
_tempSelectedCategories = [];
5858
_tempSelectedSources = [];
59-
_tempSelectedCountries = [];
59+
// _tempSelectedCountries = []; // Removed
6060
}
6161
}
6262

@@ -155,10 +155,6 @@ class _HeadlinesFilterPageState extends State<HeadlinesFilterPage> {
155155
_tempSelectedSources.isNotEmpty
156156
? _tempSelectedSources
157157
: null, // Use null if empty
158-
eventCountries:
159-
_tempSelectedCountries.isNotEmpty
160-
? _tempSelectedCountries
161-
: null, // Use null if empty
162158
);
163159

164160
// Add an event to the main HeadlinesFeedBloc to apply the
@@ -198,18 +194,7 @@ class _HeadlinesFilterPageState extends State<HeadlinesFilterPage> {
198194
}
199195
},
200196
),
201-
_buildFilterTile(
202-
context: context,
203-
title: l10n.headlinesFeedFilterEventCountryLabel,
204-
selectedCount: _tempSelectedCountries.length,
205-
routeName: Routes.feedFilterCountriesName,
206-
currentSelection: _tempSelectedCountries,
207-
onResult: (result) {
208-
if (result is List<Country>) {
209-
setState(() => _tempSelectedCountries = result);
210-
}
211-
},
212-
),
197+
// _buildFilterTile for eventCountries removed
213198
],
214199
),
215200
);

0 commit comments

Comments
 (0)