brand_ads_flutter 0.0.2
brand_ads_flutter: ^0.0.2 copied to clipboard
A Flutter library for displaying customizable in-app banner ads with standard IAB sizes and event callbacks.
brand_ads_flutter #
A simple and customizable Flutter widget library for showing in-app promotional banner ads.
Supports standard IAB sizes with callbacks for view and click events.
β¨ Features #
- π Predefined IAB standard sizes:
bannerβ 320Γ50largeBannerβ 320Γ100fullBannerβ 468Γ60leaderboardβ 728Γ90
- π¨ Customizable background and button colors
- πΌοΈ Supports image/logo preview
- β‘ Lightweight and easy to integrate
- π Callbacks:
onViewandonClick
π¦ Installation #
Add the package to your pubspec.yaml:
dependencies:
brand_ads_flutter: ^1.0.0
Then import it:
import 'package:brand_ads_flutter/brand_ads_flutter.dart';
π Usage #
import 'package:flutter/material.dart';
import 'package:brand_ads_flutter/brand_ads_flutter.dart';
class MyHomePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: const Text("Brand Ads Example")),
body: Center(
child: BrandAd(
adType: BrandAdType.banner, // choose ad size
title: "Special Offer",
subtitle: "50% OFF today only",
imageUrl: "https://via.placeholder.com/150",
buttonText: "Shop Now",
backgroundColor: Colors.blue.shade50, // optional
buttonColor: Colors.blue, // optional
onClick: () => debugPrint("Ad clicked"),
onView: () => debugPrint("Ad viewed"),
),
),
);
}
}
π Available Ad Types #
| AdType | Size (px) | Device |
|---|---|---|
banner |
320Γ50 | Phones & tablets |
largeBanner |
320Γ100 | Phones & tablets |
fullBanner |
468Γ60 | Tablets |
leaderboard |
728Γ90 | Tablets |
βοΈ Policy Note #
These are embedded banner ads, not interstitials.
β
A close button is not required by Google Play policy for banner ads.
π License #
MIT License Β© 2025