handleAllPlayerEvents method
void
handleAllPlayerEvents(
- dynamic onEvent(
- dynamic event
Listens to all player events and triggers the provided onEvent callback
Returns dictionary with 'playerReference', 'type' and 'event' or 'ad' keys.
onEvent: A callback function that handles the event.
Implementation
void handleAllPlayerEvents(Function(dynamic event) onEvent) {
_playerEvents.listen((event) {
if (event['playerReference'] == playerReference) {
onEvent(event);
}
});
}