chartboost 0.0.1 copy "chartboost: ^0.0.1" to clipboard
chartboost: ^0.0.1 copied to clipboard

outdated

A Flutter plugin to display ads from Chartboost.

example/lib/main.dart

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

import 'package:chartboost/chartboost.dart';

void main() {
  runApp(MyApp());
}

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

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    Chartboost.init('6086e39e215211081fc6dfe8', '8eb71a4126b098c0f85b2073e2cbf37db25d3045')
      .then((value) => Chartboost.cacheInterstitial());
  }

  listener(ChartboostEventListener event) {
    print('EVENT: $event');
    if(event == ChartboostEventListener.didCacheInterstitial)
      print('Cached interstitial!');
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Chartboost Plugin example'),
        ),
        body: Center(
          child: ListView(
            children: <Widget>[
              ElevatedButton(
                onPressed: () async {
                  await Chartboost.showInterstitial(listener: listener);
                },
                child: Text('Show Interstitial'),
              ),
            ],
          ),
        ),
      ),
    );
  }
}
5
likes
30
pub points
55%
popularity

Publisher

unverified uploader

A Flutter plugin to display ads from Chartboost.

Repository (GitHub)
View/report issues

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on chartboost