adcolony 2.0.7 copy "adcolony: ^2.0.7" to clipboard
adcolony: ^2.0.7 copied to clipboard

discontinued

Ad Network plugin for banners, rewards and interstitial ads show

example/lib/main.dart

import 'package:flutter/material.dart';
import 'package:adcolony/adcolony.dart';
import 'package:adcolony/banner.dart';

void main() => runApp(MyApp());

class MyApp extends StatefulWidget {
  @override
  _MyAppState createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  final zones = [
    'vz4cc427f259db484398',
    'vz943c1ab8c71b46c5a5',
    'vza5b6bdf6080b4a8682'
  ];
  @override
  void initState() {
    super.initState();
    AdColony.init(AdColonyOptions('app4f4659d279be4554ad', '0', this.zones));
  }

  listener(AdColonyAdListener event) {
    print(event);
    if (event == AdColonyAdListener.onRequestFilled) AdColony.show();
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Center(
          child: ListView(
            children: <Widget>[
              RaisedButton(
                onPressed: () => AdColony.request(this.zones[1], listener),
                child: Text('Show Interstitial'),
              ),
              RaisedButton(
                onPressed: () => AdColony.request(this.zones[0], listener),
                child: Text('Show Interstitial Rewarded'),
              ),
              BannerView((AdColonyAdListener event) => print(event),
                  BannerSizes.banner, this.zones[2]),
              BannerView((AdColonyAdListener event) => print(event),
                  BannerSizes.medium, this.zones[2]),
              BannerView((AdColonyAdListener event) => print(event),
                  BannerSizes.skyscraper, this.zones[2]),
              BannerView((AdColonyAdListener event) => print(event),
                  BannerSizes.leaderboard, this.zones[2]),
            ],
          ),
        ),
      ),
    );
  }
}
25
likes
40
pub points
0%
popularity

Publisher

unverified uploader

Ad Network plugin for banners, rewards and interstitial ads show

Repository (GitHub)
View/report issues

License

Apache-2.0 (license)

Dependencies

flutter

More

Packages that depend on adcolony