Flutter / Dart Package

Cross-Promotion for Flutter Apps

Acquire genuine Android and iOS users without third-party mediation bloat. Clean Dart widgets, zero native bridge friction.

1 Add Dependency

Add the official Git reference to your pubspec.yaml file:

dependencies:
  flutter:
    sdk: flutter
  adswap_network:
    git:
      url: https://github.com/adswap-network/AdSwap-Flutter-SDK.git
      ref: 1.0.2

2 Initialize SDK in main.dart

Initialize the client before running the application root:

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

void main() async {
  WidgetsFlutterBinding.ensureInitialized();
  await AdSwap.initialize(publisherId: "PUB-YOUR-ID");
  runApp(const MyApp());
}

3 Render Native Banner or Trigger Interstitial

Drop the banner widget anywhere in your widget tree, or show full-screen creatives between user actions:

// In your Scaffold layout:
AdSwapBanner(
  category: "finance", // optional contextual category
  bgColor: "transparent",
  titleColor: "ffffff",
)

// In your route transition or button callback:
AdSwap.showInterstitial(
  context,
  category: "finance",
  onAdClosed: () {
    // Resume gameplay or navigation
  },
);

Need your Publisher ID?

Create a free developer account to unlock your unique tracking keys.

Register Free Developer Account