controller property

BannerAdController? controller
final

The controller of the ad. This controller must be unique and can be used on only one BannerAd

The ad is loaded automatically when attached and it's not necessary to load it manually. You can use the controller to reload the ad:

controller.load();

You can use the controller to listen to events:

controller.onEvent.listen((e) {
   final event = e.keys.first;
   final info = e.values.first;
   switch (event) {
    case BannerAdEvent.loading:
      break;
    case BannerAdEvent.loadFailed:
      print(info);
      break;
    case BannerAdEvent.loaded:
      break;
    case BannerAdEvent.undefined:
      break;
    default:
      break;
  }
});

For more info, visit the documentation

Implementation

final BannerAdController? controller;