-
-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Open
Labels
documentationDocumentation requestedDocumentation requested
Description
Description
Hi!
In #3944, it's mentioned that the recommended way to add initial events to a Bloc is as follows:
BlocProvider(
create: (context) => MeetingsBloc()..add(LoadMettingsEvent()),
child: MyWidget(),
);
The reasoning being that
this gives you granular control over when the event is added and makes testing easier and more predictable. In addition, it also makes the bloc more flexible and reusable.
However, this creates a new problem. How do you test that the correct initial events are added when the Bloc is created?
As far as I know, none of the Bloc examples or documentation demonstrate a way to do this.
Is adding the initial events not considered worth testing?
Related issues: #3946, #3944, #3759, #2701, #2654, #1912, #1415
Metadata
Metadata
Assignees
Labels
documentationDocumentation requestedDocumentation requested