display_ads 0.0.1
display_ads: ^0.0.1 copied to clipboard
The Display Ads package is a wrapper for the Google Mobile Ads Flutter plugin, which helps developers display Google Mobile Ads in the easiest way.
Easy way to display google ads #
The Display Ads package is a wrapper for the Google Mobile Ads Flutter plugin, which helps developers display Google Mobile Ads in the easiest way.
Features #
- Display banner ads
- Display interstitial ads
Getting started #
Set up on iOS and Android by following this Platform specific setup
Usage #
Initialize plugin
import 'package:display_ads/display_ads.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
DisplayAds.instance.initialize(
isShowAds: true,
interstitialAdUnitIdIOS: "Put your interstitial AdUnitId for iOS here",
bannerAdUnitIdAndroid:"Put your interstitial AdUnitId for Android here",
bannerAdUnitIdIOS: "Put your banner AdUnitId for iOS here",
bannerAdUnitIdAndroid:"Put your banner AdUnitId for Android here",
);
}
Display banner ads
The method below returns a widget, so you can use it in a Flutter widget.
DisplayAds.instance.bannerAd()
Display interstitial ads
The method below will open interstitial ads, so you can call it whenever you want to display interstitial ads.
DisplayAds.instance.loadInterstitialAds()
Additional information #
This package uses google_mobile_ads, flutter_riverpod, and equatable as dependencies.