flutter_applovin_ads 0.0.1 icon indicating copy to clipboard operation
flutter_applovin_ads: ^0.0.1 copied to clipboard

PlatformiOS

A new flutter plugin project.

example/lib/main.dart

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

void main() {
  WidgetsFlutterBinding.ensureInitialized();
  FlutterApplovinAds.initialize();
  runApp(const MyApp());
}

class MyApp extends StatefulWidget {
  const MyApp({Key? key}) : super(key: key);

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  @override
  void initState() {
    super.initState();
    Future.delayed(const Duration(milliseconds: 3000), () {
      _createApplovinAds();
    });
  }

  void _createApplovinAds() {
    FlutterApplovinAds.createInterstitialAd("3903019ddxxxxxx", didLoad: (adUnitId) {
      print("ad_load");
      // FlutterApplovinAds.showInterstitialAd();
    }, didFailToLoadAd: (adUnitId, error) {
      print("ad_load_fail");
    }, didDisplay: (adUnitId) {
      print("ad_show");
    }, didHide: (adUnitId) {
      print("ad_close");
    }, didFail: (adUnitId, error) {
      print("ad_show_fail");
    });
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
          appBar: AppBar(
            title: const Text('Plugin example app'),
          ),
          body: TextButton(
              onPressed: () {
                FlutterApplovinAds.showInterstitialAd();
              },
              child: Text('click'))),
    );
  }
}
0
likes
110
pub points
30%
popularity

Publisher

unverified uploader

A new flutter plugin project.

Repository (GitHub)

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on flutter_applovin_ads