Ads in your Flutter App

Greg Perry
9 min readNov 15, 2019

Easily place Ads in your Flutter app

This article will review the new functions and features now available with the latest version of the library package, Ads. It’s for developers who want Ads in their app. We’ll quickly review its new named parameters and error handling.

Ads Package

Of course, I’ll suggest you first read the last article that covered this library package, Add Ads to your App in a Snap!, and get a good introduction.

Add Ads to your App in a Snap!

Screenshots Only. Click For Gists.

As always, I prefer using screenshots over gists to show code in my articles. I find them easier to work with, and easier to read. However, you can click/tap on them to see the code as a gist or in Github. Ironically, it’s better to read this article about mobile development on your computer than on your phone. Besides, we program mostly on our computers; not on our phones. For now.

Let’s begin.

Other Stories by Greg Perry

Learn By Example

A gist example accompanies this article to highlight the new features showcased here. Below is a screenshot of that example code. More specifically, it’s a screenshot of the initState() function where the Ads class is instantiated and, in this case, where all three types of Ads are then defined. Also, it’s here where a number of ‘event listeners’ are defined, and where the Banner Ad is displayed. Of course, you’re free to instantiate the Ads object elsewhere in your app. It just happens, in this example code, it’s defined in a State object’s initState() function.

_MyAppState class

Construct Your Criteria

Looking closely at the initState() function, you can see there continues to be an array of options available to instruct Google Admob as to what sort of Ads you‘d like presented in your app…

Greg Perry