Skip to content

Commit

Permalink
[Fix] Event list shows wrong data after deleting an event (#817)
Browse files Browse the repository at this point in the history
* chore: fixes linting issue

* ptch: replaces event list with displayed events list
  • Loading branch information
Raunakk02 authored Jun 7, 2021
1 parent d9846d9 commit 79cb88d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions lib/views/pages/events/events.dart
Original file line number Diff line number Diff line change
Expand Up @@ -113,15 +113,16 @@ class _EventsState extends State<Events> {
children: [carouselSliderBar(model)],
),
Expanded(
child: model.eventList.isEmpty
child: model.displayEvents.isEmpty
? Center(
child: Text(AppLocalizations.of(
context)
.translate('No Events Today.')))
: Timeline.builder(
lineColor: UIData.primaryColor,
position: TimelinePosition.Left,
itemCount: model.eventList.length,
itemCount:
model.displayEvents.length,
itemBuilder: (context, index) {
if (index == 0) {
return TimelineModel(
Expand All @@ -136,7 +137,7 @@ class _EventsState extends State<Events> {
.safeBlockVertical *
0.625),
child: Text(
'${model.eventList.length} ${AppLocalizations.of(context).translate("Events")}',
'${model.displayEvents.length} ${AppLocalizations.of(context).translate("Events")}',
style:
const TextStyle(
color: Colors
Expand Down Expand Up @@ -230,12 +231,12 @@ class _EventsState extends State<Events> {
],
options: CarouselOptions(
onPageChanged: (item, reason) {
final List<EventsModel> _currentFilterEvents =
model.filterEventsByDay(
_calendarController.selectedDay, model.eventList);
if (item == 0) {
model.setDisplayEvents(model.eventList);
} else if (item == 1) {
final List<EventsModel> _currentFilterEvents =
model.filterEventsByDay(
_calendarController.selectedDay, model.eventList);
model.setDisplayEvents(_currentFilterEvents);
}
},
Expand Down

0 comments on commit 79cb88d

Please sign in to comment.