'Dart how to create parallel operations for Bloc Events?

I have a little question. How can we create parallel tasks for bloc events? Let's suppose I have a object list and I'm trying to do something with each one of them. Currently I'm doing this

for (MyObject e in MyObjectList) {
   myBloc.add(DoSomething(e));
}

Is there a way to run this add line parallel and don't wait for previous operations? When I'm searching this I always faced with "future wait" but it's not for my use case. Is there a good approach for this?



Solution 1:[1]

This is now possible with the new bloc_concurrency package -> https://verygood.ventures/blog/how-to-use-bloc-with-streams-and-concurrency

From your example I see that the ask is to dispatch multiple events to your bloc at once (concurrently). You can glance through an example here that explains this better

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1