Skip to main content

ad_pilot 1.2.0 copy "ad_pilot: ^1.2.0" to clipboard
ad_pilot: ^1.2.0 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.2.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
  mode: AdFetchMode.single, // or AdFetchMode.multi
  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 #

  1. Create a pub.dev account and verify the publisher.

  2. From packages/flutter:

    flutter pub publish --dry-run
    flutter pub publish
    
  3. Tag releases in git aligned with version in pubspec.yaml.


AdPilot operators #

  • Ensure production API exposes GET /public/ads/fetch and POST /public/ads/:id/event.
  • Set STATIC_CDN_BASE_URL on the API so imageUrl uses your CDN.
  • Create placements in admin that match codes used in the app (e.g. APP_HOME_BANNER).
0
likes
160
points
86
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Flutter publisher integration for AdPilot — fetch, render, and track ads from your AdPilot API.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

flutter, http, shared_preferences, url_launcher, visibility_detector

More

Packages that depend on ad_pilot