Home > Software design >  Flutter listener error The argument Type can't be assigned to the parameter type
Flutter listener error The argument Type can't be assigned to the parameter type

Time:01-14

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 enter image description here

CodePudding user response:

Like nvoigt said, the tutorial it´s obsolete and this is a null safety-related error.

In this case making the method with a ? after dynamic would probably work

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

CodePudding user response:

As stated in the error, you may change to this

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