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.

example/lib/main.dart

import 'package:ad_pilot/ad_pilot.dart';
import 'package:flutter/material.dart';

/// Replace with your AdPilot API origin (no trailing slash).
const adPilotBaseUrl = String.fromEnvironment(
  'ADPILOT_BASE_URL',
  defaultValue: 'http://localhost:3000',
);

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  AdPilot.configure(baseUrl: adPilotBaseUrl);
  runApp(const ExampleApp());
}

class ExampleApp extends StatelessWidget {
  const ExampleApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'AdPilot Example',
      home: Scaffold(
        appBar: AppBar(title: const Text('AdPilot Flutter')),
        body: ListView(
          padding: const EdgeInsets.all(16),
          children: [
            Text('API: $adPilotBaseUrl', style: Theme.of(context).textTheme.bodySmall),
            const SizedBox(height: 16),
            const AdBanner(
              placement: 'HOMEPAGE_TOP',
              pageUrl: 'ad_pilot_example://home',
            ),
          ],
        ),
      ),
    );
  }
}
0
likes
160
points
92
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