easy_video_ad 1.0.1

  • Readme
  • Changelog
  • Example
  • Installing
  • 52

easy_video_ad #

This plugin gives you a simple way to use the RewardedVideoAd. Google's 'com.google.firebase:firebase-ads:19.1.0' library is used for the RewardedVideoAd.

Getting Started #

You have to modifiy the AndroidManifest.xml in the following way for this to work:

1) #

Add the following lines in the <manifest/> tag:

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

2) #

Add the following lines in the <application/> tag, infront of the <activity/> tag:

<!-- Sample AdMob App ID: ca-app-pub-3940256099942544~3347511713 -->
<meta-data
    android:name="com.google.android.gms.ads.APPLICATION_ID"
    android:value="ca-app-pub-3940256099942544~3347511713" />

0.0.1 #

  • Test release

1.0.0 #

  • First stable release.

1.0.1 #

  • Changed homepage link and description

example/lib/main.dart

import 'package:flutter/material.dart';

import 'package:easy_video_ad/easy_video_ad.dart';

void main() {
  WidgetsFlutterBinding.ensureInitialized();

  EasyVideoAd.putInMain();

  runApp(MyApp());
}

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

class _MyAppState extends State<MyApp> {
  String adEvent;
  bool immerSive;

  @override
  initState() {
    super.initState();
    adEvent = "nothing";
    immerSive = false;

    EasyVideoAd.onAdEventTriggered = (String event) {
      setState(() {
        adEvent = event;
      });
    };

    EasyVideoAd.onAdRewarded =
        (int rewardedAmount, String rewardedType, String rewardedItem) {
      print(
          "\n----------------------------onAdRewarded----------------------------------\n");
      print(
          "rewardedAmount: $rewardedAmount\rewardedType: $rewardedType\rewardedItem: $rewardedItem\n");
    };
  }

  @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"),
                ),
                RaisedButton(
                  onPressed: () {
                    immerSive = !immerSive;
                    EasyVideoAd.setImmersiveMode(immerSive);
                  },
                  child: Text("showAd"),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  easy_video_ad: ^1.0.1

2. Install it

You can install packages from the command line:

with Flutter:


$ flutter pub get

Alternatively, your editor might support flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:easy_video_ad/easy_video_ad.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
12
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
52
Learn more about scoring.

We analyzed this package on Jul 3, 2020, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.8.4
  • pana: 0.13.13
  • Flutter: 1.17.5

Analysis suggestions

Package does not support Flutter platform linux

Because of import path [package:easy_video_ad/easy_video_ad.dart] that declares support for platforms: android, ios

Package does not support Flutter platform macos

Because of import path [package:easy_video_ad/easy_video_ad.dart] that declares support for platforms: android, ios

Package does not support Flutter platform web

Because of import path [package:easy_video_ad/easy_video_ad.dart] that declares support for platforms: android, ios

Package does not support Flutter platform windows

Because of import path [package:easy_video_ad/easy_video_ad.dart] that declares support for platforms: android, ios

Package not compatible with SDK dart

because of import path [easy_video_ad] that is in a package requiring null.

Health suggestions

Fix lib/easy_video_ad.dart. (-1 points)

Analysis of lib/easy_video_ad.dart reported 2 hints:

line 27 col 3: Prefer using /// for doc comments.

line 134 col 3: Prefer using /// for doc comments.

Maintenance issues and suggestions

Homepage URL doesn't exist. (-20 points)

At the time of the analysis the homepage field https://gitlab.com/flutterplugins/easy_video_ad.git was unreachable.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.1.0 <3.0.0
flutter 0.0.0
Transitive dependencies
collection 1.14.12 1.14.13
meta 1.1.8
sky_engine 0.0.99
typed_data 1.1.6 1.2.0
vector_math 2.0.8
Dev dependencies
flutter_test