AdConfig class
Configuration class for Google Mobile Ads initialization.
Use this class to configure how the ads SDK is initialized, including test mode settings and test device IDs.
Example:
// For testing
final config = AdConfig.test();
// For production
final config = AdConfig.production(
appId: 'ca-app-pub-xxxxx',
testDeviceIds: {'device-id-1', 'device-id-2'},
);
Constructors
-
AdConfig({String? appId, Map<
String, String> testDeviceIds = const {}, bool testMode = false}) -
const
-
AdConfig.production({required String appId, Map<
String, String> testDeviceIds = const {}}) -
Creates a production configuration with your App ID.
factory
- AdConfig.test()
-
Creates a test configuration with Google's test IDs.
factory
Properties
- appId → String?
-
The AdMob App ID.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
testDeviceIds
→ Map<
String, String> -
Test device IDs for showing test ads on specific devices.
final
- testMode → bool
-
Whether to use test mode.
final
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