AdUnitConfiguration class
Configuration to customize the AdUnitWidget.
Contains named constructors for the following supported ad unit types:
- Display (see: AdUnitConfiguration.displayAdUnit)
- In-feed (see: AdUnitConfiguration.inFeedAdUnit)
- In-article (see: AdUnitConfiguration.inArticleAdUnit)
- Multiplex (see: AdUnitConfiguration.multiplexAdUnit)
Each constructor will use one or more of the following arguments:
adSlot
: Identifies a specific ad unit from the AdSense console.adFormat
: (Desktop only) Specifies a general shape (horizontal, vertical, and/or rectangle) that this ad unit should conform to. To learn more, check: How to use responsive ad tag parameters.adLayout
: Customizes the layout of this ad unit. See: Customize your in-feed ad.adLayoutKey
: The key identifying the layout for this ad unit.matchedContentUiType
: Controls the arrangement of the text and images in this Multiplex ad unit. For example, you can choose to have the image and text side by side, the image above the text, etc. More information: How to customize your responsive Multiplex ad unitrowsNum
: Specifies how many rows to show within the Multiplex ad unit grid. RequiresmatchedContentUiType
to be set.columnsNum
: Specifies how many columns to show within the Multiplex ad unit grid. RequiresmatchedContentUiType
to be set.isFullWidthResponsive
: Determines whether this responsive ad unit expands to use the full width of a visitor's mobile device screen. See: How to use responsive ad tag parameters.isAdTest
: Whether this ad will be shown in a test environment. Defaults totrue
in debug mode.
For more information about ad units, check the Ad formats FAQ in the Google AdSense Help.
Constructors
- AdUnitConfiguration.displayAdUnit({required String adSlot, AdFormat? adFormat, bool isFullWidthResponsive = true, bool isAdTest = kDebugMode})
- Creates a configuration object for a Display ad.
- AdUnitConfiguration.inArticleAdUnit({required String adSlot, AdFormat? adFormat, AdLayout adLayout = AdLayout.IN_ARTICLE, bool isFullWidthResponsive = true, bool isAdTest = kDebugMode})
- Creates a configuration object for an In-article ad.
- AdUnitConfiguration.inFeedAdUnit({required String adSlot, required String adLayoutKey, AdFormat? adFormat, bool isFullWidthResponsive = true, bool isAdTest = kDebugMode})
- Creates a configuration object for an In-feed ad.
- AdUnitConfiguration.multiplexAdUnit({required String adSlot, required AdFormat adFormat, MatchedContentUiType? matchedContentUiType, int? rowsNum, int? columnsNum, bool isFullWidthResponsive = true, bool isAdTest = kDebugMode})
- Creates a configuration object for a Multiplex ad.
Properties
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited