flutter_appodeal_ads 0.5.1 copy "flutter_appodeal_ads: ^0.5.1" to clipboard
flutter_appodeal_ads: ^0.5.1 copied to clipboard

A flutter plugin to show appodeal interstital ads and video rewards.

example/lib/main.dart

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

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

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

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    AppodealAds.init(appKey: "714a9a7202c6195c0b6ecb50fdc1d011f15abf7592e53e4b", testMode: true);
  }

  interstitialListener(AppodealAdListener event) {
    if (event == AppodealAdListener.onLoaded) {
      AppodealAds.showInterstitial();
    }
  }

  rewardedListener(AppodealAdListener event) {
    if (event == AppodealAdListener.onLoaded) {
      AppodealAds.showRewardedVideo();
    }
    if (event == AppodealAdListener.onRewarded) {
      print("Video completed and rewarded");
    }
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: Column(
          children: [
            Center(
              child: ElevatedButton(
                onPressed: () {
                  AppodealAds.cacheInterstitial((AppodealAdListener event) =>
                      interstitialListener(event));
                },
                child: Text("Show Interstitial"),
              ),
            ),
            SizedBox(
              height: 20.0,
            ),
            Center(
              child: ElevatedButton(
                onPressed: () {
                  AppodealAds.cacheRewardedVideo(
                      (AppodealAdListener event) => rewardedListener(event));
                },
                child: Text("Show Rewarded video"),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
4
likes
120
pub points
0%
popularity

Publisher

verified publisherprizer.mobi

A flutter plugin to show appodeal interstital ads and video rewards.

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_appodeal_ads