Search code examples
flutterdartadmoblistener

Flutter listener error The argument Type can't be assigned to the parameter type


Im starting learning flutter, and i've coding an app that contains some ads like intersticial from AdMob.

Im guiding myself from a YouTube video this is the video but it shows this error:

The argument type 'void Function(AdmobAdEvent, Map<String, dynamic>)' can't be assigned to the parameter type 'void Function(AdmobAdEvent, Map<String, dynamic>?)?'

I would like to know how to solve this

enter image description here


Solution

  • As stated in the error, you may change to this

    listener: (AdmobAdEvent event, Map<String, dynamic>? args) { }