I use bloc in my flutter app. I have in my app many similar pages that display the information received from the API. The blocks of these widgets have similar states and events. for similar states I create the same widgets. this is repetitive code and I want to optimize it. I have to write similar code every time - it's a little tedious. I want to create a common parent for an event(BaseEvent) and for states(BaseState). Then my blocks will as:
MyBlocA extends Bloc<BaseEvent, BaseState>
MyBlocB extends Bloc<BaseEvent, BaseState>
MyBlocC extends Bloc<BaseEvent, BaseState>
If I need to add specific events and states for some blocks, they will also be inherited from common parents. This should work. But are there hidden dangers in this way? maybe not a good idea? any advice - I would be grateful.