I'm using firebase\_admob in flutter and I want to display ads in a ListView.separated. 

```
     void initState(){
    FirebaseAdMob.instance.initialize(appId: 'ca-app-pub-XXXXXXXXXXXXXXXXXXXXXXX');
  }

  static const MobileAdTargetingInfo targetingInfo = MobileAdTargetingInfo(
    keywords: <String>['flutterio', 'beautiful apps'],
    contentUrl: 'https://flutter.io',
    childDirected: false,
    testDevices: <String>[], // Android emulators are considered test devices
  );

  BannerAd myBanner = BannerAd(
    // Replace the testAdUnitId with an ad unit id from the AdMob dash.
    // https://developers.google.com/admob/android/test-ads
    // https://developers.google.com/admob/ios/test-ads
    adUnitId: BannerAd.testAdUnitId,
    size: AdSize.smartBanner,
    targetingInfo: targetingInfo,
    listener: (MobileAdEvent event) {
      print("BannerAd event is $event");
    },
  );

```

And where I want to display the ads :

```
return ListView.separated(
        padding: EdgeInsets.zero,
        itemCount: data.articles.length,
        separatorBuilder: (context, index) {
          if (index % 5 == 0) { // Display `AdmobBanner` every 5 'separators'.
           return myBanner;
          }
          return Divider();
        },

```

But I get this issue : error: The return type 'BannerAd' isn't a 'Widget', as defined by anonymous closure. (return\_of\_invalid\_type\_from\_closure at lib\src\ui\home\home\_screen.dart:445).

What is the best solution ?

Thanks