google_ads_helper library
Google Ads Helper Plugin
A comprehensive Flutter plugin for Google Mobile Ads with easy integration, smart initialization, revenue tracking, and professional UI widgets.
Features:
- Easy one-line initialization
- Smart ad loading (only loads ads with provided IDs)
- Revenue tracking and calculation
- Professional UI widgets
- Automatic retry logic
- Debug helpers for development
- Production-ready error handling
Usage:
import 'package:google_ads_helper/google_ads_helper.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await SimpleAdInitializer.initializeForRewardApp(
rewardedAdUnitId: 'your-rewarded-ad-unit-id',
interstitialAdUnitId: 'your-interstitial-ad-unit-id',
);
runApp(MyApp());
}
// Use anywhere in your app
AdHelper.showRewarded(
onRewardEarned: (reward) => print('Earned ${reward.amount} ${reward.type}'),
);
Classes
- AdCallbacks
- Ad callbacks interface
- AdConstants
- Constants and configurations for Google Ads Helper
- AdDebugHelper
- Debug helper to check ad status
- AdHelper
- Helper class for easy ad operations
- AdLoadingIndicator
- Ad Loading Indicator Widget
- AdRevenueTracker
- Revenue tracking helper
- AdSize
- AdSize represents the size of a banner ad.
- AdUsageExamples
- Usage examples for Google Ads Helper Plugin
- BannerAdManager
- BannerAdWidget
- Banner Ad Widget - Drop-in widget for displaying banner ads
- GoogleAdsHelper
- Main Google Ads Helper class - Singleton instance for managing all ad types
- InterstitialAdManager
- NativeAdManager
- NativeAdWidget
- Native Ad Widget - Drop-in widget for displaying native ads
- RewardedAdManager
- RewardItem
-
Credit information about a reward received from a
RewardedAdorRewardedInterstitialAd. - RewardScreenExample
- Example Widget using the ads
- SimpleAdInitializer
- Simple ad initializer with smart loading
- SmartAdContainer
- Smart Ad Container that adapts based on available ads