How matifdeveloper/admob_easy works
Project type and purpose
• This is a Flutter plugin/package named “Admob Easy.”
File structure
• Top-level: pubspec.yaml, README, CHANGELOG, LICENSE, .gitignore, analysis_options.yaml
• lib/
• admob_easy.dart – main entrypoint and singleton (AdmobEasy.instance)
• ads/
– controllers/connectivity_controller.dart – tracks network status
– helper/admob_helper.dart & admob_ump_helper.dart – wrap AdMob SDK initialization and UMP consent flows
– services/… – classes to initialize and load each ad type (banner_ad.dart, rewarded_ad.dart, open_app_ad.dart, init_ad.dart, admob_easy_native.dart)
– sources.dart – constants for ad-unit IDs
– utils/admob_easy_logger.dart – logging
• No “frontend” or “backend” directories because it’s a client-side library.
README for additional insights
• It shows how to configure AndroidManifest and Info.plist, how to call initialize(), create/load/show methods, and use the AdmobEasyNative widget.
• UMP consent and connectivity monitoring are key features.
a. Main components
• Flutter Application (your host app)
• AdmobEasy plugin (Dart layer)
– AdmobEasy singleton façade
– ConnectivityController
– AdmobHelper & UMPHelper
– Ad services (BannerService, RewardedService, OpenAppService, InterstitialService)
– Native ad widget (AdmobEasyNative)
– Logger
• Platform Channels
• Native AdMob SDKs on Android & iOS (including UMP)
b. Relationships and interactions
1. App calls AdmobEasy.instance.initialize(…)
2. AdmobEasy façade invokes AdmobHelper to configure SDK with ad unit IDs
3. UMPHelper handles consent dialogues via platform channel to native UMP SDK
4. ConnectivityController polls network state and exposes ValueListenable to app/services
5. When app calls create/load/show methods, corresponding service class
• checks connectivity
• requests ad via platform channel to native AdMob SDK
• forwards events (onLoaded, onClicked, onPaidEvent) back to Dart
6. AdmobEasyNative widget requests a native ad, receives a PlatformView from the SDK
c. Architectural patterns and design principles
• Singleton pattern for AdmobEasy.instance
• Façade pattern – unified API over multiple ad types and consent flow
• Controller for connectivity (separation of concerns)
• Service classes for each ad type (single responsibility)
• Platform channel abstraction isolates Dart from native SDK details
d. Key technologies and frameworks
• Dart & Flutter widgets (AdmobEasyNative extends StatefulWidget)
• Platform channels for iOS and Android integration
• Google Mobile Ads SDK (Android & iOS)
• Google User Messaging Platform (UMP) native SDK
• connectivity_plus or similar (wrapped inside connectivity_controller)
Elements
• Clear labels for each component (e.g., AdmobEasy façade, UMP Helper, BannerService)
– App → AdmobEasy → Helper/Service → Platform Channel → Native SDK
– Native SDK → Platform Channel → Dart callbacks → App
– Another for platform channels
– A third for native SDKs
• Annotations for key interactions (e.g., consent flow, connectivity check)