Skip to content

Commit

Permalink
Enhancement/remove where (SimformSolutionsPvtLtd#53)
Browse files Browse the repository at this point in the history
* Add removeWhere to EventController

* Fix merge and remove events
  • Loading branch information
AlexandreMaul authored and MehulKK committed Oct 12, 2022
1 parent a186219 commit 4b75f4f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion lib/src/event_controller.dart
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,16 @@ class EventController<T extends Object?> extends ChangeNotifier {
}
}

/// Removes multiple [event] from this controller.
void removeWhere(bool Function(CalendarEventData<T> element) test) {
for (final e in _events.values) {
e.removeWhere(test);
}
_rangingEventList.removeWhere(test);
_eventList.removeWhere(test);
notifyListeners();
}

/// Returns events on given day.
///
/// To overwrite default behaviour of this function,
Expand Down Expand Up @@ -163,5 +173,5 @@ class EventController<T extends Object?> extends ChangeNotifier {
notifyListeners();
}

//#endregion
//#endregion
}

0 comments on commit 4b75f4f

Please sign in to comment.