admost_flutter_plugin 0.0.6

  • Readme
  • Changelog
  • Example
  • Installing
  • 65

admost_flutter_plugin #

A new Flutter plugin that uses native platform views to show AdMost mediation platform banner ads!

This plugin also has support for Interstitial and Reward ads.

Installation #

Add this to your pubspec.yml dependencies:

admost_flutter_plugin: "^0.0.6"

Add the related dependencies into android/app/build.graddle. Dependencies changes according to your ad network choices. The items shown below represents Facebook audience network dependencies chosen as sample. Refer to the admost android documentation for necessary dependencies for selected ad networks for an application.

    dependencies {
     implementation 'com.admost.sdk:facebook:5.5.0.a12'  
     implementation 'com.android.support:recyclerview-v7:27.1.1' 
    }

It may be needed to add extra repository based on ad network selection. This configuration can be found in the admost android documentation as well.

Simple Example #

import 'package:flutter/material.dart';  
import 'package:admost_flutter_plugin/admost.dart';  
import 'package:admost_flutter_plugin/admost_interstitial.dart';  
import 'package:admost_flutter_plugin/admost_rewarded.dart';  
import 'package:admost_flutter_plugin/admost_ad_events.dart';  
import 'package:admost_flutter_plugin/admost_banner.dart';  
import 'package:admost_flutter_plugin/admost_banner_size.dart';  
  
void main() {  
  Admost.initialize('6cc8e89a-b52a-4e9a-bb8c-579f7ec538fe');  
  runApp(MyApp());  
}  
/// This Widget is the main application widget.  
class MyApp extends StatelessWidget {  
  static const String _title = 'Flutter Code Sample';  
  
  @override  
  Widget build(BuildContext context) {  
    return MaterialApp(  
      title: _title,  
  home: Scaffold(  
        appBar: AppBar(title: const Text(_title)),  
  body: MyHomePage(),  
  ),  
  );  
  }  
}  
  
/// This is the stateless widget that the main application instantiates.  
class MyHomePage extends StatefulWidget  
{  
  MyHomePage({Key key}) : super(key: key);  
  
  @override  
  _MyHomePageState createState() => _MyHomePageState();  
  
}  
  
class _MyHomePageState extends State<MyHomePage> {  
  String interstitialText = 'Load Interstitial';  
  String rewardedText = 'Load Rewarded';  
  
  AdmostInterstitial interstitialAd;  
  AdmostRewarded rewardAd;  
  
  @override  
  Widget build(BuildContext context) {  
    return  
  Padding(  
        padding: EdgeInsets.all(10),  
  child: Center(  
          widthFactor: 2,  
  heightFactor: 2,  
  child: Column(  
              children: <Widget>[  
                Card(  
                  child: InkWell(  
                    splashColor: Colors.blue.withAlpha(30),  
  onTap: () async {  
                      if (interstitialAd == null) {  
                        interstitialAd = AdmostInterstitial(  
                          zoneId: 'f99e409b-f9ab-4a2e-aa9a-4d143e6809ae',  
  listener: (AdmostAdEvent event,  
  Map<String, dynamic> args) {  
                            if (event == AdmostAdEvent.loaded) {  
                              interstitialText = 'Show Interstitial';  
  setState(() {  
                                interstitialText;  
  });  
  }  
                            if (event == AdmostAdEvent.dismissed) {  
                              interstitialText = 'Load Interstitial';  
  setState(() {  
                                interstitialText;  
  });  
  }  
                            if (event == AdmostAdEvent.failedToLoad) {  
                              // Start hoping they didn't just ban your account :)  
  print("Error code: ${args['errorCode']}");  
  }  
                          },  
  );  
  }  
  
                      if (await interstitialAd.isLoaded) {  
                        interstitialAd.show();  
  } else {  
                        interstitialAd.load();  
  }  
                    },  
  child: Center(  
                      widthFactor: 2,  
  heightFactor: 2,  
  child: Text(interstitialText),  
  ),  
  ),  
  ),  
  Card(  
                  child: InkWell(  
                    splashColor: Colors.blue.withAlpha(30),  
  onTap: () async {  
                      if (rewardAd == null) {  
                        rewardAd = AdmostRewarded(  
                          zoneId: '88cfcfd0-2f8c-4aba-9f36-cc0ac99ab140',  
  listener: (AdmostAdEvent event,  
  Map<String, dynamic> args) {  
                            if (event == AdmostAdEvent.loaded) {  
                              rewardedText = 'Show Rewarded';  
  setState(() {  
                                rewardedText;  
  });  
  } else if (event == AdmostAdEvent.dismissed) {  
                              rewardedText = 'Load Rewarded';  
  setState(() {  
                                rewardedText;  
  });  
  } else if (event == AdmostAdEvent.failedToLoad) {  
                              // Start hoping they didn't just ban your account :)  
  print("Error code: ${args['errorCode']}");  
  } else if (event == AdmostAdEvent.completed) {  
                              print("REWARDED");  
  }  
                          },  
  );  
  }  
  
                      if (await rewardAd.isLoaded) {  
                        rewardAd.show();  
  } else {  
                        rewardAd.load();  
  }  
                    },  
  child: Center(  
                      widthFactor: 2,  
  heightFactor: 2,  
  child: Text(rewardedText),  
  ),  
  ),  
  ),  
  Card(  
                    child:  
                    AdmostBanner(  
                      adUnitId: "9fb970db-7d96-4ef2-ac8c-d88ec22270ff",  
  adSize: AdmostBannerSize.LEADERBOARD,  
  listener: (AdmostAdEvent event,  
  Map<String, dynamic> args) {  
                        if (event == AdmostAdEvent.loaded) {  
                          print("ADMOST Ad Loaded");  
  }  
                        if (event == AdmostAdEvent.clicked) {  
                          print("ADMOST Ad clicked");  
  }  
                        if (event == AdmostAdEvent.failedToLoad) {  
                          print("Error code: ${args['errorCode']}");  
  }  
                      },  
  )  
                )  
              ]  
          ),  
  
  ),  
  );  
  }  
  
}

[0.0.1]

Initial Release

[0.0.2] 20/06/2019

Banner support added

[0.0.3] 12/07/2019

Example app added

[0.0.4] 12/07/2019

Documentation added

[0.0.5] 12/11/2019

IOS plugin added

[0.0.6] 15/11/2019

Android plugin updated

example/README.md

flutter_plugin_deneme_example #

Demonstrates how to use the admost_flutter_plugin plugin.

Use this package as a library

1. Depend on it

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


dependencies:
  admost_flutter_plugin: ^0.0.6

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:admost_flutter_plugin/admost.dart';
import 'package:admost_flutter_plugin/admost_ad_events.dart';
import 'package:admost_flutter_plugin/admost_banner.dart';
import 'package:admost_flutter_plugin/admost_banner_controller.dart';
import 'package:admost_flutter_plugin/admost_banner_size.dart';
import 'package:admost_flutter_plugin/admost_event_handler.dart';
import 'package:admost_flutter_plugin/admost_interstitial.dart';
import 'package:admost_flutter_plugin/admost_rewarded.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
35
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
90
Overall:
Weighted score of the above. [more]
65
Learn more about scoring.

We analyzed this package on Nov 15, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.6.0
  • pana: 0.12.21
  • Flutter: 1.9.1+hotfix.6

Platforms

Detected platforms: Flutter

References Flutter, and has no conflicting libraries.

Maintenance suggestions

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

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