Add event management for ad loaded, failed, displayed, etc callbacks using streams
for example:
enum AdEventType {loaded, failedToLoad, etc}
class AdEvent {
final AdEventType type;
final String? error;
final Object? data;
final AdNetwork;
final AdUnitType;
}
final _onEventController = StreamController< AdEvent >.broadcast();
/// The events this ad throws. Listen to it using:
///
/// ```dart
/// ad.onEvent.listen((event) {
/// print(event);
/// });
/// ```
Stream< AdEvent > get onEvent => onEventController.stream;
/// to fire an event use:
_onEventController.add(AdEvent);
Add event management for ad loaded, failed, displayed, etc callbacks using streams
for example: