You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
extensiononEventManager {
Future<void> dispatchSomeEvent(SomeEvent event) {
// Switching on the instance type will cause the dispatch<Event>// to use the correct generic type.// Analyzer will complain if you don't do this or forget a caseswitch (event) {
caseAddedEvent():returndispatch(event);
caseRemovedEvent():returndispatch(event);
}
}
}
The following method uses the incorrect compile-time generic type.
When a redirect factory constructor is used, the generic type will be the base class, instead of the instance type.
This causes the wrong event handler to be used.
mediator.dart/lib/src/event/event_manager.dart
Lines 55 to 59 in 2f04c66
Sample:
Output:
Expected:
The events should be handled by the
Added
,Removed
event handlers instead of theBaseEvent
handler.The text was updated successfully, but these errors were encountered: