Implement light popup ads with the DARO Flutter SDK.
Light Popup Ad Format
A full-screen ad format.
Automatically closes after 8 seconds. Less disruptive to UX compared to interstitial or rewarded video ads.
Android light popup example
iOS light popup example
Creating Instance and Setting Callbacks
Create a DaroLightPopupAd instance and set up callbacks.
import 'package:daro_flutter/daro_flutter.dart';
final lightPopupAd = DaroLightPopupAd(adUnitId: '{YOUR_AD_UNIT_ID}');lightPopupAd.onAdLoadSuccess = (adInfo) { print('LightPopup ad loaded');};lightPopupAd.onAdLoadFail = (error) { print('LightPopup ad failed to load: ${error.message}');};lightPopupAd.onAdImpression = (adInfo) { print('LightPopup ad impression');};lightPopupAd.onAdClicked = (adInfo) { print('LightPopup ad clicked');};lightPopupAd.onAdShown = (adInfo) { print('LightPopup ad shown');};lightPopupAd.onAdFailedToShow = (error) { print('LightPopup ad failed to show: ${error.message}');};lightPopupAd.onAdDismiss = (adInfo) { print('LightPopup ad dismissed');};
Loading Ads
Call load() to load an ad.
lightPopupAd.load();
Showing Ads
Check if the ad is ready with isReady(), then display it with show().
final isReady = await lightPopupAd.isReady();if (isReady) { lightPopupAd.show();}
Releasing Resources
Call dispose() to release resources when done.
lightPopupAd.dispose();
Style Customization
Use DaroLightPopupStyle to customize the UI of light popup ads. Pass Flutter Color objects directly.
final lightPopupAd = DaroLightPopupAd( adUnitId: '{YOUR_AD_UNIT_ID}', style: DaroLightPopupStyle( backgroundColor: const Color(0xB2121416), // Overall background color containerColor: const Color(0xFF121416), // Card background color titleColor: const Color(0xFFF7FAFF), // Title color bodyColor: const Color(0xFFB6BECC), // Body text color ctaBackgroundColor: const Color(0xFFEB2640), // CTA button background color ctaTextColor: const Color(0xFFFFFFFF), // CTA button text color closeButtonColor: const Color(0xFFF7FAFF), // Close button text color closeButtonText: 'Close AD', // Close button text adMarkLabelTextColor: const Color(0xFFF7FAFF), // Ad mark label text color adMarkLabelBackgroundColor: const Color(0xFF3E434F), // Ad mark label background color ),);
Style Properties
Property
Type
Description
backgroundColor
Color?
Overall background color
containerColor
Color?
Card background color
titleColor
Color?
Title color
bodyColor
Color?
Body text color
ctaBackgroundColor
Color?
CTA button background color
ctaTextColor
Color?
CTA button text color
closeButtonColor
Color?
Close button text color
closeButtonText
String?
Close button text
adMarkLabelTextColor
Color?
Ad mark label text color
adMarkLabelBackgroundColor
Color?
Ad mark label background color
Implementation Example
This is an example implementation of DaroLightPopupAd.