AndriousSolutions / ads

Other
58 stars 11 forks source link

Ads already initiated #30

Closed jsonpreet closed 4 years ago

jsonpreet commented 4 years ago

If i use Ads ads and Ads() in multiple screens i got message.

[Ads()] An Ads class is already instantiated!

And if don't use Ads() function in screen i got error

Andrious commented 4 years ago

Indeed, you're not to call the constructor twice. If you need to show ads throughout your app, instantiate once but to a static variable or class property accessible throughout your app: A Single Solution

Lastly, be sure to have only the 'major' version number and then 0.0 in your pubspec.yaml.

dependencies:
  ads:^1.0.0