Skip to content

adding an event argument in the builder #1490

@theweiweiway

Description

@theweiweiway

Hey Felix,

Sorry if this has been suggested before - I did a quick search through the issues and didn't find anything.

So, I was just thinking it might be convenient to do something like
builder: (context, state, event) {}
so we can add events with event.add(EventName()); without having to do the Bloc bloc = BlocProvider.of<Bloc>(context); and then calling bloc.add(EventName()) each time.

The reason I think this would be convenient is because I frequently need access to event.add whenever I'm inside of BlocBuilder. Like calling onTaps, onPressed and such.

Thanks

P.S. I'm loving cubit - i use it in conjunction with Bloc and it's done wonders for my codebase.

Metadata

Metadata

Assignees

Labels

duplicateThis issue or pull request already existsquestionFurther information is requested

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions