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

discontinuedreplaced by: easy_ads
outdated

A new flutter plugin project.

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:easy_video_ad/easy_video_ad.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();

  EasyVideoAd.putInMain();
  //EasyVideoAd.setImmersiveMode(true);

  runApp(MyApp());
}

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

class _MyAppState extends State<MyApp> {
  String adEvent;
  @override
  initState() {
    super.initState();
    adEvent = "nothing";
    EasyVideoAd.onAdEventTriggered = (String event) {
      setState(() {
        adEvent = event;
      });
    };
  }

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: const Text('Plugin example app'),
        ),
        body: SafeArea(
          child: Container(
            width: double.infinity,
            child: Column(
              children: <Widget>[
                Text(adEvent),
                RaisedButton(
                  onPressed: EasyVideoAd.loadTestAd,
                  child: Text("LoadTestAd"),
                ),
                RaisedButton(
                  onPressed: EasyVideoAd.forceLoadTestAd,
                  child: Text("forceLoadTestAd"),
                ),
                RaisedButton(
                  onPressed: EasyVideoAd.showAdIfLoaded,
                  child: Text("showAdIfLoaded"),
                ),
                RaisedButton(
                  onPressed: EasyVideoAd.showAd,
                  child: Text("showAd"),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
0
likes
30
pub points
0%
popularity

Publisher

unverified uploader

A new flutter plugin project.

Repository (GitLab)
View/report issues

License

Apache-2.0 (LICENSE)

Dependencies

flutter

More

Packages that depend on easy_video_ad