AdUnitConfiguration class

Configuration to customize the AdUnitWidget.

Contains named constructors for the following supported ad unit types:

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 unit
  • rowsNum: Specifies how many rows to show within the Multiplex ad unit grid. Requires matchedContentUiType to be set.
  • columnsNum: Specifies how many columns to show within the Multiplex ad unit grid. Requires matchedContentUiType 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 to true 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

hashCode int
The hash code for this object.
no setterinherited
params Map<String, String>
Map representation of this configuration object.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

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