Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 32 additions & 5 deletions frontend/lib/presentation/events/pages/event_browse_page.dart
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,31 @@ class _EventBrowseViewState extends State<_EventBrowseView> {
label: Text('Location: ${_currentFilters.location}'),
onDeleted: () {
setState(() {
_currentFilters = _currentFilters.copyWith(location: null);
_currentFilters = EventFilterModel(
name: _currentFilters.name,
startDateFrom: _currentFilters.startDateFrom,
startDateTo: _currentFilters.startDateTo,
minPrice: _currentFilters.minPrice,
maxPrice: _currentFilters.maxPrice,
);
_currentPage = 1;
_hasMoreData = true;
});
_loadEventsWithFilters(reset: true);
},
),
if (_currentFilters.startDateFrom != null || _currentFilters.startDateTo != null)
Chip(
label: const Text('Date Range'),
onDeleted: () {
setState(() {
_currentFilters = EventFilterModel(
name: _currentFilters.name,
location: _currentFilters.location,
minPrice: _currentFilters.minPrice,
maxPrice: _currentFilters.maxPrice,
// startDateFrom and startDateTo are set to null
);
_currentPage = 1;
_hasMoreData = true;
});
Expand All @@ -367,9 +391,12 @@ class _EventBrowseViewState extends State<_EventBrowseView> {
),
onDeleted: () {
setState(() {
_currentFilters = _currentFilters.copyWith(
minPrice: null,
maxPrice: null,
_currentFilters = EventFilterModel(
name: _currentFilters.name,
location: _currentFilters.location,
startDateFrom: _currentFilters.startDateFrom,
startDateTo: _currentFilters.startDateTo,
// minPrice and maxPrice are set to null
);
_currentPage = 1;
_hasMoreData = true;
Expand Down Expand Up @@ -521,4 +548,4 @@ class _EventBrowseViewState extends State<_EventBrowseView> {
),
);
}
}
}