flutter_ads 0.1.4

  • Readme
  • Changelog
  • Example
  • Installing
  • 77

flutter_ads 0.1.3 #

开屏广告 #

Android平台内部集成了广告sdk 目前支持gdt和穿山甲广告,ios目前只能手动填入appid和广告位id
if(Platform.isAndroid){
      adsSplashView = AdsSplashView(
        adsTick: (int) {
          print(int);
        },
        asdIsFinish: () {
          Navigator.of(context).pop();
        },
      );
    }else if(Platform.isIOS){
      adsSplashView = AdsSplashView(
        appid: "1105344611",
        placementID: "9040714184494018",
        adsTick: (int) {
          print(int);
        },
        asdIsFinish: () {
          Navigator.of(context).pop();
        },
      );
    }

Bannner广告 #

if (Platform.isAndroid) {
      adsBannerView = AdsBannerView();
    } else if (Platform.isIOS) {
      adsBannerView = AdsBannerView(
        appid: '1105344611',
        placementID: '4090812164690039',
        adsFailure: () {
          print('加载失败');
        },
        asdIsFinish: () {
          print('加载结束');
        },
      );
    }
Container(
          color: Colors.blue,
          child: ListView.builder(
              itemCount: 10,
              itemBuilder: (context, index) {
                return adsBannerView;
              })),

激励视频(目前仅限于Android平台的穿山甲广告) #


 FlutterAds.initRewardVideo(appKey:"5007439",codeId: "907439399",userId:"1992",callback: (value){
                      print("广告结果$value");
                      test ="广告结果1$value";
                      setState(() {});
                    });

Android广告加载不出来请检查后台kv配置,包名,签名是否有误 #

0.0.8 #

  • TODO: Describe initial release.

example/README.md

flutter_ads_example #

Demonstrates how to use the flutter_ads plugin.

Getting Started #

This project is a starting point for a Flutter application.

A few resources to get you started if this is your first Flutter project:

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

Use this package as a library

1. Depend on it

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


dependencies:
  flutter_ads: ^0.1.4

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:flutter_ads/flutter_ads.dart';
  
Popularity:
Describes how popular the package is relative to other packages. [more]
63
Health:
Code health derived from static analysis. [more]
98
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
80
Overall:
Weighted score of the above. [more]
77
Learn more about scoring.

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

  • Dart: 2.7.0
  • pana: 0.13.4
  • Flutter: 1.12.13+hotfix.5

Health suggestions

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

Analysis of lib/ads_splashview.dart reported 2 hints:

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

line 37 col 38: This function has a return type of 'Future', but doesn't end with a return statement.

Fix lib/ads_bannerview.dart. (-0.50 points)

Analysis of lib/ads_bannerview.dart reported 1 hint:

line 42 col 38: This function has a return type of 'Future', but doesn't end with a return statement.

Fix lib/ads_nativeview.dart. (-0.50 points)

Analysis of lib/ads_nativeview.dart reported 1 hint:

line 3 col 8: Unused import: 'package:flutter/services.dart'.

Fix additional 3 files with analysis or formatting issues. (-0.50 points)

Additional issues in the following files:

  • lib/flutter_ads.dart (1 hint)
  • lib/ads_videoview.dart (Run flutter format to format lib/ads_videoview.dart.)
  • lib/generated/i18n.dart (Run flutter format to format lib/generated/i18n.dart.)

Maintenance suggestions

The package description is too short. (-20 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

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