ironsource_flutter_ads 1.0.2

  • Readme
  • Changelog
  • Example
  • Installing
  • 73

Ironsource Flutter Mediation SDK #

A Flutter plugin that uses native platform views (IOS & Android) to show IronSource banner and interstitial ads!



portfolio_view        portfolio_view

Getting Started 🚀 #

1. Initialize the plugin:

 IronsourceFlutterAds.initialize(Constants.appID);

2. Show Banner Ad:

  IronSourceBanner(
      adSize: bannerSize,
      listener: (
        IronsourceAdEvent event, Map<String, dynamic> args) {
        handleEvent(event, args, 'Banner');
       },
     ),

3. Show Interstitial Ads

  • Implementing listener and load Interstitial Ad:
 
 IronsourceInterstitial interstitialAd;
 
 interstitialAd = IronsourceInterstitial(
      listener: (IronsourceAdEvent event, Map<String, dynamic> args) {
        handleEvent(event, args, 'Interstitial');
      },
    );


    interstitialAd.load();
  • Show Interstitial Ad:
  if (await interstitialAd.isLoaded){
      interstitialAd.show();
  }                        



Future Work #

  • Implement for type of rewarded and offerwall ads.

0.0.1 #

  • TODO: Describe initial release.

example/lib/main.dart

import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:ironsource_flutter_ads_example/ironsource_android_widget.dart';
import 'package:ironsource_flutter_ads/IOS/ironsource_flutter.dart';

import 'ironsource_ios_widget.dart';


void main() {

  runApp(MyApp());
}



class MyApp extends StatefulWidget {

  @override
  State<StatefulWidget> createState() {
    // TODO: implement createState

    if (defaultTargetPlatform == TargetPlatform.android) {

      return IronsourceAndroidState();
    }else if (defaultTargetPlatform == TargetPlatform.iOS){

      return IronsourceIOSState();
    }

    return null;
  }



}

Use this package as a library

1. Depend on it

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


dependencies:
  ironsource_flutter_ads: ^1.0.2

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:ironsource_flutter_ads/IOS/ironsource_banner.dart';
import 'package:ironsource_flutter_ads/IOS/ironsource_banner_controller.dart';
import 'package:ironsource_flutter_ads/IOS/ironsource_banner_size.dart';
import 'package:ironsource_flutter_ads/IOS/ironsource_event_handler.dart';
import 'package:ironsource_flutter_ads/IOS/ironsource_events.dart';
import 'package:ironsource_flutter_ads/IOS/ironsource_flutter.dart';
import 'package:ironsource_flutter_ads/IOS/ironsource_flutter_ads.dart';
import 'package:ironsource_flutter_ads/IOS/ironsource_interstitial.dart';
import 'package:ironsource_flutter_ads/android/Ironsource_consts.dart';
import 'package:ironsource_flutter_ads/android/ironsource.dart';
import 'package:ironsource_flutter_ads/android/ironsource_banner.dart';
import 'package:ironsource_flutter_ads/android/ironsource_error.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
48
Health:
Code health derived from static analysis. [more]
99
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
95
Overall:
Weighted score of the above. [more]
73
Learn more about scoring.

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

  • Dart: 2.7.1
  • pana: 0.13.6
  • Flutter: 1.12.13+hotfix.8

Health issues and suggestions

Document public APIs. (-0.34 points)

130 out of 133 API elements have no dartdoc comment.Providing good documentation for libraries, classes, functions, and other API elements improves code readability and helps developers find and use your API.

Fix lib/IOS/ironsource_flutter_ads.dart. (-0.50 points)

Analysis of lib/IOS/ironsource_flutter_ads.dart reported 1 hint:

line 1 col 8: Unused import: 'dart:async'.

Fix lib/android/ironsource.dart. (-0.50 points)

Analysis of lib/android/ironsource.dart reported 1 hint:

line 6 col 8: Duplicate import.

Format lib/IOS/ironsource_banner.dart.

Run flutter format to format lib/IOS/ironsource_banner.dart.

Fix additional 5 files with analysis or formatting issues.

Additional issues in the following files:

  • lib/IOS/ironsource_banner_controller.dart (Run flutter format to format lib/IOS/ironsource_banner_controller.dart.)
  • lib/IOS/ironsource_banner_size.dart (Run flutter format to format lib/IOS/ironsource_banner_size.dart.)
  • lib/IOS/ironsource_event_handler.dart (Run flutter format to format lib/IOS/ironsource_event_handler.dart.)
  • lib/IOS/ironsource_interstitial.dart (Run flutter format to format lib/IOS/ironsource_interstitial.dart.)
  • lib/android/Ironsource_consts.dart (Run flutter format to format lib/android/Ironsource_consts.dart.)

Maintenance suggestions

Homepage URL is insecure. (-5 points)

Update the homepage field and use a secure (https) URL.

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.8
sky_engine 0.0.99
typed_data 1.1.6
vector_math 2.0.8
Dev dependencies
flutter_test