barterads_flutter 0.1.0
barterads_flutter: ^0.1.0 copied to clipboard
BarterAds display advertising SDK for Flutter applications.
barterads_flutter #
Flutter SDK wrapper for the BarterAds Android SDK.
Detailed client integration documentation is available in doc/flutter-integration-guide-client.md.
Supported Platforms #
Android: supported
iOS: not supported in V1
Install #
dependencies:
barterads_flutter: ^0.1.0
Initialize #
Call once before rendering any banner:
await BarterAds.initialize(
appId: '<your-app-id>',
storageAllowed: true,
personalizationAllowed: true,
measurementAllowed: true,
debug: false,
);
Banner #
BarterBanner(
inventoryId: '<your-inventory-id>',
size: BarterAdSize.responsive,
onFill: (requestId, creativeId) {},
onImpression: () {},
onClick: () {},
onNoFill: () {},
onFailed: (code) {},
)
Supported sizes:
BarterAdSize.responsiveBarterAdSize.mobileBannerBarterAdSize.largeMobileBannerBarterAdSize.mobileRectangle
BarterBanner exposes an optional height parameter because Flutter platform views need bounded layout constraints. Fixed sizes use their documented heights by default. Override height if your responsive placement needs more vertical space.
Android #
The plugin depends on:
implementation("com.barter-ads:sdk:1.0.0")
The Android SDK requires min API 21. The plugin manifest includes android.permission.INTERNET.
Always dispose Flutter widgets normally; the plugin calls native BarterAdsView.destroy() when the platform view is disposed.