ad_pilot 1.0.1
ad_pilot: ^1.0.1 copied to clipboard
Flutter publisher integration for AdPilot — fetch, render, and track ads from your AdPilot API.
ad_pilot #
Flutter publisher package for AdPilot — fetch, display, and track ads from your AdPilot API (same public endpoints as the browser SDK).
Publisher docs: docs/04.2_sdk_usage_flutter.md
Web / Next.js: @ad-pilot/react and docs/04.1_sdk_usage_nextjs.md
Install #
From this monorepo (development):
dependencies:
ad_pilot:
path: ../path/to/ad-pilot/packages/flutter
From pub.dev (after publish):
dependencies:
ad_pilot: ^1.0.0
flutter pub get
Quick start #
import 'package:ad_pilot/ad_pilot.dart';
void main() {
WidgetsFlutterBinding.ensureInitialized();
AdPilot.configure(baseUrl: 'https://ad-pilot-api.bdtickets.com');
runApp(const MyApp());
}
AdBanner(
placement: 'APP_HOME_BANNER',
category: 'travel', // optional
pageUrl: 'myapp://home', // optional, for exclude-url rules
)
API #
| Symbol | Use |
|---|---|
AdPilot.configure |
Set API base URL once at startup |
AdBanner |
Widget: fetch + IMAGE render + impression/click tracking |
AdPilot.init |
Imperative AdSlot (load, refresh, dispose) |
AdPilotClient |
Low-level HTTP if you need custom UI |
Supported ad types in AdBanner: IMAGE. HTML / SCRIPT need a custom UI (e.g. WebView).
Example app #
cd packages/flutter/example
flutter run --dart-define=ADPILOT_BASE_URL=https://ad-pilot-api.bdtickets.com
Publish to pub.dev #
-
Create a pub.dev account and verify the publisher.
-
From
packages/flutter:flutter pub publish --dry-run flutter pub publish -
Tag releases in git aligned with
versioninpubspec.yaml.
AdPilot operators #
- Ensure production API exposes
GET /public/ads/fetchandPOST /public/ads/:id/event. - Set
STATIC_CDN_BASE_URLon the API soimageUrluses your CDN. - Create placements in admin that match codes used in the app (e.g.
APP_HOME_BANNER).