Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proper way to remove all events of a day? #31

Closed
drunkendaddy opened this issue Feb 7, 2022 · 3 comments
Closed

Proper way to remove all events of a day? #31

drunkendaddy opened this issue Feb 7, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@drunkendaddy
Copy link
Contributor

drunkendaddy commented Feb 7, 2022

What is the proper way to remove all events of a day?

I'm trying with below code

var controller = CalendarControllerProvider.of(context).controller;
var existingSlots = controller.getEventsOnDay(state.selectedDate);

existingSlots.forEach((event) {
    controller.remove(event);
});

E/flutter (21441): [ERROR:flutter/lib/ui/ui_dart_state.cc(209)] Unhandled Exception: Concurrent modification during iteration: Instance(length:29) of '_GrowableList'.
E/flutter (21441): #0 ListIterator.moveNext (dart:_internal/iterable.dart:336:7)
E/flutter (21441): #1 _MonthEvent.removeEvent (package:calendar_view/src/event_controller.dart:204:21)
E/flutter (21441): #2 _YearEvent.removeEvent (package:calendar_view/src/event_controller.dart:174:11)
E/flutter (21441): #3 EventController.remove (package:calendar_view/src/event_controller.dart:58:11)

@AlexandreMaul
Copy link
Contributor

Hi, this error is fixed by my pr #27

@PRBaraiya PRBaraiya added enhancement New feature or request in progress This label defines issues that are in progress. and removed in progress This label defines issues that are in progress. labels Jul 29, 2022
@ParthBaraiya ParthBaraiya added the priority:2 Bug/Enhancement with priority level 2. label Aug 11, 2022
@faiyaz-shaikh
Copy link
Contributor

faiyaz-shaikh commented Oct 3, 2022

@drunkendaddy Thanks for sharing. Can you please check in latest release.

@ParthBaraiya ParthBaraiya pinned this issue Nov 19, 2022
@faiyaz-shaikh
Copy link
Contributor

Added in 1.0.1 PR #116

@PRBaraiya PRBaraiya unpinned this issue Nov 25, 2022
@PRBaraiya PRBaraiya removed the priority:2 Bug/Enhancement with priority level 2. label Jan 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants