<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: adPluga</title>
    <description>The latest articles on DEV Community by adPluga (@adpluga).</description>
    <link>https://dev.to/adpluga</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4152561%2F65e7e8c9-3e88-4388-940c-bc77c102f1f7.png</url>
      <title>DEV Community: adPluga</title>
      <link>https://dev.to/adpluga</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/adpluga"/>
    <language>en</language>
    <item>
      <title>How to add ads to a Flutter app in 5 minutes</title>
      <dc:creator>adPluga</dc:creator>
      <pubDate>Wed, 30 Sep 2026 22:51:24 +0000</pubDate>
      <link>https://dev.to/adpluga/how-to-add-ads-to-a-flutter-app-in-5-minutes-5d70</link>
      <guid>https://dev.to/adpluga/how-to-add-ads-to-a-flutter-app-in-5-minutes-5d70</guid>
      <description>&lt;p&gt;This guide shows how to get an ad showing in a Flutter app, first in test mode and then for real. You do not need a billing account or a card to reach the end.&lt;/p&gt;

&lt;h2&gt;
  
  
  What you need
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;A Flutter 3.10 or newer app (Dart 3).&lt;/li&gt;
&lt;li&gt;A free adPluga account.&lt;/li&gt;
&lt;li&gt;Two minutes in the dashboard to create the key and the space.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  1. Create the key and the space in the dashboard
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;Under &lt;strong&gt;Properties&lt;/strong&gt;, create the property for your app.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Slots&lt;/strong&gt;, create a space, for example a 320×50 banner at the bottom of the screen. Keep the slot id.&lt;/li&gt;
&lt;li&gt;Under &lt;strong&gt;Integration&lt;/strong&gt;, copy the publishable test key. It starts with &lt;code&gt;pk_test_&lt;/code&gt;.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;The test key shows real ads in your app, but nothing is charged, nothing is paid and nothing counts toward the quota.&lt;/p&gt;

&lt;h2&gt;
  
  
  2. Install the SDK
&lt;/h2&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;flutter pub add adpluga_flutter
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The package works on Android and iOS.&lt;/p&gt;

&lt;h2&gt;
  
  
  3. Initialise once
&lt;/h2&gt;

&lt;p&gt;Do it when the app starts, before showing any ad:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="s"&gt;'package:adpluga_flutter/adpluga_flutter.dart'&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

&lt;span class="n"&gt;Future&lt;/span&gt;&lt;span class="p"&gt;&amp;lt;&lt;/span&gt;&lt;span class="kt"&gt;void&lt;/span&gt;&lt;span class="p"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="kd"&gt;async&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="n"&gt;WidgetsFlutterBinding&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;ensureInitialized&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
  &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;AdPluga&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;initialize&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nl"&gt;publisherKey:&lt;/span&gt; &lt;span class="s"&gt;'pk_test_...'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
  &lt;span class="n"&gt;runApp&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="n"&gt;MyApp&lt;/span&gt;&lt;span class="p"&gt;());&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Show a banner
&lt;/h2&gt;

&lt;p&gt;The banner is a widget like any other. Put it where you want the ad to show:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="n"&gt;AdPlugaBanner&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;
  &lt;span class="nl"&gt;slotId:&lt;/span&gt; &lt;span class="s"&gt;'your-slot-id'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;
  &lt;span class="nl"&gt;onImpression:&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt;
  &lt;span class="nl"&gt;onClick:&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt;
  &lt;span class="nl"&gt;onError:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;err&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{},&lt;/span&gt;
&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;When there are no advertisers for that space yet, an adPluga ad shows instead. The space is never empty.&lt;/p&gt;

&lt;h2&gt;
  
  
  5. Show an interstitial
&lt;/h2&gt;

&lt;p&gt;An interstitial fills the whole screen between two moments of the app, for example at the end of a level:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight dart"&gt;&lt;code&gt;&lt;span class="kd"&gt;final&lt;/span&gt; &lt;span class="n"&gt;ad&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;InterstitialAd&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;load&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nl"&gt;slotId:&lt;/span&gt; &lt;span class="s"&gt;'your-interstitial-slot-id'&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="n"&gt;ad&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;show&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;context&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The SDK also has native, rewarded and carousel formats.&lt;/p&gt;

&lt;h2&gt;
  
  
  6. Go live
&lt;/h2&gt;

&lt;p&gt;When everything works in test, swap &lt;code&gt;pk_test_&lt;/code&gt; for &lt;code&gt;pk_live_&lt;/code&gt;. To use the live key, first confirm in the dashboard that the property is yours. We do not ask for a card for that: the free plan serves live up to &lt;strong&gt;100,000 decisions a month&lt;/strong&gt;, and a decision is each ad request the app makes.&lt;/p&gt;

&lt;h2&gt;
  
  
  Already using AdMob?
&lt;/h2&gt;

&lt;p&gt;You do not have to remove it. Under &lt;strong&gt;Mediation&lt;/strong&gt; in the dashboard, add AdMob and other networks (Meta, InMobi, Unity, Liftoff) and let them compete for the same space with adPluga. The best offer wins each time. The &lt;a href="https://adpluga.com/en/admob-alternative/" rel="noopener noreferrer"&gt;AdMob alternative&lt;/a&gt; page explains how.&lt;/p&gt;

&lt;p&gt;The full SDK reference is at &lt;a href="https://adpluga.com/en/devs/sdks/" rel="noopener noreferrer"&gt;SDKs&lt;/a&gt; and the shortest path at &lt;a href="https://adpluga.com/en/devs/quickstart/" rel="noopener noreferrer"&gt;Quickstart&lt;/a&gt;.&lt;/p&gt;




&lt;p&gt;&lt;em&gt;I work on adPluga. A complete Flutter example app is at &lt;a href="https://github.com/adpluga/examples/tree/main/flutter" rel="noopener noreferrer"&gt;github.com/adpluga/examples&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

</description>
      <category>flutter</category>
      <category>dart</category>
      <category>mobile</category>
      <category>tutorial</category>
    </item>
  </channel>
</rss>
